Forum Moderators: phranque

Message Too Old, No Replies

making python/perl work with apache2?

having permission problems while trying to set up cgi scripts

         

furtivefelon

3:44 am on Jan 17, 2006 (gmt 0)

10+ Year Member



hello everyone!

I'm trying for a couple of hours now to set up apache/python cgi on my ubuntu development machine.. Though, whenever i go to the cgi file, it give me a 403 Forbidden page.. Exactly as follows:
Forbidden

You don't have permission to access /www/test.cgi on this server.
Apache/2.0.54 (Ubuntu) mod_python/3.1.3 Python/2.4.2 PHP/5.0.5-2ubuntu1.1 Server at localhost Port 80

My httpd.conf file is as follows(noting that /var/www/ is the folder where the root www folder resides):
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
AddHandler cgi-script .cgi .py .pl
<Directory /var/www>
Options +ExecCGI
AddHandler cgi-script .cgi .py .pl
</Directory>

Also, i have chmod all file permission to 777..

The content of the cgi is the most basic testing script and should not have any problems, is as follows:
#!/usr/bin/python

# Required header that tells the browser how to render the text.
print "Content-Type: text/plain\n\n"

# Print a simple message to the display window.
print "Hello, World!\n"

Anyone know what am i doing wrong?

Thanks alot!

jdMorgan

3:28 pm on Jan 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...Mostly just bumping your thread up, but you *did* restart the server after making httpd.conf changes, right?

Are there any other access controls in httpd.conf or .htaccess that would prevent direct HTTP requests to /cgi-bin? (it would be normal to have such access controls to prevent direct Web requests of your scripts, but they'd need to be disabled for this kind of testing by direct-requesting the script).

Jim

furtivefelon

8:12 pm on Jan 17, 2006 (gmt 0)

10+ Year Member



well, since i'm using apache2, there is absolutely nothing in the httpd.conf file to begin with.. On the top, there is a comment telling me that httpd.conf is here for backward compatibility, so i assume it would work..

Yes, i did restart the server after each change to httpd.conf

thanks alot!