Alright, here goes. Keep in mind this is just my way of installing AwStats and may not be exactly the setup you're looking for. Works for me, though!
For the purpose of this guide, I'll assume your username is myusername and your domain is example.com
1) Create a directory inside your domain folder. We'll call it "statistics", but it can be anything you like - this is where you'll go to look at your stats later.
2) Grab the latest stable build of AwStats from http://awstats.sourceforge.org, and upload it to your webspace.
3) Make a directory called "awstats" in your home folder (/home/yourusername). Unpack the files into that directory - you should have a folder structure like this:
and so on.
4) Create a directory "data" inside /home/yourusername/awstats/ .
5) Move the files in the /home/yourusername/awstats/wwwroot/cgi-bin/ directory into /home/yourusername/awstats/ .
5) Move the icon, css, and js directories inside awstats/wwwroot into your output directory (/home/yourusername/example.com/statistics/ .
6) Back into the awstats directory inside your home directory - copy awstats.model.conf to awstats.example.com.conf . Then open the new file for editing (or download it and open it).
7) Make the following changes to the parameters:
- Set LogFile to "/home/yourusername/logs/example.com/http/access.log.0
- Set SiteDomain to "example.com"
- Set HostAliases to "www.example.com"
- Set DNSLookup to 0
- Set DirData to "./data/"
- Set DirIcons to "icon"
- Set SaveDatabaseFilesWithPermissionsForEveryone to 0
- Set DefaultFile to "index.php index.html"
8) Save (or save and reupload) the file.
9) Now let's see if everything is working. Enter this command:
perl /home/yourusername/awstats/tools/awstats_buildstaticpages.pl -config=example.com -update
(All on one line - I split it because it caused major horizontal scrolling!) It should happily work away for a couple of seconds.
10) Now check the output folder (/statistics/) in your browser. Look at the awstats.example.com.html file - does everything look good? Great! Then let's setup a cron job to do this automatically.
11) I like Pico for editing the crontab - type
12) Edit the crontab with
Insert this line:
0 3 * * * perl /home/yourusername/awstats/tools/awstats_buildstaticpages.pl -config=example.com -update
All on one line again - important! Save and close - it should say something like "installing new crontab". Now the script should run once a day at 3 am.
13) You might want to put a .htaccess file with this line into your output directory:
That will show the stats overview as the default index when you open that directory. You might also want to password protect it via the Dreamhost control panel.
Um, that's it, I think! Of course you can make any other changes you deem useful to the config file, it's decently commented. Also, if your log files are very large (you get lots of hits), you'll probably have to run awstats more than once daily to put less strain on the server. There are some guidelines for that on the AwStats website. You'd have to change the logfile location in that case too, to use the current log (with my setup it picks the last rotated one).
Let me know if anything is unclear or doesn't work!