Do that with the following command: sudo -u nginx /usr/share/awstats/wwwroot/cgi-bin/ -config= This first time, however, it's best to run it manually. In a later step, we'll set up AWStats to run when the server logs are rotated. To do this, we'll need to make nginx the owner of the directory where AWStats stores its database ( /var/lib/awstats): sudo chown -R nginx /var/lib/awstats We'll run AWStats under the nginx user that has already been set up during the Nginx installation. It is strongly recommended not to run AWStats as the root user. If you want to know exactly what an option does, or if you want to see all the options that AWStats has to offer, just read the comments in that file. SiteDomain will simply be the domain name of the site and HostAliases will be a list of any other domain names that might be used (for example, if your site is you might put here if it is the same site).Īll of the configuration options are documented in the config file. The two relevant configuration options here are SiteDomain and HostAliases. This way it can report things such as which users are coming from external sites. Change this line to DirIcons="./icon".įinally, AWStats needs to know what website it's analyzing. If you can't find it, type /DirIcons, then press ENTER to jump to it. Next, scroll down all the way to the line that says DirIcons="/awstatsicons". Change it to LogFile="/var/log/nginx/access.log". Because we're using Nginx instead of Apache, we need to change this. Scroll down to the line that says LogFile="/var/log/httpd/access_log". Now edit that file: sudoedit /etc/awstats/nf Copy the model config file to create a new configuration for your site: sudo cp /etc/awstats/ /etc/awstats/nf We'll need to configure AWStats before we can use it. We'll need to enable php-fpm through systemctl: sudo systemctl enable -now php-fpm The other tool, php-fpm, allows us to run PHP scripts from Nginx. It was designed for use with Apache, but most of the tools also work with Nginx. Httpd-tools is a package containing some tools we'll need, such as htpasswd. Fortunately, this is very easy, as all the software you'll need is in Fedora's repositories: sudo dnf install awstats httpd-tools php-fpm If you haven't installed Nginx yet, do so now: sudo dnf install nginxįirst, you'll need to install a few things. This tutorial will walk you through installing, configuring, and securing AWStats for an Nginx web server on Fedora 28. Its HTML interface can be accessed through the browser, giving you easy insights about who is viewing your website. AWStats is a useful tool for analyzing web traffic.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |