常用web服务器:状态监控status页面

文章目录

  • 1, httpd
  • 2, tomcat
  • 3, nginx

1, httpd

编辑/etc/httpd/conf/httpd.conf ,解开关于server-status的注释,并修改Allow 指令允许所有ip访问
常用web服务器:状态监控status页面_第1张图片
重启httpd,使服务生效
常用web服务器:状态监控status页面_第2张图片

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>

常用web服务器:状态监控status页面_第3张图片
常用web服务器:状态监控status页面_第4张图片

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

常用web服务器:状态监控status页面_第5张图片

你可能感兴趣的:(linux系统,web服务器状态监控)