Apache plugin

Apache is a widely-used web server for a variety of operating systems. For more information, visit http://httpd.apache.org/.

Discovery

Even if the Apache plugin is not configured, Stackdriver Monitoring discovers 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 discovered services 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.

Prerequisite

The Apache plugin requires the mod_status plugin to be enabled in Apache. Many Apache installations enable this plugin by default. To see if the plugin is enabled on your VM instance, run the following request:

curl http://local-stackdriver-agent.stackdriver.com:80/server-status?auto

If the plugin is enabled, then the output includes lines similar to the following:

 Total Accesses: 2
 Total kBytes: 1
 BusyWorkers: 1
 IdleWorkers: 4

If instead you get a 404 Not Found page, then mod_status is not enabled.

Here are several options to enable the mod_status plugin:

  • Download status.conf and place it in the Apache configuration directory on your VM instance, typically in /etc/httpd/conf.d/:

    (cd /etc/httpd/conf.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/httpd/conf.d/status.conf)
    
  • Append the contents of status.conf to your main Apache configuration file, normally located at either /etc/httpd/conf/httpd.conf or /etc/apache2/apache2.conf on your VM instance.

After changing the configuration, restart Apache.

  • For Debian and Ubuntu:

    sudo service apache2 restart
    
  • Other Linux distributions:

    sudo service httpd restart
    

Enabling the Apache monitoring plugin

To enable the Apache monitoring plugin, complete the following steps:

  1. On your VM instance, download apache.conf and place it in the directory /opt/stackdriver/collectd/etc/collectd.d/:

    (cd /opt/stackdriver/collectd/etc/collectd.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/apache.conf)
    

    If you're not using the default or Stackdriver-provided Apache mod_status configuration, as root, edit apache.conf by following the instructions at the top of the file.

  2. Restart the monitoring agent:

    sudo service stackdriver-agent restart
    

For more information on the collectd apache plugin, see Plugin:Apache.

What is monitored

The full list of metrics the Apache plugin monitors is at Agent metrics: apache.

Hai trovato utile questa pagina? Facci sapere cosa ne pensi:

Invia feedback per...

Stackdriver Monitoring
Hai bisogno di assistenza? Visita la nostra pagina di assistenza.