Results 1 to 4 of 4

Thread: Apache 2 -> 403 Forbidden when accessing cgi-bin

  1. #1
    Join Date
    Sep 2005
    Location
    Davis, CA
    Beans
    266
    Distro
    Ubuntu 9.10 Karmic Koala

    Apache 2 -> 403 Forbidden when accessing cgi-bin

    I have had apache2 working for quite some time now. I have just got into learning some PERL so I would like to get cgi-bin working. When I try to access the cgi-bin though, I get a 403 forbidden error. I have the same permissions on the folder that I have on the index.html and mythweb.

    Any Ideas?

    Thanks,
    Hans

    P.S. My webserver is at http://hans.blogsite.org

    Code:
    hansoffate@grunt:/var/www$ ls -l
    total 16
    drwxr-xr-x 2 root       root       4096 2008-10-19 19:48 cgi-bin
    -rwxr-xr-x 1 root       root         45 2008-04-28 01:13 index.html
    lrwxrwxrwx 1 root       root         25 2008-01-06 04:40 mythweb -> /usr/share/mythtv/mythweb
    from sites-available/default
    Code:
    NameVirtualHost *
    <VirtualHost *>
            ServerAdmin webmaster@localhost
    
            DocumentRoot /var/www/
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/>
                    Options Indexes FollowSymLinks
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    
            ScriptAlias /cgi-bin/ /var/www/cgi-bin/
            <Directory "/var/www/cgi-bin/">
                    AllowOverride None
                    Options +ExecCGI
                    AddHandler cgi-script cgi pl
                    Order allow,deny
                    Allow from all
            </Directory>
    
            ErrorLog /var/log/apache2/error.log
    Last edited by hansoffate; October 20th, 2008 at 05:08 AM.

  2. #2
    Join Date
    Jun 2008
    Location
    Tennessee
    Beans
    3,421

    Re: Apache 2 -> 403 Forbidden when accessing cgi-bin

    Is your script executable?

  3. #3
    Join Date
    Sep 2005
    Location
    Davis, CA
    Beans
    266
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Apache 2 -> 403 Forbidden when accessing cgi-bin

    Quote Originally Posted by lykwydchykyn View Post
    Is your script executable?
    The script is executable but it doesn't matter right now. I can't even get into the cgi-bin/ folder. It should have the correct permissions (see first post), that's why I don't understand why it says it doesn't.

    Thanks for the help.

    ::EDIT::
    Nevermind, I thought when accessing cgi-bin, it would list out the files in the folder. Instead, if I point it to the full path of the .pl/.cgi file, it'll actually run the script. Thanks for the help.
    Last edited by hansoffate; October 20th, 2008 at 08:19 AM.

  4. #4
    Join Date
    Jun 2008
    Location
    Tennessee
    Beans
    3,421

    Re: Apache 2 -> 403 Forbidden when accessing cgi-bin

    Ah yes. If you want listings like that, you'd have to change:
    Code:
     <Directory "/var/www/cgi-bin/">
                    AllowOverride None
                    Options +ExecCGI
    (...etc)
    To this:
    Code:
     <Directory "/var/www/cgi-bin/">
                    AllowOverride None
                    Options +ExecCGI +Indexes
    (etc...)

Bookmarks

Posting Permissions

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