I have installed tomcat 9 on a remote sever and after starting it, it was brought up fine, I can access http://host_name:port_num and see tomcat hello page. But when I try to open manager app to see my deployed apps, I get 403 access denied, I already add roles in tomcat user xml as following:
<role rolename="manager"/> <role rolename="manager-gui"/> <role rolename="admin"/> <user username="user" password="password" roles="admin,manager,manager-gui"/>
The error messages I saw is:
By default the Host 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 Host Manager's context.xml file.
How should I change context.xml file and get access to manager app?
By default the Host 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 tomcat/webapps/manager/META-INF/context. xml to allow all ips or just yours.
The Tomcat Host Manager application is a part of Tomcat installation, by default available using the following context: /host-manager . You can use the host manager in the following ways: Utilizing the graphical user interface, accessible at: {server}:{port}/host-manager/html .
Goto Windows Firewall->Advanced Settings->Inbound Rules. In the Right side click on New Rule->Then select Port from dialog box and Next->Then type port "8080" (As by default Tomcat run on this port) and Next->Then select "Allow the connection"->Next->Give a Name ->Finish.
It may take from 3 to 10 minutes after the hands-on lab has started before you can access the Tomcat server on Port 8080. To access the server, use its external IP address (found on the hands-on lab overview page) in the URL bar of a web browser, then append :8080 to it.
For Tomcat v8.5.4 and above, the file <tomcat>/webapps/manager/META-INF/context.xml
has been adjusted:
<Context antiResourceLocking="false" privileged="true" > <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> </Context>
Change this file to comment the Valve
:
<Context antiResourceLocking="false" privileged="true" > <!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> </Context>
After that, refresh your browser (not need to restart Tomcat), you can see the manager page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With