1, httpd
编辑/etc/httpd/conf/httpd.conf ,解开关于server-status的注释,并修改Allow 指令允许所有ip访问
重启httpd,使服务生效
2, tomcat
修改配置文件: conf/tomcat-users.xml, webapps/manager/META-INF/context.xml
wang@wang-T58-V:~/unpack$ cat apache-tomcat-8.0.45/conf/tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!-- <role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="123456" roles="tomcat"/>
<user username="both" password="123456" roles="tomcat,role1"/>
<user username="role1" password="123456" roles="role1"/> -->
<role rolename="manager-gui"/>
<user username="tomcat" password="123456" roles="manager-gui"/>
</tomcat-users>
wang@wang-T58-V:~/unpack$ cat apache-tomcat-8.0.45/webapps/manager/META-INF/context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true" >
<!--
Remove the comment markers from around the Valve below to limit access to
the manager application to clients connecting from localhost
-->
<!--
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
3, nginx
http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
[root@cdh-node1 vagrant]# cat /etc/nginx/conf.d/default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
include /etc/nginx/default.d/*.conf;
location /status {
stub_status;
}
}