打开Tomcat/conf文件夹下的的tomcat-users.xml,加上如下两句话,配置用户名和密码:
<role rolename="manager-gui" />
<user username="tomcat" password="tomcat" roles="manager-gui" />
打开Apache/conf文件夹下的的httpd.conf,加上如下语句:
LoadModule status_module modules/mod_status.so
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from all
</Location>
修改Nginx配置文件,添加监控状态配置,在nginx.conf的server块中添加如下代码
location /nginx_status {
# Turn on nginx stats
stub_status on;
# I do not need logs for stats
access_log off;
# Security: Only allow access from 192.168.1.100 IP #
#allow 192.168.1.100;
# Send rest of the world to /dev/null #
#deny all;
重新编译安装:
./configure --prefix=/usr/local/nginx
--with-http_stub_status_module