Awstats Installation

Today i have installed awstats for the site The site is hosted on FreeBSD server with no control panel. Installing software from FreeBSD ports is really easy.

            # cd /usr/ports/www/awstats
            # make
            # make install
            # make clean

Now awstats is installed on you server and we need to configure it. To configure edit httpd.conf (vi /usr/local/etc/apacheX/httpd.conf) file and add following lines.

            Alias /awstatsclasses "/usr/local/www/awstats/classes/"
            Alias /awstatscss "/usr/local/www/awstats/css/"
            Alias /awstatsicons "/usr/local/www/awstats/icons/"
            ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"

            <Directory "/usr/local/www/awstats/">
                Options None
                AllowOverride None
                Order allow,deny
                Allow from all

Restart web server with "apachectl restart" command. After restarting you will be able to access awstats on page http://yourdomain/awstats/, In my case the url look like

On going to awstats url, you will see some errors, this is because, you have not yet configured awstats completely. To configure awstats, do the following.

            # cd /usr/local/www/awstats/cgi-bin
            # cp awstats.model.conf
            # vi

NOTE: is the domain name for which i am configuring awstats. In your cause, you should replace with your own domain name.

We will now edit the file and change following parameters

            HostAliases=" localhost"

Lets make data directory

            # mkdir /usr/local/www/awstats/data
            # chmod 777 /usr/local/www/awstats/data

Now going to awstats url, you will see awstats page. But no stats, this is because we have not yet processed the log file. Lets go ahead and process the log files.

            # cd /usr/local/www/awstats/cgi-bin/
            # ./ -update

You need to run this everyday, so that awstats will show updated stats. Following is the cronjob i run. Use "crontab -e" to edit cron jobs.

10 0 * * * root /usr/local/www/awstats/cgi-bin/ -update >> /var/log/awstats

Get in touch with us

Questions? Concerns? Comments? We want to hear from you!
Drop us a line with whatever is on your mind and we will get back to you ASAP!!