This is a system to automate the installation of ISPConfig 3 control Panel ( ). Service changed to systemctl for all service functions (start,stop,restart etc)įew other minor changes to accommodate Debian 10 To get more frequent updates to the statistics, I decided to let it run it four times a day, at 00:30, 6:30, 12:30 and 18:30.Added support for Debian 10 Buster and php7.3 With a typical webserver configuration that rotates the access log every midnight, the minimum interval to run AWStats would be once a day. sudo /usr/share/doc/awstats/examples/awstats_ now -awstatsprog=/usr/lib/cgi-bin/.There is a perl script to run AWStats on all the configured web sites, try it: If it complains about missing access log files try: It should succeed, and generate a "database" file in: /var/lib/awstats/ sudo /usr/lib/cgi-bin/ -config= -update.Now we can try to run AWStats with the provided configuration: I decided against this approach to keep things simple and separate, and I would like to update AWStats more often than the log rotation anyways. This approach is a brute force method to make sure AWStats gets to see all log entries even after log rotation.Īlternatively the log rotation in Nginx could be configured to call AWStats right before the rotation. Note that LogFile is specified using a perl merging script that concatenates the. HostAliases="The config file starts by including the generic settings file so the website specific settings can be overridden afterwards. LogFile="/usr/share/awstats/tools/ /var/log/nginx/ /var/log/nginx/.1 |" Otherwise there will be a config file include loop.įor each website, a separate config file must be created with a filename exactly matching the website hostname, according to this format: /etc/awstats/awstats.$.conf.įor our "" domain example, the configuration would look like this:Ĭontents of /etc/awstats/ # Include "/etc/awstats/" Find this line, near the end of the file, and comment it. LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat" Find this line and uncomment it to enable Geo IP. LogFormat=1 This will work with the Nginx default logging format I only changed the following values and set them like this: We are going to do things slightly different. - An empty file supposed to be used for local customizations.When AWStats is first installed there are two files in /etc/awstats: In this guide we will put the general settings and the website specific settings in separate files. Most of them are general and just a few of them must be set specifically for each website. Thus, in the Nginx server block for the websites to be monitored, the access_log setting should simply look like this:Īccess_log /var/log/nginx/ ĪWStats has a huge number of configuration values. Please see other guide for details about modifying the logging format. I don't have such a setup, so I decided to stick with the default Nginx log format. Some guides recommend changing the access logging format for various purposes such as retrieving the correct IP for websites behind load balancers. Let the installation proceed with default responses to the questions.Įxit cpan and verify that Geo IP got installed as expected by checking the existence of: /usr/share/GeoIP/GeoIP.dat Log format When firing up cpan, note that AWStats is going to run as root so the modules must be installed in the scope of the root user, hence sudo: Here is how to install it using apt and cpan. For this to work, the perl module Geo::IP is required. We are going to turn on just one extra feature, the Geo IP locator.
0 Comments
Leave a Reply. |