post Category: Code — Chris @ 4:13 am — post

Spent the last hour setting up AWStats on my Ubuntu server. What’s annoying is that the package is pre-configured for Apache — I completley understand why this is done, but when you don’t run Apache it is slightly irritating.

Things to note when not running Apache:

Make sure that /var/lib/awstats/ is chmod'ed to permissions that your webserver can read from. Here’s the cron code I used to make sure awstats updates itself every 10 minutes:

0,10,20,30,40,50 * * * * nobody [ -x /path/to/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /path/to/access.log ] && /path/to/awstats.pl -config=<domain name> -update >/dev/null

My webserver is securely running as nobody so it’s important the we use the same user to perform the cron job to update awstats’ datafile.

As mentioned previous, the important part here is making sure that this cron job can update files within /var/lib/awstats/. A chmod 640 will provide ample security here, allowing the webserver user to read and write, as well as allowing the group to read the file.

That all done, AWStats is now up and running and providing some interesting statistics..! ;)

Sorry, no comments yet.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.
 

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 4 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a