# Use The Webalizer to Analyze Apache Web Logs

[The Webalizer](http://www.webalizer.org/ "The Webalizer") is a free, open source application for analyzing Apache log files. It provides highly detailed and configurable web usage reports in an HTML format which you can view in a browser. Learn how to install The Webalizer on a Cloud Server, and configure the server to automatically run this application at regular intervals in order to update the statistics.

## Requirements

- A Cloud Server with Linux (CentOS 7)
- Apache installed and running

---

### Note

Apache is installed and running on a standard Linux installation by default. If your server was created with a minimum installation, you will need to install and configure Apache before you proceed.

---

## Use Webalizer under CentOS 7

Update the server's installed packages:

```none
sudo yum update
```

Install The Webalizer:

```none
sudo yum install webalizer
```

Run The Webalizer to analyze the existing Apache log files:

```none
sudo webalizer
```

By default, the report for the server's primary domain will be saved to /var/www/usage. In order to be able to view this in a browser, open the site's main Apache configuration file for editing:

```none
sudo nano /etc/apache2/sites-available/000-default.conf
```

Add the following alias:

```none
Alias "/usage" "/var/www/usage"
```

Save and exit the file. Then restart Apache for the changes to take effect:

```none
sudo systemctl restart httpd
```

You will now be able to view The Webalizer reports at http://example.com/usage.

## Add The Webalizer to Cron

Cron is a Linux utility which runs commands at the specified intervals. Open the crontab file for editing:

```none
sudo crontab -e
```

Add the following line to this file to run the webalizer command once an hour:

```none
0 * * * *      /usr/bin/webalizer
```

Save and exit the file.


This is a markdown version of: [https://www.ionos.com/digitalguide/server/configuration/use-the-webalizer-to-analyze-apache-web-logs/](https://www.ionos.com/digitalguide/server/configuration/use-the-webalizer-to-analyze-apache-web-logs/) for AI/LLM consumption.