我正在使用 tomcat 9.0.1 版。在使用 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-users.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>