Tomcat8 访问管理页面403 Access Denied

 

解决方法:
  1、访问的ip地受到了限制
        vim /apache-tomcat-8.5.34/webapps/manager/META-INF/context.xml
            <!--<Valve className="org.apache.catalina.valves.RemoteAddrValve"
                allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />-->
           
  2、修改tomcat-users.xml中的角色和用户配置
      原因是tomcat8中定义了以下4种角色,所以配置文件中的角色名称是不能任意填写的。
            manager-gui        - allows access to the HTML GUI and the status pages
            manager-script    - allows access to the text interface and the status pages
            manager-jmx        - allows access to the JMX proxy and the status pages
            manager-status    - allows access to the status pages only     
        
        vim /apache-tomcat-8.5.34/conf/tomcat-users.xml
            <role rolename="admin-gui"/>
            <role rolename="admin-script"/>
            <role rolename="manager-gui"/>
            <role rolename="manager-script"/>
            <role rolename="manager-jmx"/>
            <role rolename="manager-status"/>
            <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>
            </tomcat-users>
    
    修改完后重启tomcat,就解决了
        sh /apache-tomcat-8.5.34/bin/shutdown.sh
        sh /apache-tomcat-8.5.34/bin/startup.sh

 

posted @ 2023-03-16 10:36  等风来~~  阅读(92)  评论(0编辑  收藏  举报