Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Im having an issue installing apache2 in Ubuntu 12.04. Im trying to set the cgi-bin folder in the path /home/www/cgi-bin. Ive followed and search all over the internet but I still dont get it...

Writing in the browser "localhost" I enter to the index of folders. However, when I click on cgi-bin it gives me the next error:


You don't have permission to access /cgi-bin/ on this server."

I apache2.conf ive only added the next line:

ServerName localhost

And this is how it looks my default file (/etc/apache2/sites-avalaible):

ServerAdmin webmaster@localhost

<Directory />
    Options FollowSymLinks
    AllowOverride None
<Directory /home/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

ScriptAlias /cgi-bin/ /home/www/cgi-bin/

<Directory /home/www/cgi-bin/>
Options ExecCGI
AddHandler cgi-script cgi pl

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

I think I set fine the folders right, but at this point I dont even know...this is how it looks now:

drwxrwxrwx 2 root root 4096 May 16 20:37 cgi-bin

Any idea? Id be really grateful, is kind urgent.

Thanks in advance

share|improve this question
This is the error written in the log file when I write in the browser localhost/cgi-bin [Thu May 16 23:04:00 2013] [error] [client] attempt to invoke directory as script: /home/www/cgi-bin/, referer: localhost –  user159336 May 16 '13 at 21:15
Possible duplicate of this question: Apache2: Forbidden You don't have permission to access /dir/ on this server. –  karel May 17 '13 at 0:27
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.