1

I am unable to access Host Manager after installing Tomcat 8 on my Ubuntu 16.04 server. I can access Manager App just fine.

I added manager-gui and admin-gui roles to my tomcat-users.xml file located in $CATALINA_HOME/conf/ directory.

<tomcat-users . . .>
    <role rolename="manager-gui"/>
    <role rolename="admin-gui"/>
    <user username="myusername" password="mypassword" roles="manager-gui,admin-gui"/>
</tomcat-users>

Any ideas?

enter image description here

enter image description here

enter image description here

kimbaudi
  • 111
  • 1
  • 1
  • 5

3 Answers3

4

I also had the same issue. Solved it this way:

Find and edit your host-manager webapp context.xml file:

 $CATALINA_HOME/webapps/host-manager/META-INF/context.xml

Comment out the Valve that is restricting your access to only localhost:

    <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" />
-->

Save and close the file.

Good practice would be to restart Tomcat, but I didn't need to, access was immediate.

Tomcat 8.5.29 on OEL 7.4, Java 1.8_162

3

I had exactly the same problem as you.

This is how I resolved it:

conf/tomcat-users.xml (stays the same)

<tomcat-users>
   <role rolename="admin-gui"/>
   <role rolename="manager-gui"/>
   <user username="admin" password="password" roles="admin-gui,manager-gui"/>
</tomcat-users>

Under conf/Catalina/localhost I needed an additional file for each context:

manager.xml

<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>

host-manager.xml

<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/host-manager">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>

After that I was prompted for username and password and it worked.

I read some articles suggesting to edit the valves in /webapps/manager/META-INF/context.xml and /webapps/host-manager/META-INF/context.xml but I think the localhost one above takes precedence.

user3559338
  • 131
  • 2
  • Sorry for the late reply, but I didn't need to do any of that. After I shutdown Tomcat (`$CATALINA_HOME/bin/shutdown.sh`) and started it back up (`$CATALINA_HOME/bin/startup.sh`), I was able to access Tomcat Virtual Host Manager. In order to gain access to Virtual Host Manager, I just needed `admin-gui` role and shutdown/startup of Tomcat. – kimbaudi Nov 21 '16 at 07:35
0

I had the same problem, but I was running Tomcat 9 on Windows 10. Both Marc Hearling and user3559338 solutions work, but I'll add some additional insights.

The first unusually thing was that the solution didn't work if I included the docBase argument. If I deleted that argument I was able to get Manager App and Server Status work. However, host-manager did not work. What I eventually discovered was the host-manager directory was missing from the webapps directory. I downloaded the tomcat zip file and was able to restore the missing directory. I don't know for sure why it was missing. I originally installed Tomcat using the windows installer rather than using the tomcat zip file. Maybe that installer is not installing the host-manager directory. It's possible that I accidentally deleted that folder, but I kind of doubt that. After I got Manager App, Server Status, and host manager working, I put the docBase argument back in the two xml context files, and this time they worked. I then played around with docBase and noticed that, for example, you could still access the host manager even if you put in a bogus docBase address. That makes me wonder what the exact situation is when one needs to include the docBase parameter. The only way I could get the docBase parameter to fail is if I removed one of the quotes. That makes sense since that makes the xml invalid. The unfortunate thing is that Tomcat does not log an error for this kind of mistake.

tom
  • 1