Agent Apache status configuration

The agent can parse the Apache mod_status output to show the current requests per second, idle works and busy workers. This metric is only available for paid accounts. It also requires some additional configuration of your Apache server.

If you do not wish to monitor Apache then leave the default value in the config.cfg file and the agent will ignore it.

Note Apache 1.x is not supported, only Apache 2.

Configuring Apache

mod_status module

You first need to ensure the mod_status module is installed. This is usually compiled in by default but you may need to uncomment a line in your httpd.conf file:

#LoadModule status_module modules/mod_status.so

Removing the # will uncomment the line and enable mod_status.

mod_status configuration

Adding the following line to your httpd.conf file will enable the mod_status output.

ExtendedStatus On

If you restart Apache after adding this line and get an error, check that mod_status has been installed correctly. Look in your Apache error_log for details.

You then need to add in the following lines to set up the location from which the status output can be parsed by the agent:

<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Location>

You should replace the IP address 127.0.0.1 with your server's public IP address. This will allow the status output to be accessed from a URL http://yourserver/server-status. However, it has been restricted to the server IP address which means it can only be accessed from the server itself - this is for security so that only the agent can access the output. If you wish to access it from your browser, you need to add your IP address in (separated by a space). For example

Allow from 127.0.0.1 127.0.0.2 127.0.0.3

You will now need to restart your Apache web server to allow the changes to take effect.

Agent configuration

You need to enter the URL into the agent config.cfg file for the apache_status_url option. If your server's IP was 127.0.0.1 then this URL would be http://127.0.0.1/server-status?auto. Note the ?auto at the end - this is required.

apache_status_url: http://127.0.0.1/server-status?auto

Restart agent

Restart the agent to start the monitoring, which will take up to 5 minutes to show in the Server Density UI.

If you installed the agent using our OS packages (yum/apt)

sudo /etc/init.d/sd-agent restart

If you installed the agent manually

python agent.py restart