zoukankan      html  css  js  c++  java
  • Tomcat 8 Host-Manager配置访问的方法,全网唯一正确配置

    环境:

    操作系统: 

           Linux version 2.6.32-696.10.1.el6.x86_64 (mockbuild@c1bl.rdu2.centos.org)

           (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) )

            #1 SMP Tue Aug 22 18:51:35 UTC 2017

    tomcat:     

        tomcat: apache-tomcat-8.5.30

    JAVA版本: 

         java version "1.8.0_66"
        Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
        Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

     

    新增admin Manager

    三个步骤,缺一不可!!!!!!!!!!

    1. 在server.xml里面的<tomcat-users> 标签内新增 ,除了密码 ,一个字都别改

    <role rolename="manager-gui"/>
      <role rolename="manager-script"/>
      <role rolename="manager-jmx"/>
      <role rolename="manager-status"/>
      <role rolename="admin-gui"/>
      <role rolename="admin-script"/>
      <user username="admin" password="123456" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>

    2.

    到tomcat目录下找到content.xml

    cd /opt/apache-tomcat-8.5.24/webapps/host-manager/META-INF/

    修改 content.xml

    修改
    
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.d+.d+.d+|::1|0:0:0:0:0:0:0:1" />
    
    为:
    
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="d+.d+.d+.d+|::1|0:0:0:0:0:0:0:1" />
    
    

    如果不执行这步. 则只能localhost访问manager!!!

    3.

    配置远程访问manager:
    
    tomcat目录/conf/Catalina/localhost/下  添加manager.xml
    
    <Context privileged="true" antiResourceLocking="false"   
    
    docBase="${catalina.home}/webapps/manager">  
    
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />  
    
    </Context>  

    如果不执行这步. 则只能localhost访问manager!!!

    转载于:https://my.oschina.net/u/2338224/blog/1793153

  • 相关阅读:
    Neko's loop HDU-6444(网络赛1007)
    Parameters
    SETLOCAL
    RD / RMDIR Command
    devenv 命令用法
    Cannot determine the location of the VS Common Tools folder.
    'DEVENV' is not recognized as an internal or external command,
    How to change Visual Studio default environment setting
    error signing assembly unknown error
    What is the Xcopy Command?:
  • 原文地址:https://www.cnblogs.com/twodog/p/12137145.html
Copyright © 2011-2022 走看看