Tomcat 8.5之后无法进入管理页面

在使用Tomcat 8.5学习时,按照以往配置想进入管理页面,却出现如下问题:

You are not authorized to view this page.
By default the Host Manager is only accessible from a browser running on the same machine as Tomcat. If you wish to modify this restriction, you'll need to edit the Host Manager's context.xml file.
/application/tomcat/webapps/host-manager/META-INF/context.xml

经过百度,找到如下解决方案,亲测可行:
编辑/application/tomcat/webapps/manager/META-INF/context.xml和/application/tomcat/webapps/host-manager/META-INF/context.xml(/application/tomcat是tomcat程序的目录)这两个文件,将其中的这一行注释掉

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

同时编辑 /application/tomcat/conf/tomcat-users.xml文件,设置用户名、密码

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui,admin-gui"/>

重启Tomcat即可。

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容