Difficulty configuring web server for Python

mbf2y at my-deja.com mbf2y at my-deja.com
Mon Aug 16 10:44:56 EDT 1999


My situation: I just obtained a "virtual web server" account at a web
hosting place, where I have full access to UNIX on the box and can
modify my apache config files, etc.  They advertise that they support
Perl, C, and C++ for CGI scripting.  Needless to say, first thing I did
when I got the account was to build a copy of Python.  Python appears to
work fine.

I built a simple CGI script and kept getting error 500, so I simplified
to the below script:

#!/usr/home/campusch/usr/local/bin/python


print "Content-type: text/html"
print
print "<HTML><BODY><H1>Hello World!</H1></BODY></HTML>"
print


1) Python is installed in /usr/home/..../python
2) running "python simp.py" from the command prompt gives me the
expected result.
3) running "./simp.py" from that directory runs the program just fine.
4) python itself has been chmod ugo+x so the web server process should
be able to run it.
5) This script has been chmod ugo+x so the web server process should be
able to run it.
6) The script is in the correct directory; I installed a "supported"
perl script in this directory and got it to work no problem.

This is what gets written to the server log when I try to run my script:

[Sun Aug 15 21:59:31 1999] [error] (2)No such file or directory: exec of
/usr/local/etc/httpd/cgi-bin/simp.py failed
[Sun Aug 15 21:59:31 1999] [error] Premature end of script headers:
/usr/local/etc/httpd/cgi-bin/simp.py

While the "no such file or directory" threw me, this is not a file not
found error... when I tried to run a script that really wasn't there, I
got:

[Sun Aug 15 22:10:18 1999] [error] script not found or unable to stat:
/usr/local/etc/httpd/cgi-bin/foo.py

I noticed in my srm.conf file that they had the line
AddType application/x-httpd-cgi .cgi

in there, so I renamed the .py file to .cgi.  No help at all.

As for the OS I'm running, here's what python prints on the first line
when I run it:

Python 1.5.2 (#3, Aug 15 1999, 19:04:09)  [GCC 2.7.2.1] on bsdos3

My first recourse (after spending 3 hours trying to chase this down) was
to contact tech support; they agreed with me that Python is a robust
scripting language, but in order to make sure that they have time to
handle all their clients' requests for supported software, they have had
to tighten their policy and they aren't allowed to even help me a teensy
bit when I'm using unsupported software.

Frustrating as heck.  Anyway, if anyone here has any suggestions as what
to try next, I would appreciate it.  I can't recompile apache but I can
change the config files.  I can however run a script to find out the
version of Apache I'm using, and here it is:

Server version: Apache/1.3.1.1 SSL/1.15 PHP/3.0.3
Server built:   Jun  3 1999 11:15:00
Standalone Configuration

I don't want to have to learn perl and I really don't want to do my
scripting in C++.  So if anyone here has any suggestions, I'd greatly
appreciate it.

Thanks,
-Fred


--------
Michael "Fred" Fredericks
PhD Student, Computer Science
University of Maryland College Park
fred.at.cs.dot.umd.dot.edu  ---- note I never check my dejanews mail.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list