title: Tomcat Manager is not accessible in multi-domain configuration
body: <p>Tomcat Manager is not accessible in my multi-domain configuration. I get a 404 even though the manager files are present in both domains.</p>
  
  <p>Funny enough, I'm able to make this configuration work locally. However, when I transfer my configuration to my servers, it falls apart.</p>
  
  <p>Here is my config file:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  
  &lt;!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
  
        http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  --&gt;
  &lt;!-- Note:  A "Server" is not itself a "Container", so you may not
       define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/server.html
   --&gt;
  &lt;Server port="8005" shutdown="SHUTDOWN"&gt;
    &lt;Listener className="org.apache.catalina.startup.VersionLoggerListener" /&gt;
    &lt;!-- Security listener. Documentation at /docs/config/listeners.html
    &lt;Listener className="org.apache.catalina.security.SecurityListener" /&gt;
    --&gt;
    &lt;!--APR library loader. Documentation at /docs/apr.html --&gt;
    &lt;Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /&gt;
    &lt;!-- Prevent memory leaks due to use of particular java/javax APIs--&gt;
    &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /&gt;
    &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&gt;
    &lt;Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /&gt;
  
    &lt;!-- Global JNDI resources
         Documentation at /docs/jndi-resources-howto.html
    --&gt;
    &lt;GlobalNamingResources&gt;
      &lt;!-- Editable user database that can also be used by
           UserDatabaseRealm to authenticate users
      --&gt;
      &lt;Resource name="UserDatabase" auth="Container"
                type="org.apache.catalina.UserDatabase"
                description="User database that can be updated and saved"
                factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                pathname="conf/tomcat-users.xml" /&gt;
    &lt;/GlobalNamingResources&gt;
  
    &lt;!-- A "Service" is a collection of one or more "Connectors" that share
         a single "Container" Note:  A "Service" is not itself a "Container",
         so you may not define subcomponents such as "Valves" at this level.
         Documentation at /docs/config/service.html
     --&gt;
    &lt;Service name="Catalina"&gt;
  
      &lt;!--The connectors can use a shared executor, you can define one or more named thread pools--&gt;
      &lt;!--
      &lt;Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
          maxThreads="150" minSpareThreads="4"/&gt;
      --&gt;
  
  
      &lt;!-- A "Connector" represents an endpoint by which requests are received
           and responses are returned. Documentation at :
           Java HTTP Connector: /docs/config/http.html (blocking &amp; non-blocking)
           Java AJP  Connector: /docs/config/ajp.html
           APR (HTTP/AJP) Connector: /docs/apr.html
           Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
      --&gt;
      &lt;Connector port="8080" protocol="HTTP/1.1"
                 connectionTimeout="20000"
                 redirectPort="8443" /&gt;
      &lt;!-- A "Connector" using the shared thread pool--&gt;
      &lt;!--
      &lt;Connector executor="tomcatThreadPool"
                 port="8080" protocol="HTTP/1.1"
                 connectionTimeout="20000"
                 redirectPort="8443" /&gt;
      --&gt;
      &lt;!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
           This connector uses the NIO implementation that requires the JSSE
           style configuration. When using the APR/native implementation, the
           OpenSSL style configuration is required as described in the APR/native
           documentation --&gt;
      &lt;!--
      &lt;Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                 maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
                 clientAuth="false" sslProtocol="TLS" /&gt;
      --&gt;
  
      &lt;!-- Define an AJP 1.3 Connector on port 8009 --&gt;
      &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;
  
  
      &lt;!-- An Engine represents the entry point (within Catalina) that processes
           every request.  The Engine implementation for Tomcat stand alone
           analyzes the HTTP headers included with the request, and passes them
           on to the appropriate Host (virtual host).
           Documentation at /docs/config/engine.html --&gt;
  
      &lt;!-- You should set jvmRoute to support load-balancing via AJP ie :
      &lt;Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"&gt;
      --&gt;
      &lt;Engine name="Catalina" defaultHost="localhost"&gt;
  
        &lt;!--For clustering, please take a look at documentation at:
            /docs/cluster-howto.html  (simple how to)
            /docs/config/cluster.html (reference documentation) --&gt;
        &lt;!--
        &lt;Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/&gt;
        --&gt;
  
        &lt;!-- Use the LockOutRealm to prevent attempts to guess user passwords
             via a brute-force attack --&gt;
        &lt;Realm className="org.apache.catalina.realm.LockOutRealm"&gt;
          &lt;!-- This Realm uses the UserDatabase configured in the global JNDI
               resources under the key "UserDatabase".  Any edits
               that are performed against this UserDatabase are immediately
               available for use by the Realm.  --&gt;
          &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                 resourceName="UserDatabase"/&gt;
        &lt;/Realm&gt;
  
        &lt;Host name="my.intranet.com"  appBase="webapps/intranet"
              unpackWARs="true" autoDeploy="true"&gt;
  
              &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                      prefix="intra_localhost_access_log" suffix=".txt"
                      pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;
        &lt;/Host&gt;
  
        &lt;Host name="my.internet.com"  appBase="webapps/internet"
              unpackWARs="true" autoDeploy="true"&gt;
  
              &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                      prefix="inter_localhost_access_log" suffix=".txt"
              pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;
        &lt;/Host&gt;
      &lt;/Engine&gt;
    &lt;/Service&gt;
  &lt;/Server&gt;
  </code></pre>
  
  <p>Directory listing for both intranet and internet in webapps, showing the manager having been copied in both folders:</p>
  
  <pre><code>[me@server internet]$ ls -l
  drwxr-xr-x 2 tomcat appsadmins 4096 Jun  9 08:34 hello
  drwxr-xr-x 5 tomcat appsadmins 4096 Jun  9 08:25 manager
  
  [me@server intranet]$ ls -l
  drwxr-xr-x 2 tomcat appsadmins     4096 Jun  9 08:34 hello
  drwxr-xr-x 5 tomcat appsadmins     4096 Jun  9 08:25 manager
  </code></pre>
  
  <p>The <code>/hello</code> context works in both domains, showing individualized content for each domains.</p>
  
  <p>I can also manually move WAR files into each intranet and internet folders to deploy. However, I'm asked to use the Tomcat Manager (which is the standard way for undeploying/deploying?)</p>
  
  <p><strong>Edit #1</strong></p>
  
  <p>This is currently on Tomcat 8/Java 8. However, I have obtained the same results on our other Tomcat7/Java7 servers. No problems in local VMs though.</p>
  
  <p><strong>Edit #2</strong></p>
  
  <p>Log files that seem to show that the manager has been deployed successfully.</p>
  
  <pre><code>22-Jun-2015 09:33:24.813 INFO [my.internet.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /path/to/tomcat/webapps/internet/manager has finished in 562 ms
  22-Jun-2015 09:33:51.990 INFO [my.intranet.com-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /path/to/tomcat/webapps/intranet/manager has finished in 316 ms
  </code></pre>
  
  <p><strong>Edit #3</strong></p>
  
  <p>I added <code>webapps/host-manager/manager.xml</code> to
  <code>conf/Catalina/my.internet.com/</code>
  and to <code>conf/Catalina/my.intranet.com</code></p>
  
  <p>I still get a 404.</p>
  
  <p><strong>Edit #4</strong></p>
  
  <p>Reverted to a minimal configuration. 404 on manager/html still.</p>
  
  <ul>
  <li>cleared tomcat8/conf/Catalina</li>
  <li>cleared tomcat8/work</li>
  <li>restarted</li>
  </ul>
  
  <p>The only configured host:</p>
  
  <pre><code>&lt;Host name="localhost"  appBase="webapps"
              unpackWARs="true" autoDeploy="true"&gt;
  </code></pre>
  
  <p>The access logs:</p>
  
  <pre><code>xxx.xxx.xxx.xxx - - [02/Jul/2015:10:17:41 -0400] "GET /manager/html HTTP/1.1" 404 1018
  </code></pre>
  
  <p><code>/docs</code> and <code>/example</code> work though.</p>
  
  <p>And again, in a CentOS 6.3 VM, I was able to mimic two domains without too much fuss.</p>
  
  <p><strong>Edit #5</strong></p>
  
  <p>Need to get back at this... on my destination server again.</p>
  
  <p>Recap, configuration of internet domain:</p>
  
  <pre><code>&lt;Host name="my.internet.com" appBase="inter"
      unpackWARs="true" autoDeploy="true"&gt;
  
      &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
              prefix="inter_localhost_access_log" suffix=".txt"
      pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;
  &lt;/Host&gt;
  </code></pre>
  
  <p>Doing a <code>tail -f logs/inter_localhost_access_log.2015-08-04.txt</code>, I can see requests being logged when connecting to <code>my.internet.com</code>.</p>
  
  <p>Accessing the <code>manager/html</code>, gives me 404  </p>
  
  <pre><code>my_ip - - [04/Aug/2015:08:59:28 -0400] "GET /manager/html HTTP/1.1" 404 1028
  my_ip - - [04/Aug/2015:08:59:28 -0400] "GET /favicon.ico HTTP/1.1" 200 21630
  my_ip - - [04/Aug/2015:08:59:28 -0400] "GET /favicon.ico HTTP/1.1" 200 21630
  </code></pre>
  
  <p>Accessing <code>/docs</code></p>
  
  <pre><code>my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs HTTP/1.1" 302 -
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/ HTTP/1.1" 200 16805
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/docs-stylesheet.css HTTP/1.1" 200 6082
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/tomcat.png HTTP/1.1" 200 8410
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/fonts/fonts.css HTTP/1.1" 200 1996
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/asf-feather.png HTTP/1.1" 200 40042
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/fonts/OpenSans600.woff HTTP/1.1" 200 22604
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/fonts/OpenSans400.woff HTTP/1.1" 200 21956
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/fonts/OpenSans700.woff HTTP/1.1" 200 22748
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /docs/images/fonts/OpenSans400italic.woff HTTP/1.1" 200 21092
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /favicon.ico HTTP/1.1" 200 21630
  my_ip - - [04/Aug/2015:08:59:57 -0400] "GET /favicon.ico HTTP/1.1" 200 21630
  </code></pre>
  
  <p>File listing of <code>inter</code></p>
  
  <pre><code>[me@server inter]$ ls -la
  total 28
  drwxrwsr-x  7 tomcat appsadmins 4096 Jun 30 08:15 .
  drwxrwsr-x 11 tomcat appsadmins 4096 Jul 10 14:50 ..
  drwxrwsr-x 14 tomcat appsadmins 4096 Jun 30 08:14 docs
  drwxrwsr-x  6 tomcat appsadmins 4096 Jun 30 08:14 examples
  drwxrwsr-x  5 tomcat appsadmins 4096 Jun 30 08:14 host-manager
  drwxrwsr-x  5 tomcat appsadmins 4096 Jun 30 08:14 manager
  drwxrwsr-x  3 tomcat appsadmins 4096 Jun 30 08:15 ROOT
  </code></pre>
  
  <p>Process information</p>
  
  <pre><code>[me@server inter]$ ps aux | grep tomcat
  tomcat   31863  3.7  4.1 2914836 162184 pts/0  Sl   08:56   0:18 /usr/bin/java -Djava.util.logging.config.file=/path/to/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/path/to/tomcat8/endorsed -classpath /path/to/tomcat8/bin/bootstrap.jar:/path/to/tomcat8/bin/tomcat-juli.jar -Dcatalina.base=/path/to/tomcat8 -Dcatalina.home=/path/to/tomcat8 -Djava.io.tmpdir=/path/to/tomcat8/temp org.apache.catalina.startup.Bootstrap start
  </code></pre>
  
  <p>HTTP Headers in Firefox:</p>
  
  <pre><code>http://my.internet.com:8080/manager/index.jsp
  
  GET /manager/index.jsp HTTP/1.1
  Host: my.internet.com:8080
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  Cookie: JSESSIONID=92691406245E9FA2F35105951A8363F8; __utma=200567291.1579910409.1418663486.1431011588.1437739620.4; __utmz=200567291.1418663486.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _ga=GA1.3.1579910409.1418663486; _dfo_lang=en
  Connection: keep-alive
  
  HTTP/1.1 302 Found
  Server: Apache-Coyote/1.1
  Location: http://my.internet.com:8080/manager/html
  Content-Type: text/html;charset=ISO-8859-1
  Content-Length: 0
  Date: Tue, 04 Aug 2015 13:13:36 GMT
  ----------------------------------------------------------
  http://my.internet.com:8080/manager/html
  
  GET /manager/html HTTP/1.1
  Host: my.internet.com:8080
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Language: en-US,en;q=0.5
  Accept-Encoding: gzip, deflate
  Cookie: JSESSIONID=92691406245E9FA2F35105951A8363F8; __utma=200567291.1579910409.1418663486.1431011588.1437739620.4; __utmz=200567291.1418663486.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _ga=GA1.3.1579910409.1418663486; 
  Connection: keep-alive
  
  HTTP/1.1 404 Not Found
  Server: Apache-Coyote/1.1
  Content-Type: text/html;charset=utf-8
  Content-Language: en
  Content-Length: 1018
  Date: Tue, 04 Aug 2015 13:13:36 GMT
  </code></pre>
  
  <p><strong>Edit #6</strong></p>
  
  <p>Permissions on <code>/docs</code> and <code>/manager</code></p>
  
  <pre><code>[me@server docs]$ ls -l
  total 1296
  -rw-rwSr-- 1 tomcat appsadmins  21715 Jun 30 08:14 aio.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 api
  drwxrwsr-x 3 tomcat appsadmins   4096 Jun 30 08:14 appdev
  -rw-rwSr-- 1 tomcat appsadmins  13843 Jun 30 08:14 apr.html
  drwxrwsr-x 4 tomcat appsadmins   4096 Jun 30 08:14 architecture
  -rw-rwSr-- 1 tomcat appsadmins   7701 Jun 30 08:14 balancer-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  16305 Jun 30 08:14 building.html
  -rw-rwSr-- 1 tomcat appsadmins  16480 Jun 30 08:14 BUILDING.txt
  -rw-rwSr-- 1 tomcat appsadmins  10726 Jun 30 08:14 cgi-howto.html
  -rw-rwSr-- 1 tomcat appsadmins 209429 Jun 30 08:14 changelog.html
  -rw-rwSr-- 1 tomcat appsadmins  18330 Jun 30 08:14 class-loader-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  43860 Jun 30 08:14 cluster-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  10301 Jun 30 08:14 comments.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 config
  -rw-rwSr-- 1 tomcat appsadmins   8806 Jun 30 08:14 connectors.html
  -rw-rwSr-- 1 tomcat appsadmins  17936 Jun 30 08:14 default-servlet.html
  -rw-rwSr-- 1 tomcat appsadmins  23038 Jun 30 08:14 deployer-howto.html
  -rw-rwSr-- 1 tomcat appsadmins   8733 Jun 30 08:14 developers.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 elapi
  -rw-rwSr-- 1 tomcat appsadmins  10577 Jun 30 08:14 extras.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 funcspecs
  -rw-rwSr-- 1 tomcat appsadmins  30498 Jun 30 08:14 html-manager-howto.html
  drwxrwsr-x 3 tomcat appsadmins   4096 Jun 30 08:14 images
  -rw-rwSr-- 1 tomcat appsadmins  16805 Jun 30 08:14 index.html
  -rw-rwSr-- 1 tomcat appsadmins  11995 Jun 30 08:14 introduction.html
  -rw-rwSr-- 1 tomcat appsadmins  23447 Jun 30 08:14 jasper-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  66799 Jun 30 08:14 jdbc-pool.html
  -rw-rwSr-- 1 tomcat appsadmins  35841 Jun 30 08:14 jndi-datasource-examples-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  54636 Jun 30 08:14 jndi-resources-howto.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 jspapi
  -rw-rwSr-- 1 tomcat appsadmins  34918 Jun 30 08:14 logging.html
  -rw-rwSr-- 1 tomcat appsadmins  75344 Jun 30 08:14 manager-howto.html
  -rw-rwSr-- 1 tomcat appsadmins   8218 Jun 30 08:14 maven-jars.html
  -rw-rwSr-- 1 tomcat appsadmins   8323 Jun 30 08:14 mbeans-descriptor-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  40235 Jun 30 08:14 monitoring.html
  -rw-rwSr-- 1 tomcat appsadmins  13371 Jun 30 08:14 proxy-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  64018 Jun 30 08:14 realm-howto.html
  -rw-rwSr-- 1 tomcat appsadmins   6954 Jun 30 08:14 RELEASE-NOTES.txt
  -rw-rwSr-- 1 tomcat appsadmins  35358 Jun 30 08:14 rewrite.html
  -rw-rwSr-- 1 tomcat appsadmins  16682 Jun 30 08:14 RUNNING.txt
  -rw-rwSr-- 1 tomcat appsadmins  34336 Jun 30 08:14 security-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  30478 Jun 30 08:14 security-manager-howto.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 servletapi
  -rw-rwSr-- 1 tomcat appsadmins  13047 Jun 30 08:14 setup.html
  -rw-rwSr-- 1 tomcat appsadmins  17817 Jun 30 08:14 ssi-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  37032 Jun 30 08:14 ssl-howto.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 tribes
  -rw-rwSr-- 1 tomcat appsadmins  11610 Jun 30 08:14 virtual-hosting-howto.html
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 WEB-INF
  drwxrwsr-x 2 tomcat appsadmins   4096 Jun 30 08:14 websocketapi
  -rw-rwSr-- 1 tomcat appsadmins  13888 Jun 30 08:14 web-socket-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  22776 Jun 30 08:14 windows-auth-howto.html
  -rw-rwSr-- 1 tomcat appsadmins  22974 Jun 30 08:14 windows-service-howto.html
  
  [me@server manager]$ ls -l
  total 32
  drwxrwsr-x 2 tomcat appsadmins 4096 Jun 30 08:14 images
  -rw-rwSr-- 1 tomcat appsadmins  906 Jun 30 08:14 index.jsp
  drwxrwsr-x 2 tomcat appsadmins 4096 Jun 30 08:14 META-INF
  -rw-rwSr-- 1 tomcat appsadmins 4458 Jun 30 08:14 status.xsd
  drwxrwsr-x 3 tomcat appsadmins 4096 Jun 30 08:14 WEB-INF
  -rw-rwSr-- 1 tomcat appsadmins 4723 Jun 30 08:14 xform.xsl
  </code></pre>