Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup AWStats on my VPS to get some more insight into the traffic coming to my site. As instructed I ran a manual build/update which ran fine:

sudo -u www-data ./

Create/Update database for config "/etc/awstats/" by AWStats version 6.9 (build 1.925)
From data in log file "/usr/share/doc/awstats/examples/ /var/www/*-access.log |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Warning: awstats has detected that some hosts names were already resolved in your logfile /usr/share/doc/awstats/examples/ /var/www/*-access.log |.
If DNS lookup was already made by the logger (web server), you should change your setup DNSLookup=1 into DNSLookup=0 to increase awstats speed.
Jumped lines in file: 0
Parsed lines in file: 814
 Found 0 dropped records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 814 new qualified records.

It also produced the file in the DatDir: /var/lib/awstats/ which contains what I would expect.

BUT when I visit: it tells me

Last Update:  Never updated (See 'Build/Update' on awstats_setup.html page)

and the rest of the page is blank. I'm pretty sure I set it up correctly but now I cannot figure out why this is happening. Hopefully someone smarter then me can help me.

share|improve this question

closed as off-topic by Jenny D, Katherine Villyard, 84104, Scott Pack, Ward Apr 17 '15 at 3:05

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

With blank I did not mean blank but an AWStat page without any stats . Sorry for the possible confusion. – user42260 May 5 '10 at 7:56

Two possibilities.

Either the permissions of the file created when you run awstats are not set to allow your webserver to read the files, i.e. they are owned by a user other than www-data and have permissions of 640.


The regexp is set so that the hostname is expecting the URL to be and you are visiting (less likely based on the fact that your sudo -u www-data method worked)

share|improve this answer

First try to find the awstats/tools directory and execute the update all script.

/usr/share/awstats/tools/ now

It will tell you clearly, if any permission issue exists on any of these files: server logfile, awstats conf files, awstats directory for writing data.

Otherwise, if it executes properly, it will update the "Last Update" info in the statistics web UI.

And, it is better to schedule a cron job to regularly update the AWSats databse using newly created log entries.

share|improve this answer

For me it was a problem with selinux.

grep /var/log/audit.log

showed denied statements for getattr, read, open and ioctl operations for command issued by the httpd_t context.

to allow these operations i put these lines through audit2allow like this:

audit2allow -m 'httpd_awstats' <<EOF
<paste the regarding lines from /var/log/audit/audit.log here>

creates a selinux policy

semodule -i httpd_awstats.pp

activates that policy

if you use centos 7 /var/log/audit/audit.log is replaced by journald. to get the logs from there use the following command

journalctl -xln 50 --no-pager | grep

the 50 is the number of last lines to fetch from the log

share|improve this answer