title: Can't access Tomcat 8 Manager App
body: <p>I've just set up Tomcat 8 on an Ubuntu 14.04 VM and I'm not able to access the Manager App at <code>http://[hostname]:8080/manager/html</code> 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 <code>/etc/init.d/tomcat8-dev</code>. 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.</p>
  
  <p>I have set up a user in the <code>tomcat-users.xml</code> 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:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
  
      &lt;role rolename="manager-script"/&gt;
      &lt;role rolename="manager-jmx"/&gt;
      &lt;role rolename="manager-gui"/&gt;
      &lt;role rolename="manager-status"/&gt;
  
      &lt;user username="(redacted)" password="(redacted)" 
          roles="manager-gui,manager-jmx,manager-status,manager-script"/&gt;
  &lt;/tomcat-users&gt;
  </code></pre>
  
  <p>After reading the Tomcat documentation page <a href="http://192.81.128.253:8080/docs/manager-howto.html" rel="noreferrer" title="here">here</a>, I have also tried adding <code>&lt;Valve /&gt;</code> tags into <code>context.xml</code> that look something like this:</p>
  
  <pre><code>&lt;Context privileged="true" antiResourceLocking="false"
      docBase="${catalina.home}/webapps/manager"&gt;
  
      &lt;Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1" /&gt;
      &lt;!--Another valve for my local machine's IP--&gt;
  
  &lt;/Context&gt;
  </code></pre>
  
  <p>However, as soon as I set <code>privileged="true"</code>, I get a blank white page when I connect to the server with my browser regardless of the valves I provide afterwards.</p>
  
  <p>I restart my service with <code>sudo service tomcat8-dev restart</code> whenever I make changes.</p>
  
  <p>Other things I have tried based on posts I read here and on other sites:</p>
  
  <ul>
  <li>Various configurations of roles for my tomcat user</li>
  <li>Adding <code>address="0.0.0.0"</code> to <code>server.xml</code> inside the <code>&lt;Connector /&gt;</code> tag</li>
  <li>Using <code>initctl</code> instead of setting up a service based on the instructions <a href="https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-14-04" rel="noreferrer">here</a>, which doesn't load the default page on my server for some reason</li>
  <li>Trying different browsers, and disabling my popup blocker</li>
  </ul>
  
  <p>Nothing I've tried works. Please let me know if you would like more details about my situation. Any suggestions?</p>
  
  <p><strong>Edit:</strong> The problem was that I was editing the wrong <code>context.xml</code> file. The correct file is in <code>tomcat/webapps/manager/META-INF</code>. I had incorrectly been making changes to <code>tomcat/conf/context.xml</code>.</p>