After installing Tomcat, visit the server status, manager app, host manager, and other pages, and the 403 Access denied error appears.
Workaround:
1. In the conf/tomcat-users.xml file, add the following code in front of </tomcat-users> :
<role rolename= "Manager-gui"/>
<user username= "Tomcat" password= "admin888" roles= "Manager-gui"/>
Note: If you want to access host manager, you need to make some changes to the following:
<role rolename= "Manager-gui"/>
<user username= "Tomcat" password= "admin888" roles= "Manager-gui,admin-gui"/>
Then reboot Tomcat and revisit the Manager app page, if the 403 access denied error still appears,
Then the IP of the visit is restricted,
2. We open the context.xml file in the webapps/manager/meta-inf/directory, not the context.xml file in the conf/directory
We comment out or modify the contents of the
<valve classname= "Org.apache.catalina.valves.RemoteAddrValve"
allow= "192\.168\.234\.\d+|127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"/>
Note: If you want to access the host manager, you also need to modify the Context.xml file in the webapps/host-manager/meta-inf/directory, as in the above.
Save, then restart Tomcat, revisit the server Status, Manager app page, and output the user name and password set above to access the page.
Tomcat8.5 Administration page 403 Access denied workaround