Results 1 to 3 of 3
Hi,
trying to run python scripts on my Apache2 through CGI.
I am running BackTrack 5 - 2.6.39.4
This is the content of my /etc/apache2/sites-available/default
Code:
.
.
.
ScriptAlias ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-31-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 4
Apache2 + CGI: "You don't have permission..."
Hi,
trying to run python scripts on my Apache2 through CGI.
I am running BackTrack 5 - 2.6.39.4
This is the content of my /etc/apache2/sites-available/default
After restarting the Apache server, /etc/init.d/apache restartCode:. . . ScriptAlias /cgi-bin/ /root/public_html/cgi-bin/ <Directory /cgi-bin/> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch AddHandler cgi-script py Order allow,deny Allow from all </Directory> . . .
I try to access the sample.py script:
..from the following URL: localhost/cgi-bin/sample.pyCode:#!/usr/bin/python print "Content-type: text/html\n\n" print "Hello, World." for i in 'hello': print i+'\n'
And I am getting this error:
The Apache-logs shows this error:Code:403 Forbidden You don't have permission to access /cgi-bin/sample.py on this server.
Both the /cgi-bin/ and the sample.py is sat to 755 permission, have also tried with 777.Code:[Sat Dec 31 12:21:32 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /cgi-bin/sample.py denied
I have also tried all this from the /cgi-bin/ directory in /root/public_html
Any help is appreciated!
- 12-31-2011 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,663
It is probably that your aliased dir is in /root, which itself is not accessible by the apache user (even tho the public_html dir is). Try moving that dir to somewhere else (e.g. /www/public_html). Ensure that the parent dir (e.g. /www) has read/execute by all permissions on it.
- 12-31-2011 #3Just Joined!
- Join Date
- Jan 2011
- Posts
- 4
Thank you!
I created /public_html outside the /root directory, sat the permissions to 777 - It works!



