Permission problem: Awstats

November 5, 2014 18.8k views


I try to install Awstats and get it to work. i have follow this guide:

But i end up whit a 403 forbidden pages.

I dont know where the block is. Any suggestions?

  • Hi!
    Did all the commands succeed when you were going through the tutorial?

  • Yes no error.

  • Hi,

    Are there any errors in apache’s error log?

    sudo tail -40 /var/log/apache2/error.log
  • Hi

    I have found this in the error log:

    [Thu Nov 06 13:27:02.271407 2014] [cgi:error] [pid 18656] [client] attempt to invoke directory as script: /usr/lib/cgi-bin/

2 Answers

Edit /etc/apache2/sites-available/000-default.conf:

sudo nano /etc/apache2/sites-available/000-default.conf

and replace:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/


Alias /awstats /usr/lib/cgi-bin
<Directory /usr/lib/cgi-bin>
 AddHandler cgi-script cgi pl
 Options ExecCGI

then restart Apache:

sudo service apache2 restart

Does that fix it?

  • No it dont fix the problem.

    Now i have this error in the log:

    [Fri Nov 07 10:07:22.656954 2014] [autoindex:error] [pid 11915] [client] AH01276: Cannot serve directory /usr/lib/cgi-bin/: No matching DirectoryIndex (index.php,index.html,index.cgi,,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive

    What can fix that?

  • Can you try browsing to http://ip or domain/awstats/ If that works, add the following line after Options ExecCGI:


    and restart Apache again.

  • Yes that works.

Have another answer? Share your knowledge.