Apache is a widely-used web server for a variety of operating systems. For more information visit http://httpd.apache.org/.
Even if the Apache plugin is not configured, Monitoring will discover Apache services running in your Cloud Platform project by:
- searching instance names for apache
- checking for ports opened to 80 or 443 via firewall rules
The services discovered are displayed on the Apache Services page in the Resources menu. After you install the monitoring agent and configure the Apache plugin on your instances, Monitoring populates the Apache Services page with inventory and metrics.
Configuring Monitoring to monitor Apache
After you install the monitoring agent, use the following instructions to configure the Apache plugin on your instances.
The Apache plugin requires the
mod_status plugin to be enabled in Apache.
Many Apache installations come with the
mod_status plugin enabled by default.
This can be checked by running
which should give you some text starting with:
localhost ServerVersion: Apache/2.x.xx...
If instead you get a
404 Not Found page,
mod_status is not enabled.
For Apache installations where the
mod_status plugin is not enabled, you would need to enable it.
This can be done by downloading status.conf from the
GitHub configuration repository
and placing it in the Apache configuration directory on your VM instance (normally
(cd /etc/httpd/conf.d/ && curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/httpd/conf.d/status.conf)
Alternatively, you can append the contents of
to your main Apache configuration file, normally located at either
/etc/apache2/apache2.conf on your VM instance.
After changing apache configuration, restart Apache by running:
- Debian and Ubuntu:
sudo service apache2 restart
- Other Linux distributions:
sudo service httpd restart
Enabling the Apache monitoring plugin
(cd /opt/stackdriver/collectd/etc/collectd.d/ && curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/apache.conf)
If you had to explicitly enable
mod_status in Apache as suggested in the previous section,
edit the downloaded configuration file and replace
After adding the configuration file, restart the monitoring agent by running the following command:
sudo service stackdriver-agent restart
Information on other plugin configuration options can be found at collectd.org.
What is monitored
The Apache plugin monitors the following metrics:
- Active Connections (count): The number of active connections currently attached to Apache.
- Idle Workers (count): The number of idle workers currently attached to Apache.
- Requests (count/s): The number of requests per second serviced by Apache.
For details, see Agent metrics list: Apache.