title: Setting URL with subfolder in Tomcat 9
body: <p>I have Tomcat 9. I am trying to get the URL lik this: <code>http://default.local:8080/default_war/</code> but my site is still available only by <code>http://default.local:8080</code>.
  The address I am going to set is also generated by Intellij in Run/Configuration so it shoud be possible to set it. Of course I could edit it in Intellij but I wonder how to achieve URL subderictories in Tomcat 9.</p>
  <p>What should I change in my code? Here there are my setting files:</p>
  <pre><code>$ cat /home/u/opt/tomcat/conf/server.xml
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Server port=&quot;8005&quot; shutdown=&quot;SHUTDOWN&quot;&gt;
    &lt;Listener className=&quot;org.apache.catalina.startup.VersionLoggerListener&quot; /&gt;
    &lt;Listener className=&quot;org.apache.catalina.core.AprLifecycleListener&quot; SSLEngine=&quot;on&quot; /&gt;
    &lt;Listener className=&quot;org.apache.catalina.core.JreMemoryLeakPreventionListener&quot; /&gt;
    &lt;Listener className=&quot;org.apache.catalina.mbeans.GlobalResourcesLifecycleListener&quot; /&gt;
    &lt;Listener className=&quot;org.apache.catalina.core.ThreadLocalLeakPreventionListener&quot; /&gt;
    &lt;GlobalNamingResources&gt;
      &lt;Resource name=&quot;UserDatabase&quot; auth=&quot;Container&quot;
                type=&quot;org.apache.catalina.UserDatabase&quot;
                description=&quot;User database that can be updated and saved&quot;
                factory=&quot;org.apache.catalina.users.MemoryUserDatabaseFactory&quot;
                pathname=&quot;conf/tomcat-users.xml&quot; /&gt;
    &lt;/GlobalNamingResources&gt;
    &lt;Service name=&quot;Catalina&quot;&gt;
      &lt;Connector port=&quot;8080&quot; protocol=&quot;HTTP/1.1&quot;
                 connectionTimeout=&quot;20000&quot;
                 redirectPort=&quot;8443&quot; /&gt;
      &lt;Engine name=&quot;Catalina&quot; defaultHost=&quot;localhost&quot;&gt;
        &lt;Realm className=&quot;org.apache.catalina.realm.LockOutRealm&quot;&gt;
          &lt;Realm className=&quot;org.apache.catalina.realm.UserDatabaseRealm&quot;
                 resourceName=&quot;UserDatabase&quot;/&gt;
        &lt;/Realm&gt;
  
        &lt;Host name=&quot;default.local&quot;  appBase=&quot;default&quot;
              unpackWARs=&quot;true&quot; autoDeploy=&quot;true&quot;&gt;
          &lt;Context path=&quot;/default_war&quot; /&gt;
          &lt;Valve className=&quot;org.apache.catalina.valves.AccessLogValve&quot; directory=&quot;logs&quot;
                 prefix=&quot;localhost_access_log&quot; suffix=&quot;.txt&quot;
                 pattern=&quot;%h %l %u %t &amp;quot;%r&amp;quot; %s %b&quot; /&gt;
        &lt;/Host&gt;
  
  
      &lt;/Engine&gt;
    &lt;/Service&gt;
  &lt;/Server&gt;
  u@i3 ~/opt/tomcat
  </code></pre>
  <hr />
  <pre><code>$ cat conf/Catalina/default.local/ROOT.xml
  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Context docBase=&quot;${catalina.base}/deploy/default_war.war&quot;&gt;
  &lt;/Context&gt;
  u@i3 ~/opt/tomcat
  $ 
  </code></pre>