zabbix监控apache_status

1.在client的httpd.conf中添加如下

sudo vim /alidata/server/httpd/conf/httpd.conf
<Location /server-status>
    SetHandler server-status
    Allow from 127.0.0.1
    Order deny,allow
    Deny from all
</Location>
ExtendedStatus On

如果你有rewrite规则,则需要在.htaccess中加上一条,如下:

RewriteCond %{REQUEST_URI} !server-status需要写在index.php之前
sudo vim /alidata/www/jds.jince.com/.htaccess
1. ThinkPHP Rewrite规则
<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_URI} !server-status
   RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>