When Brains Fly

An Awesome Blog About Neuroscience, Computer Science, and Technology

Setting Up AWStats

[ January 14th, 2009 ]

My webhost, NearlyFreeSpeech.NET (NFSN) made this pretty easy.

First, I made sure that my access log was enabled. Then, I made a cgi script in /home/public called awstats.cgi which had the following contents:

exec nfsn-awstats

(Don’t forget the line break on the second line.)

Next, I set the file’s permissions to 755, opened up a browser to http://www.whenbrainsfly.com/awstats.cgi, and did what it told me, which was to enter into the shell:

cp -r /usr/local/www/awstats/icons /home/htdocs/.nfsn-awicons
ln -s /usr/local/www/awstats/icons /home/htdocs/.nfsn-awicons
# 2009-12-15: Replaced with cp because images were still broken. Thanks Barb!

Finally, I refreshed and it was all set up!

I wanted to change the time zone used by AWStats, so I went to http://www.whenbrainsfly.com and then in the shell, I entered:

tail /home/logs/access_log

to see what time it says the last visit to my site was. It says I visited at 19:27 and it is now actually 14:27, so it’s 5 hours early (or is it late?).

In the shell, I changed the permissions of /home/private/ to 711 to make my files there executable. Then I created a file named .awstats.conf there and changed its permissions to 644.

Within .awstats.conf, I put

HostAliases="whenbrainsfly.nfshost.com www.whenbrainsfly.com"

LoadPlugin="timezone -5"

The first two lines let me combine stats from both aliases of my site into one, and the last line handles the time zone shift.

Then, I had to rebuild the monthly reports (of which there was only one), so I went to /home/tmp/ deleted all files that matched awstatsMMYYYY.txt, and re-opened http://www.whenbrainsfly.com/awstats.cgi in my browser.

I went down to the Hours section http://www.whenbrainsfly.com/awstats.cgi?framename=mainright#hours and it said “Hours (GMT -5)” and the visit times so far looked correct. Hooray!

To double-check that my configuration settings were applied, I looked at /home/tmp/nfsn-awstats.conf and confirmed that what I had written in .awstats.conf was there.

So now you can find my site stats at http://www.whenbrainsfly.com/awstats.cgi.


2 Responses to “Setting Up AWStats”

  1. Isabel said...

    I want to set up AWstats independently for this customer so he can access them himself.

    My webhost, Bluehost.com, already uses AWstats but since I host all my websites with them, I don’t want my client to have access to everything on my control panel, which is the only way it can happen now.

    Is there anyway to setup AWstats so that my client can have access to his stats only or can I set up an independent AWstats just for him and he can access them somewhere else — maybe have them forwarded to a website page he can visit or something

    BTW, I just noticed your blog back ground and really like it


  2. Ryan said...

    Hi Isabel,

    Thanks for stopping by. I’m not totally sure how to do that since I’m not sure how your webhost has AWStats set up. I’m also not sure I understand your question – do you mean you have a lot of websites on your account and you want to have an AWStats page just for his site? This looks like it would be useful: http://awstats.sourceforge.net/docs/awstats_security.html, particularly the Medium Secured Policy.

    Hope this helps,

Leave a Comment!

Proudly powered by WordPress. Theme developed with WordPress Theme Generator.
Copyright © When Brains Fly. All rights reserved.