When setting up Munin to monitor Apache metrics (accesses, processes, volume), you might encounter the frustrating "apache server-status not found" error despite having mod_status enabled. This typically manifests when running:
munin-node-configure --suggest 2>/dev/null | grep "apache\\|Plugin\\|------"
The key indicators are:
- All Apache plugins showing "no" with the server-status error
- Manual plugin execution returning "U" (undefined) values
- mod_status being reported as enabled via a2enmod
First, verify these critical components are properly configured:
/etc/apache2/mods-enabled/status.conf
should contain:
<Location /server-status>
SetHandler server-status
Require local
</Location>
ExtendedStatus On
Then check your virtual host configuration hasn't overridden these settings. The access logs (/var/log/apache2/access.log
) should show attempts to reach the endpoint:
127.0.0.1 - - [10/Nov/2011:07:24:15 +0000] "GET /server-status?auto HTTP/1.1" 404 7774 "-" "libwww-perl/5.834"
For Drupal/WordPress sites using mod_rewrite, add this exclusion to your .htaccess
:
RewriteCond %{REQUEST_URI} !=/server-status
Full rewrite rule context:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !=/server-status
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
- Test server-status manually:
curl -v http://localhost/server-status?auto
- Check module loading order:
apache2ctl -M | grep -E 'status|rewrite'
- Verify IP restrictions:
Ensure your Munin server's IP is allowed if monitoring remotely
Edit /etc/munin/plugin-conf.d/munin-node
:
[apache*]
env.url http://localhost/server-status?auto
env.ports 80
For multiple instances:
[apache_*]
env.url http://%h/server-status?auto
env.ports 80:8080:8443
When setting up Apache monitoring with Munin, you might encounter this frustrating scenario:
$ munin-run apache_accesses --debug
accesses80.value U
$ munin-run apache_processes --debug
busy80.value U
idle80.value U
free80.value U
First, confirm mod_status is actually enabled:
$ a2enmod status
Module status already enabled
Then check if the status module configuration exists:
$ ls -l /etc/apache2/mods-enabled/status.conf
-rw-r--r-- 1 root root 332 Feb 15 2022 /etc/apache2/mods-enabled/status.conf
The default status.conf typically contains:
<Location /server-status>
SetHandler server-status
Require local
</Location>
But you should also enable ExtendedStatus for Munin:
ExtendedStatus On
Check Apache access logs to verify the requests:
$ tail -f /var/log/apache2/access.log
127.0.0.1 - - [10/Nov/2011:07:24:15 +0000] "GET /server-status?auto HTTP/1.1" 404 7774 "-" "libwww-perl/5.834"
Case 1: For Drupal/WordPress sites with mod_rewrite, add this to .htaccess:
RewriteCond %{REQUEST_URI} !=/server-status
Case 2: If using virtual hosts, ensure the Location directive is in the correct vhost file.
Manually test the server-status endpoint:
$ curl http://localhost/server-status?auto
You should see output like:
Total Accesses: 1234
Total kBytes: 5678
CPULoad: 1.23456
Uptime: 123456
ReqPerSec: 0.123456
BytesPerSec: 1234.56
...
Ensure your Munin plugin config (/etc/munin/plugin-conf.d/munin-node) contains:
[apache_*]
env.url http://localhost/server-status?auto
env.ports 80
After making changes, restart both services:
$ sudo service apache2 restart
$ sudo service munin-node restart