常用web服務器:狀態監控status頁面

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;
    }
} 

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章