473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 989

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 long missive below and assist me? I have...
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 and mod_python i m using. the versions i m using...
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 closed (+13) / 7078 total (+14) RFE : 234 open...
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 dapperdrake I put the last apache server on it...
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 into visual C++ application crash 2.5.1 is...
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 added <Directory...
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 followed for the installation: 1. Installed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.