tomcat8.5打开manager页面报错的问题

之前用的8.0版本的tomcat,最近需要将版本升级,当前8的最新的版本是8.5.42,升级之后发现manager页面打不开了,就是下面这个按钮的页面

 

点击之后报403没权的错误

 

还是按照8.0版本的配置方法,在conf/tomcat-users.xml中配置权限和用户名密码,类似页面提示的这样。

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

但是重启服务后还是提示同样的错误,再次确认配置的没问题后,这次才好好的把页面的错误提示读了一遍,发现有这么个提示

By default the 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 Manager's context.xml file.

默认只允许本机访问了,如果要允许其他主机访问要去修改manaager的context.xml文件,看来这是8.5的新特性了,找到webapps\manager\META-INF\context.xml 文件,看到文件里果然有限制本机访问的配置,将这段注释掉

重启服务之后,再次访问就可以登录了,用你配置的用户名密码就可以进入管理页面了

 

posted @ 2019-06-20 10:04  张艳华  阅读(1249)  评论(0编辑  收藏  举报