Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question Apache2 + CGI: "You don't have permission..."

    trying to run python scripts on my Apache2 through CGI.
    I am running BackTrack 5 -

    This is the content of my /etc/apache2/sites-available/default
     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
    After restarting the Apache server, /etc/init.d/apache restart
    I try to access the script:

    print "Content-type: text/html\n\n"
    print "Hello, World."
    for i in 'hello':
        print i+'\n'
    ..from the following URL: localhost/cgi-bin/
    And I am getting this error:

    403 Forbidden
    You don't have permission to access /cgi-bin/ on this server.
    The Apache-logs shows this error:
    [Sat Dec 31 12:21:32 2011] [error] [client] (13)Permission denied: access to /cgi-bin/ denied
    Both the /cgi-bin/ and the is sat to 755 permission, have also tried with 777.

    I have also tried all this from the /cgi-bin/ directory in /root/public_html

    Any help is appreciated!

  2. #2
    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.

  3. #3
    Thank you!
    I created /public_html outside the /root directory, sat the permissions to 777 - It works!

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts