Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Configure Apache Monitoring With Zabbix


Enable Status Module

Ensure that the status module is enabled

sudo a2enmod status

Site Configuration

We need to configure Apache to respond with status on the /server-status path, but only when connected to from localhost, rather than our normal website(s).

Thus use the following command to create a site configuration:

sudo editor /etc/apache2/sites-available/localhost.conf

Fill it with the following content:


    ServerName localhost
    ServerAdmin webmaster@localhost

    <Location /server-status>
        SetHandler server-status
        Require local
        Require ip

    ErrorLog ${APACHE_LOG_DIR}/localhost-status-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/localhost-status-access.log combined


After having done that, enable the site by running:

sudo a2ensite localhost

Config Test

Perform a configuration test to check Apache is okay with everything:

 sudo apache2ctl configtest

Restart Apache Service

Run the following command to restart Apache and start using the new config. It shouldn't interfere with your other configs, because it is specific to and requires the connection to be coming from

sudo systemctl reload apache2


Run the following command from the shell on the server to check you can get the status:


This should result in the creation of a file called server-status with content similar to below (just the first few lines):

<title>Apache Status</title>
<h1>Apache Server Status for (via</h1>

<dl><dt>Server Version: Apache/2.4.57 (Debian)</dt>

Configure Zabbix Server

We have finished setting up the host, now we need to configure our Zabbix server to try and pull this information using the agent. Simply click on the Host and go to the templates and add Apache by Zabbix agent.

That's it!


Last updated: 13th July 2023
First published: 13th July 2023