I've just set up Tomcat 8 on an Ubuntu 14.04 VM and I'm not able to access the Manager App at http://[hostname]:8080/manager/html
from my browser. I get a "403 Access Denied" error as soon as I click on it. I am running Tomcat as a service defined in a config file in /etc/init.d/tomcat8-dev
. The error message indicates that Tomcat is set up to be accessible only from localhost initially, but as it is a hosted VM I'm not able to run a browser on it.
I have set up a user in the tomcat-users.xml
file as several people have recommended. However, I am not prompted to provide the credentials for that user, and I can't find any kind of login button on the default page. That file currently looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<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-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<user username="(redacted)" password="(redacted)"
roles="manager-gui,manager-jmx,manager-status,manager-script"/>
</tomcat-users>
After reading the Tomcat documentation page here, I have also tried adding <Valve />
tags into context.xml
that look something like this:
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1" />
<!--Another valve for my local machine's IP-->
</Context>
However, as soon as I set privileged="true"
, I get a blank white page when I connect to the server with my browser regardless of the valves I provide afterwards.
I restart my service with sudo service tomcat8-dev restart
whenever I make changes.
Other things I have tried based on posts I read here and on other sites:
- Various configurations of roles for my tomcat user
- Adding
address="0.0.0.0"
toserver.xml
inside the<Connector />
tag - Using
initctl
instead of setting up a service based on the instructions here, which doesn't load the default page on my server for some reason - Trying different browsers, and disabling my popup blocker
Nothing I've tried works. Please let me know if you would like more details about my situation. Any suggestions?
Edit: The problem was that I was editing the wrong context.xml
file. The correct file is in tomcat/webapps/manager/META-INF
. I had incorrectly been making changes to tomcat/conf/context.xml
.