title: Setup subdomain in tomcat7
body: <p>I have both apache2 and tomcat7 installed on my server<br>
  apache runs on port <code>80</code> and tomcat on port <code>8080</code>  </p>
  
  <p>My domain <code>pedjaapps.net</code> points to my server ip and that works fine(apache handles it as it should)  </p>
  
  <p>Now i want my subdomain <code>api.pedjapps.net</code> on port '8080' to point to subfolder <code>api</code> on tomcat server  </p>
  
  <p>i tried editing server.xml and adding something like this:  </p>
  
  <pre><code>&lt;Host appbase="webapps/api" autodeploy="true" name="api.pedjaapps.net" unpackwars="true" xmlnamespaceaware="false" xmlvalidation="false"&gt;
      &lt;Context docbase="/var/lib/tomcat7/webapps/api" path="" reloadable="true"&gt;&lt;/Context&gt;
  &lt;/Host&gt;
  </code></pre>
  
  <p>but it still opens default tomcat page</p>
  
  <p>api.pedjaapps.net also points to my servers ip in dns, if that is relavent</p>