我使用的是 9.0.1 版的 tomcat。使用 Java 9 在 Linux 机器上运行。
在我的 tomcat-users.xml 中,我在下面添加了
<role rolename="manager-gui"/>
<role rolename="manager"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,manager,manager-script"/>
在我的 server.xml 中添加了谷歌搜索后的行
<Realm className="org.apache.catalina.realm.MemoryRealm" />
之后我通过 tomcat 服务器启动,同时访问 maneger gui 出现以下错误
403 Access Denied
You are not authorized to view this page.
If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.
请帮忙
tomcat-用户.xml
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="manager-gui"/>
<role rolename="manager"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,manager,manager-script"/>
</tomcat-users>
最佳答案
我认为 403 ERROR
的解决方案是将您的 IP/IP
添加到文件中
webapps/manager/META-INF/context.xml
在部分中:
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="X.X.X.X"/>
关于java - 无法访问tomcat manager GUI (Tomcat9+Java9),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46845145/