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. Set Up AWStats for Nginx on Ubuntu 18.04ĪWStats itself is available in the Ubuntu repositories.Install, configure and protect Awstats for multiple nginx vhost on Debian/Ubuntu. ![]() The guide relies heavily on information from these very useful posts:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |