1、配置文件httpd.conf
路径在apache安装路径下的conf/,我的是/usr/local/apache2/conf
,加载mod_status.so和mod_info.so两个模块,info模块可加可不加,它是可以在线显示apache加载的东西的,访问http://你的ip/server-info
打开info界面,打开后修改位置如下:
并在文档末尾添加如下内容:
ExtendedStatus On
<location /server-status>
SetHandler server-status
Order Allow,Deny
Allow from all
</location>
或者使用新版本的方式:
<Location "/server-status">
SetHandler server-status
Require all granted
</Location>
使用server-info,则还有加上这个
<Location /server-info>
SetHandler server-info
Require all granted
</Location>
如果你去掉了Include conf/extra/httpd-info.conf
前面的注释,则需要在conf/extra里的httpd-info.conf添加下列代码。
<Location /server-status>
SetHandler server-status
Require all granted
</Location>
2、重启apache
http://你的IP/server-status
http://你的IP/server-status?refresh=1
http://你的IP/server-status?auto