[Tutor] Python in Apache?

Israel Evans israel@lith.com
Thu, 24 Jan 2002 22:16:45 -0800


Thanks for the tip!

     I was able to set things up like you said and was able to get the alias
to work, but after saving the file in the new aliased directory, I restarted
the server and tried to execute the .py file, but I got a 404 and I was told
that the file couldn't be found even though it's actually there??!!

This is what the Error log tells me...

(2)No such file or directory: script not found or unable to stat: c:/program
files/apache group/apache/pyscriptstest.py

HOLD IT!

You are a SAINT!   I noticed the error stated that it couldn't start the
file pyscriptstest.py.  What is missing here is a "/".  I went in and made
sure both the script alias and the directory paths in the .conf file ended
with such a wonderful little character and afterwards my python file worked
like a charm!!!
 

Thanks!

~Israel~



-----Original Message-----
From: Karthik Gurumurthy [mailto:karthikg@aztec.soft.net]
Sent: Thursday, January 24, 2002 10:16 PM
To: Israel Evans
Subject: RE: [Tutor] Python in Apache?
Importance: High


i had sent this mail to someone who had asked this question earlier
I have'nt read your mail fully.
Try the steps i have enlisted here and hopefully it s'd work.
am forwarding the contents of the mail.

karthik.


-----Original Message-----
From: karthik Guru [mailto:karthikg@aztec.soft.net]
Sent: Saturday, January 05, 2002 10:14 PM
To: McCarney, James Alexander; 'tutor@python.org'
Subject: RE: [Tutor] CGI and ODBC questions
Importance: High


for apache server,

Look for the file httpd.conf under the directory where you installed apache
in my case..this is the path.
D:\Program Files\Apache Group\Apache\conf

say Create a folder PythonScripts under \Apache

look for an already exiting entry for ScriptAlias in httpd.conf file.

You can copy the same and create a new one like this where you can put your
python files
....
ScriptAlias /python/ "d:/Program Files/Apache Group/Apache/PythonScripts/"
....
Look for a <Directory element entry.
eg: it would looklike this..

<Directory "d:/Program Files/Apache Group/Apache/cgi-bin">
    AllowOverride None
    Options None
</Directory>

Copy the same thing and change the folder name. So you will have another
entry like this.

<Directory "d:/Program Files/Apache Group/Apache/PythonScripts">
    AllowOverride None
    Options None
</Directory>

Then add the following entry to the httpd.conf file:

ScriptInterpreterSource Registry


Now you can place all your python cgi files in the PythonScripts folder
and acess it like this:

http://localhost/python/test.py

hope it works for you!

karthik.