Fri 12 Jan 2007
AWStats is a Perl script and so you must have Perl installed on your server. These instructions assume that this is the case.
- Login to your server via a SSH session using PuTTY
- Download the source code from Sourceforge using the command wget http://prdownloads.sourceforge.net/awstats/awstats-6.6.tar.gz
- Extract the source code using the command gunzip -c awstats-6.6.tar.gz | tar x
- Move the source directory to /usr/local mv awstats-6.6 /usr/local/awstats
- Change to the tools directory (cd /usr/local/awstats/tools) and run the configuration script perl awstats_configure.pl to create a configuration file for your domain.
-
- Need to create a new config file ? y
- Define config file name to create yourdomain.com
- Define config file path /etc/awstats
- Edit /etc/awstats/awstats.yourdomain.com.conf and change the following parameters
-
- LogFile=”/var/log/httpd/access_log”
- DNSLookup=1
- AllowToUpdateStatsFromBrowser=1
- AllowFullYearView=3
- Add the following entry to your periodic task scheduler (cron). On Westhost the command is editcron -e instead of crontab -e. The time should be the same as for logrotate
-
36 3 * * * /bin/perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=yourdomain.com 2>&1 >/dev/null
- Create a symbolic link so that you can access the documentation. ln -s /usr/local/awstats/docs /var/www/html/awdocs You will then be able to access the documentation from http://www.yourdomain.com/awdocs/
- Create a symbolic link so that you can access the tools. ln -s /usr/local/awstats/tools /var/www/html/awtools You will then be able to access the documentation from http://www.yourdomain.com/awtools/
- Check your Apache configuration by typing apachectl configtest
- Restart Apache by typing apachectl graceful or restart

