Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2004

    Unhappy Awstats gives forbidden error


    I have installed awstats on a plain server and when I try to take it through IP/awstats in the browser, it gives Forbidden error. Apache error log shows "attempt to invoke directory as script: /var/www/awstats/"

    Does anyone know how i can get the awstats working.. I had been sitting with this for some time and cant get it to working yet.. Please help..

  2. #2
    Join Date
    Jul 2002
    forbidden error appear to be permission misconfiguration on your server. do you have script alias configure properly in apache and perl permission properly setup ?

  3. #3
    Join Date
    Jul 2005
    Is 'awstats' a ScriptAlias that you're trying to access via A ScriptAlias'd directory won't always cooperate with a DirectoryIndex, and thus the attempt to access and "execute" directory will result in "hey... we can't execute that" error.

    For example, if I go to: directly in my web-browser, it fails with a 403 and my log gets the following line:

    [Sat Jul 9 10:19:30 2005] [error] [client] attempt to invoke directory as script: /home/jeff/

    If I input the entire script name '', it works flawlessly.

    So in a nutshell, go use the entire URL and don't rely on a DirectoryIndex.
    Last edited by McJeff215; 07-09-2005 at 10:22 AM.

  4. #4
    Join Date
    Dec 2004
    Thanks for your response.

    Okay.. so it is normal to get that error when I access the awstats directory like that, right?

    ScriptAlias /awstats /var/www/awstats

    is what i have given in httpd.conf

    I can get Awstats now when I take ip/awstats/ .. Now issue is that when I click on UpdateNow i get:

    Error: Couldn't open server log file "/var/log/httpd/access_log" : Permission denied

    Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
    Check config file, permissions and AWStats documentation (in 'docs' directory).

    Checked the permission on /var/log/httpd/access_log
    # ll /var/log/httpd/access_log
    -rw-r--r-- 1 root root 2337345 Jul 9 12:20 /var/log/httpd/access_log

    and the awstats conf file:

    # ll /etc/awstats/awstats.conf
    -rw-r--r-- 1 root root 58383 Jul 8 12:41 /etc/awstats/awstats.conf

    Any idea??

  5. #5
    Join Date
    Jul 2005
    Yup, normal to get that error while accessing files in a ScriptAlias'd directory like that.

    What are the permissions on the dirs leading up to access_log? Can the web server user access the directories leading up to the access_log file? He'll at least need execute permissions on '/var', '/var/log', and '/var/log/httpd.'

    I believe the default permissions on the /var/log/httpd directory (on Fedora systems, at least) is root:root 700. Do a "chmod w+x /var/log/httpd" and you'll be OK. I believe those files are written with world-readable permissions, anyways.

    There are "more secure" ways to handle it, but adding an execute bit to a directory that only contains log files isn't going to hurt.


Posting Permissions

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