472,353 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Embeded Python in Apache2 not doing its job

6
Hi,

I'm new to both Python and Apache so sorry for any upcoming
dummy questions :)

I'm running Linux (Ubuntu 6.10) and have installed the following:
- Apache 2.0.55
- Python 2.4.4c1
- libapache2-mod-python

One thing I'm still not clear about is if mod-python and CGI scripts are
the same thing or not ? Because I think I've got it all mixed up. I don't
think that mod-python is really needed to run python scripts or am I
wrong ?

Anyways, in /etc/apache2/apache2.conf I have the following lines
AddHandler cgi-script .py
<Directory /var/www>
AddHandler mod_python .py
</Directory>

In the directory /var/www I have 2 files htmlgen.py and mypage.html

File: htmlgen.py
------------------------
import cgi

print "Content-type: text/html\n\n"
print "Testing..."

File mypage.html
--------------------------
<form action="htmlgen.py" method="post">
<input type="submit" value="Test">
</form>

Now when I open mypage.html I get a button saying "Test". When I press this button Firefox wants to download the file called htmlgen.py. Why? Apache is not running the file, just sending it.

I hope someone can help me. I've read all documentation I could find but don't know what is wrong.

Best Regards
/P
Dec 8 '06 #1
0 950

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ad Astra | last post by:
I am completely new to PHP and am finding installation the most difficult part to understand and implement. Could someone please review the rather...
3
by: Krzysztof Drozd | last post by:
how to configure apache 2 to work with python or mod_python? krzysiek ps: sory,my english is't perfect :)
1
by: neha | last post by:
hi, i m trying to integrate python with apache on linux.For this i m using mod_python. I dont see any problem with the versions of python,apache...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 416 open ( +3) / 3408 closed ( +1) / 3824 total ( +4) Bugs : 898 open ( +1) / 6180...
1
by: wadacom | last post by:
I'm sorry to take your time for newbie problems but I've been searching what to do about the problem with my apache server I have. I work with ubuntu...
0
by: fabien.lyon | last post by:
-----Message d'origine----- De : fabien.lyon Envoyé : mercredi 30 mai 2007 20:16 À : 'python-list@python.org' Objet : RE: embeded python progam...
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I...
3
by: rmompo | last post by:
Hi, im new at Python and i'm having problems putting it online. this is the plataform: Windows XP Professional SP2 Apache/2.2.4 (Win32)...
1
by: Gowri | last post by:
Hello, I am new to Python and am trying to setup Apache to serve Python using mod_python. I'm using a Windows XP box. here is a list of steps i...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.