AWSTATS permissions problem.

Discussion in 'Server Operation' started by Heeter, Mar 4, 2016.

  1. Heeter

    Heeter Member

    Hi all,

    My server is spitting up this error for the last little while. trying to figure out how to fix:

    Cron <[email protected]> [ -x /usr/share/awstats/tools/ ] && /usr/share/awstats/tools/
    Error while processing /etc/awstats/awstats.conf
    Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 7.2 (build 1.992)
    From data in log file "/var/log/apache2/access.log"...
    Error: Couldn't open server log file "/var/log/apache2/access.log" : Permission denied
    Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
  2. Active Member

    Well yeah ... your apache access log probably is not owned by www-data so it can't read the log.
    Which is good if you run other processes as www-data and don't want to leak data - specially if you run mod_php or alike.
    On the other hand bad if you want to run some cron as www-data to read those files.
    Are you on Debian 8 by any chance?

    Check your /var/log/apache2 - folder ( use ls -Alah or alike ) should give something like
    -rw-r----- 1 root adm 22K Mar 7 19:45 access.log

    You could add a user belonging to adm group and it would be able to read those files.
    You also could change the way the logs are created and open up permissions which... I wouldn't advise.
  3. Heeter

    Heeter Member

    Thanks for your response,

    I am going to take your advise and not change it. I never use awstats anyways.

    I am on Ubuntu LTS14.04 LAMP

    Is there a way to safely remove awstats?

  4. Active Member

    You can call awstats on your own and specify different config files as param. Just comment out the lines in /etc/cron.d/awstats or delete that file.

    Software removal should be done by issueing "apt-get --purge remove awstats" which should remove your awstats configs and software.
    There might be a leftover /var/lib/awstats folder though, you can delete it afterwards aswell.
  5. Heeter

    Heeter Member

    Awesome, Thanks!!!!!!!!!!!

    Can I use the same command to remove webalizer too? I never use that either
  6. Active Member

    Sure, if you don't need webalizer for anything you should be able to remove it the same way.
    apt-get --purge remove completly removes anything you like ( or don't like :D ).
  7. Heeter

    Heeter Member


    This is a private owncloud server for myself and my family, so I have no need for stuff like this on it.


Share This Page