AWStats Installation

The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.Support for these instructions is not available from DreamHost tech support.Server changes performed by DreamHost may break your modifications. You, as the user, are responsible for troubleshooting and resolving issues with your customizations.

AWStats is an alternative Web log analyzer that offers a wider range of statistics than Analog.

This guide assumes that your username is yourusername and your domain is example.com. You should change it to fit your username and domain.

You can use the PuTTY client on Windows, or SSH on UNIX and UNIX-like systems such as Linux or Mac OS X.Your account must be configured for shell access in the Control Panel.More information may be available on the article's talk page.

The above has been entered as two lines. If entered in one line, remove the backslash (\)

Check the output folder (/statistics/) in your browser. Look at the awstats.domainname.com.html file. Does everything look good? Great! Then let's setup a cron job to do this automatically.

NOTE: If you have a Ruby on Rails site, you will not be able to see this output with your browser. One way to get around this problem is to change the last part of the command to this:

-dir=/home/yourusername/domainname.com/public/statistics/

CRON Script

The Crontab page will be of some use if you are having trouble. For example, you have to fill out the MAILTO="" field in order for Dreamhost to use your crontab.

Edit the crontab

crontab -e

Insert the following

If the line is too large in the default editor than it will fall to the next line, you will have to manually go back and press delete to make sure it is all on the same line. It all must be on the same line.

As always, change the yourusername and domainname.com to your information.

The following has been moved to three lines to save from side scrolling, it still needs to be one line.

AWStats For Another Domain

Repeat the 'Setting up the Domain Name' step and copy the folders to the domain name.

Repeat 'Crontab' step by adding a new line and changing the details for the other domain name.

Change the new crontab time by changing the first number to increments of 15 or whatever number besides that of the last one and the second number to the same unless you would have two running at the same time.

Dynamic pages

There's an dynamic setup available here: AWStats_Installation_(alternative). It allows the data to be dynamically updated through the browser (real-time data update), and access to previous months (or yearly) data.

Quick

Remove 'Useless' Files

Go to the awstats folder (if you renamed the directory then go to that)

Installation

The installation of JAWStats is very simple. If you've followed the instructions for the AWStats installation above and have it working then we will only make a few simple changes and you'll be up and running!

Moving the files into place

In the section Setting up the Domain Name above we copied some AWStats files into the folder we'd using to view/access AWStats, as shown below:

cp -r ~/awstats/wwwroot/{icon,css,js} ~/domainname.com/statistics

For JAWStats we won't actually need those. Instead we'll be using the JAWStats files you just downloaded and extracted.

So lets clear out the AWStats files in our domain folder and copy our new JAWStats files into place:

domainname.com is the website domain name you used in naming your awstats.domainname.com.conf file.

statspath is the DirData setting you added to the awstats.domainname.com.conf file

updatepath is the location of the cgi-bin which you moved in the Changing the Directory Structure section.

siteurl is simply the domain name which JAWStats will display in heading making it easy to know what it is you're looking at.

password is pretty self explanatory but it's a good idea to change this and if you leave $bConfigUpdateSites option in the section above in it's default state (true) you'll be asked to input the password you configure here to run an update on the sites stats (an handy feature for the stats obsessed!).

Wrap-up and CRON Script changes

That covers basic configuration. You'll notice the JAWStats file has (by default) 2 example site sections. You can add additional sites to the configuration as above, as long as each site has a matching (and working!) AWStats configuration you can quickly and easily switch between viewing statistics for each domain from the JAWStats interface.

Testing and CRON setup with JAWStats is pretty much the same. But you'll want to change the line you'll be using for you CRON script.

Notice we've skipped the awstats_buildstaticpages.pl because we'll be using JAWStats to provide much nicer looking pages. I also use the awstats_updateall.pl which is under the AWStats tools directory. This script is will process all the files in your -configdir automatically (excluding the awstats.model.conf file). So if you have more then a single domain setup you can use a single CRON script and process them all rather then installing one AWStats CRON job for every domain.

If everything goes right you should now have an attractive and easy to use interface setup to use your AWStats datafiles. Enjoy!

Notes

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 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.