
To only allow access from your local LAN in this case 192.168.0.0/16, we can use the following addition at the end of /etc/apache2/sites-available/nf Htpasswd -c /etc/apache2/auth_users richardĪuthName "Enter Your User Name and Password" To append other users do not use the -c flag. To create a new user file and add the username “richard” to the file /etc/apache2/auth_users. To only allow access for users configured in the auth_users file we can use the following addition at the end of /etc/apache2/sites-available/nf. To allow awstats to protect itself edit the config file and add a list of IP addresses or ranges see the comment above the option of the syntax. We can let Awstats protect itself with the rather well named parameter AllowAccessFromWebToFollowingIPAddresses or as it is also simple to restrict access by forcing the user to enter a password or simple only allow IP addresses on your local LAN not from external IPs. Probably not a good idea or something you want. Stop Unauthorised UsersĪs the above setup stands anyone, that is the world and his dog can now see your web serrver stats. You should now be able to browse to and get the main awstats page. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Note: All the posts I’ve seen fail to use the ‘+’ in front of the ExecCGI option which will break your Apache config and it will not restart.Īlias /awstatsclasses "/usr/share/awstats/lib/"Īlias /awstats-icon/ "/usr/share/awstats/icon/"Īlias /awstatscss "/usr/share/doc/awstats/examples/css" Sudo nano /etc/apache2/sites-available/nfĪdd the following line to the end of the file before the closing tag.
#AWSTATS UBUNTU UPDATE#
update the default virtual host with the following, to tell Apache where to find the awstats start script. To access awstats from a browser, this assumes you are using Apache2. */10 * * * * root /usr/lib/cgi-bin/ -update > /dev/null

The cron job below will run every 10 minutes, adjust the time to your needs. Change the user who will be running the script from sudo nano /etc/cron.d/awstats To maintain the stats on a regular basis you will need a cron job to run the awstats update script. Phase 2 : Now process new records (Flush history on disk after 20000 hosts). Searching new records from beginning of log file.

Phase 1 : First bypass old records, searching new record. The output should look similar to the followingĬreate/Update database for config "/etc/awstats/" by AWStats version 7.2 (build 1.992)įrom data in log file "/var/log/apache2/access.log". Once you have made the changes above and saved the file run your first update, to gather stats. These are the options I changed, read through the file looking at the comments.
#AWSTATS UBUNTU INSTALL#
Sudo apt-get install awstats libgeo-ipfree-perl libnet-ip-perl
#AWSTATS UBUNTU SOFTWARE#
Installing the software and some packages necessary for the geo and net IP location stats.

If you want to see loads of stats for your web site try installing awstats.
