title: Deploy web service on same tomcat but on different port
body: <p>I've web portal developed in struts which is deployed in tomcat on port 8080 &amp; now I want to deploy web service on the same tomcat server but on different port 8090.</p>
  
  <p>C:\tomcat-6.0.32\conf\server.xml:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;Server port="8005" shutdown="SHUTDOWN"&gt;
     &lt;Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /&gt;
     &lt;Listener className="org.apache.catalina.core.JasperListener" /&gt;
     &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /&gt;
     &lt;Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /&gt;
     &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&gt;
  
    &lt;GlobalNamingResources&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;Service name="Catalina"&gt;        
    &lt;Connector port="8080" protocol="HTTP/1.1" 
             connectionTimeout="20000" 
             redirectPort="8443" /&gt;
    &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&gt;
  
    &lt;Engine name="Catalina" defaultHost="localhost"&gt;
      &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/&gt;
      &lt;Host name="localhost"  appBase="webapps"
          unpackWARs="true" autoDeploy="true"
          xmlValidation="false" xmlNamespaceAware="false"&gt;
      &lt;/Host&gt;
    &lt;/Engine&gt;
    &lt;/Service&gt;
  
    &lt;Service name="testing"&gt;        
      &lt;Connector port="8090" protocol="HTTP/1.1" 
             connectionTimeout="20000" 
             redirectPort="9443" /&gt;
      &lt;Connector port="8092" protocol="AJP/1.3" redirectPort="9443" /&gt;
      &lt;Engine name="testing" defaultHost="localhost"&gt;
        &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/&gt;
        &lt;Host name="localhost"  appBase="webapps"
          unpackWARs="true" autoDeploy="true"
          xmlValidation="false" xmlNamespaceAware="false"&gt;
        &lt;/Host&gt;
      &lt;/Engine&gt;
    &lt;/Service&gt;
  &lt;/Server&gt;
  </code></pre>
  
  <p>Here, I added new service entry with name testing for web service to deploy it on 8090.
  The portal's war file is exploded in C:\tomcat-6.0.32\webapps\ROOT directory.</p>
  
  <p>C:\tomcat-6.0.32\conf\Catalina\localhost\ROOT.xml contains below entry for web portal:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;Context path="/" docBase="" debug="5" reloadable="false" useHttpOnly="true" crossContext="true"&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Now, for web service, I created C:\tomcat-6.0.32\conf\testing\localhost\testing.xml with below contents:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;Context path="/" docBase="C:/testing" debug="5" reloadable="false" useHttpOnly="true" crossContext="true"&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>And in C:/testing, I just placed abc.htm to see if it is accessible from <a href="http://localhost:8090/abc.htm" rel="nofollow">http://localhost:8090/abc.htm</a> but it didn't work. Instead, it shows me index.html within C:\tomcat-6.0.32\webapps\ROOT directory when I access <a href="http://localhost:8090" rel="nofollow">http://localhost:8090</a> &amp; <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a> gives 404 error.</p>
  
  <p>Here is my catalina.log:</p>
  
  <pre><code>INFO: Deploying configuration descriptor ROOT.xml
  Jan 15, 2012 11:16:25 PM org.apache.coyote.http11.Http11Protocol start
  INFO: Starting Coyote HTTP/1.1 on http-8080
  Jan 15, 2012 11:16:25 PM org.apache.jk.common.ChannelSocket init
  INFO: JK: ajp13 listening on /0.0.0.0:8009
  Jan 15, 2012 11:16:25 PM org.apache.jk.server.JkMain start
  INFO: Jk running ID=0 time=0/19  config=null
  Jan 15, 2012 11:16:25 PM org.apache.catalina.core.StandardService start
  INFO: Starting service testing
  Jan 15, 2012 11:16:25 PM org.apache.catalina.core.StandardEngine start
  INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
  Jan 15, 2012 11:16:25 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor testing.xml
  Jan 15, 2012 11:16:25 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory ROOT
  Jan 15, 2012 11:16:25 PM org.apache.coyote.http11.Http11Protocol start
  INFO: Starting Coyote HTTP/1.1 on http-8090
  Jan 15, 2012 11:16:25 PM org.apache.jk.common.ChannelSocket init
  INFO: JK: ajp13 listening on /0.0.0.0:8092
  Jan 15, 2012 11:16:25 PM org.apache.jk.server.JkMain start
  INFO: Jk running ID=0 time=0/16  config=null
  Jan 15, 2012 11:16:25 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 510 ms
  </code></pre>
  
  <p>Can any one tell me what's going wrong?</p>
  
  <p>UPDATE: I just noticed that if I put the index.html in C:\tomcat-6.0.32\webapps directory, it is accessible at <a href="http://localhost:8090" rel="nofollow">http://localhost:8090</a> Can any one help me now how to fix this so that I want to place index.html in some other directory?</p>
  
  <p>Thanks!</p>