Help with Apache 2.0.47 and CGI

  • Thread starter Fausto Arinos de A. Barbuto
  • Start date
F

Fausto Arinos de A. Barbuto

Hi All;

I have Apache 2.0.47 installed for a single user on port 8080, Python
2.3.2 on C:\Python23 and ActiveState's Perl on C:\Perl. Everything seems
to work fine after the changes I made in httpd.conf, but I can't for some
reason run Python scripts that sit on this computer's cgi-bin directory
(Perl
scripts run ok). The message I get in either IE 6 and Netscape 7.1 is
"Internal Server Error". Have any of you had similar experience?

Another peculiar thing is that Perl scripts run OK in Netscape 7.1,
although IE 6 tries to *download* .pl files instead of running them -- as if
I were ftp-ing a file from some web site. Any clues?

Any help will be much appreciated. Thanks.

---Fausto
 
E

Emile van Sebille

Fausto Arinos de A. Barbuto asks
I have Apache 2.0.47 installed for a single user on port 8080, Python
2.3.2 on C:\Python23 and ActiveState's Perl on C:\Perl. Everything seems
to work fine after the changes I made in httpd.conf, but I can't for some
reason run Python scripts that sit on this computer's cgi-bin
directory


http://www.modpython.org/

http://www.modpython.org/live/mod_python-3.1.2b/doc-html/inst-apacheconfig.html

LoadModule python_module libexec/mod_python.so
SetHandler python-program
PythonHandler mod_python.cgihandler

But there was also a problem reported with 2.3:

http://groups.google.com/[email protected]

HTH,
 
F

Fausto Arinos de A. Barbuto

Thank you very much Emile -- it is not working yet, although I have
already downloaded and installed mod_python. Apache says it can't
find the module mod_python.so even though the bloody little thing is
right there where it should be, in C:\Apache Group\Apache2\modules.
It seems that Python 2.3.2 is the bad guy here. A friend of mine has
Apache 2.0.47 + Python 2.2 and everything works like a charm on his
system.

I guess I'm on the right track now. Many thanks.

---Fausto
 
E

Eric Williams

Fausto said:
Hi All;

I have Apache 2.0.47 installed for a single user on port 8080, Python
2.3.2 on C:\Python23 and ActiveState's Perl on C:\Perl. Everything seems
to work fine after the changes I made in httpd.conf, but I can't for some
reason run Python scripts that sit on this computer's cgi-bin directory
(Perl
scripts run ok). The message I get in either IE 6 and Netscape 7.1 is
"Internal Server Error". Have any of you had similar experience?

Another peculiar thing is that Perl scripts run OK in Netscape 7.1,
although IE 6 tries to *download* .pl files instead of running them -- as
if I were ftp-ing a file from some web site. Any clues?

Hallo, Fausto,

You might make sure there's an entry like this:

AddHandler cgi-script .cgi .py .pl

in either httpd.conf or an .htaccess file for your cgi-bin directory. (Or
use .pyw instead of .py if your programs are like that. ) You should find a
similar entry somewhere for .pl or .cgi files, so just add it there.

I've never used apache on windows, but that's necessary on linux/solaris.

As for the 500 error, you might try to run the files from the command-line
as well, to make sure they aren't crashing and sending tracebacks before
returning to the cgi-handler.

Make sure python's in your path, of course.

If all else fails, add the following line to the import section of your
python cgi scripts:

import cgitb; cgitb.enable()

This can be helpful in debugging, as tracebacks get sent correctly to the
cgi-handler instead of bombing out to stderr, causing an "incomplete
headers" 500 error.


Hope something there helps!

cya,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top