Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access Tomcat Manager App from different host

Tags:

tomcat

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?

like image 582
feichangh Avatar asked Apr 18 '16 20:04

feichangh


People also ask

How do I access Tomcat 9 Admin GUI from another host?

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.

How do I access Tomcat Manager GUI?

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 .

How do I access Tomcat from another computer?

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.

How do I make Tomcat accessible from outside?

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.


1 Answers

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.

like image 61
jqgsninimo Avatar answered Sep 21 '22 22:09

jqgsninimo