Installing Webalizer with nginx Websever in Ubuntu

 Thanks to: https://ixnfo.com/

Webalizer – a program for reporting and statistics on log files.

The Webalizer installation command in Ubuntu:

1
sudo apt-get install webalizer

After installation, move the created directory /var/www/webalizer to the root of the Apache2 /var/www/html/ web server:

1
sudo mv /var/www/webalizer /var/www/html/

Open the configuration file Webalizer in any text editor, for example nano:

1
sudo nano /etc/webalizer/webalizer.conf

Let’s specify what log files should be analyzed, by default there is already indicated:

1
2
LogFile /var/log/apache2/access.log.1
LogType clf

You can specify ftp logs as follows:

1
2
LogFile /var/log/proftpd/xferlog
LogType ftp

You can also specify the type of logs squid or w3c.

And also change the directory where reports will be created:

1
OutputDir /var/www/html/webalizer

If necessary, we specify the encoding of HTML pages:

1
HTMLHead <META http-equiv="Content-Type" CONTENT="text/html" charset="UTF-8">

You can specify a font:

1
TrueTypeFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf

Launch Webalizer to generate statistics:

1
sudo webalizer

Now you can open the report in the browser http://192.168.1.2/webalizer/, where 192.168.1.2 is the IP of your server.

You can re-configure the Webalizer with the command:


1
dpkg-reconfigure webalizer


=========CONFIGURATION WEBALIZER IN NGINX WEBSERVER================
server    {
listen 127.0.0.1:8081;
server_name tuempresa.com;
root /var/www/html/webalizer;
index index.html index.htm index.nginx.debian.html;
error_log /var/log/nginx/webalizer-error.log;
access_log /var/log/nginx/webalizer-access-log;
location /          {
try_files $uri $uri/ =404;
      }
}

Comentarios

Entradas populares de este blog

Guía de herramientas básicas para estudiantes: 31 apps y webs imprescindibles para ayudarte con los estudios

Comando FOR para archivos BAT

How to Fix Failed to Connect a Hyper-V Standalone to Veeam Backup