Tomcat管理员从不询问我ID/PASSWORD [英] Tomcat manager never asking me ID/PASSWORD
问题描述
我在Amazon Linux EC2实例上设置了Apache Tomcat/9.0.0.M4. 我已经完成了像这样编辑conf/tomcat-users.xml的工作.
I set up Apache Tomcat/9.0.0.M4 on Amazon Linux EC2 Instance. I completed to edit conf/tomcat-users.xml like this.
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-status"/>
然后,我用./shutdown.sh和./startup.sh重新启动了Tomcat. 我尝试登录,但是Tomcat网页从不询问管理员的ID/密码. 它只会向我显示此403错误页面.
and then, I restarted Tomcat with ./shutdown.sh and ./startup.sh I tried to log-in, but Tomcat web page never ask ID/Password of manager. It only show me this 403 error page like this.
如何查找登录消息框?
推荐答案
我最近也遇到了类似的问题.您应该创建manager.xml文件,以便远程访问您的经理页面.
I have faced a similar problem recently. You should create the manager.xml file in order to get remote access to your manager page.
根据文档:
默认的Tomcat安装包括Manager.要将Manager Web应用程序上下文的实例添加到新主机,请在$ CATALINA_BASE/conf/[enginename]/[hostname]文件夹中安装manager.xml上下文配置文件"
"A default Tomcat installation includes the Manager. To add an instance of the Manager web application Context to a new host install the manager.xml context configuration file in the $CATALINA_BASE/conf/[enginename]/[hostname] folder"
例如,在我的情况下,我具有以下路径:/usr/local/tomcat/conf/Catalina/localhost
In my case for example, I have this path: /usr/local/tomcat/conf/Catalina/localhost
我的文件具有以下内容:
And my file has something like this:
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
请记住,"^.* $"是一个正则表达式.
Remember that "^.*$" is a regular expression.
这篇关于Tomcat管理员从不询问我ID/PASSWORD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!