While this document outlines the steps required
to install awstats for a new server and for virtual hosts, this process
can take several dozen minutes. By the time one locates the documentation,
reviews the steps required, creates the directories, edits the config
files, etc..., a lot of time can be wasted. To accommodate the rapid
addition of the services of awstat to a new virtual host, this
tool was created.
The tool was developed on a GNU/linux, RedHat 7.1 system, and is now
running on a Slackware box, but has not
been tested on other systems. Most of the configuration settings,
especially file names and paths, have been localized to the top of the
file for easy modification. The script is heavily documented for easy
understanding, and the procedure that it automates is completely outlined
here, but this document will explain its usage
For those of you who use ISPMan,
have a look at
Wim Kerkhoff's web site. He has some tools to make your life easier.
The program may be installed anywhere in root's path; location doesn't
matter. It expects a single argument, the virtual host name. For example:
The program will output nothing but a message upon completion naming the
log file containing a complete description of changes made, and the contents
of changed files. This file should be carefully inspected for errors. Note
that the program will refuse to run if this file exists. This feature prevents
overwriting the output of previous runs. Simply delete the file, or rename
before calling the program. By default, this file is
All diagnostic output from subprocesses is captured in this file, also.
Errors such as missing directories can be diagnosed, and progress assessed
before attempting to rerun the program. Note that any edits made to
configuration files will not be undone in the event of errors. Be very
careful about multiple runs for the same virtual host.
The URL for the awstats output will be:
The program can only be run by root. Sufficient privileges are required
to write to system directories not normally writable by lesser mortals.
Original installation files are expected to reside in
/opt/awstats. This is the default installation location from the
Apache configuration and log files are expected to have the virtual host
name as a prefix. For example,
/var/log/httpd/capella.ithaca.ny.us_access_log. The use of included
files for virtual hosts eases administration burdens. See the apache
documentation for more details.
awstats configuration files live in /etc/awstats. Each file
has the virtual host name prepended just as with the apache config files:
A general-purpose config file sans a few specific items lives in the
awstats config directory and is included by the program:
Each virtual host has its own data directory beneath the default,
/etc/cron.hourly/awstats is updated for each virtual host. It runs
awstats hourly. This seems to be about right for the various sizes
of hosts that we have observed. This file must already exist.
The program installs awstats files in a top-level directory beneath
the site's DocumentRoot. For example, if the root is /var/www/some.domain.com,
the destination will be /var/www/some.domain.com/awstats.
The program expects the cgi-bin directory to live right beneath the site's
DocumentRoot. Using the previous example, that would be
Apache is restarted after the installation so that it will reread its
configuration and pick up the new alias to the awstats directory.
An initial run is not started since cron will cause this to happen within
the next hour.
These files may be obtained by downloading
- awstats4vhost - Bourne shell script
- /etc/awstats/awstats.headless.conf - awstats configuration template
- /etc/cron.hourly/awstats - system cron job
- index.html - this file
- vhosts.html - step by step procedure for setting up a new server and configuring addtional virtual hosts with awstats