Subdomain Handling Tutorial Print

  • 256

This tutorial explains how you can host subdomains with JavaPipe's Java Tomcat hosting. This is assuming that you wish to host a particular webapp for a different subdomain other than your primary domain.

First thing you need to do is to create a subdomain in you SiteWorx control panel. Then you need to add a Host entry in your server.xml (It is a very good idea to back up this server.xml file before editing it.)

Be careful not to change any of the port information - doing so could get your site suspended. Place following code after the last </Host> tag and just before the </Engine>closing tag:

<Host name="{}" debug="0" appBase="webapps"       
  unpackWARs="true" autoDeploy="true">  

  <Context path="" docBase="/home/{username}/{}/tomcat/webapps/{webappname}"        
    crossContext="false" reloadable="true">  
    <Valve className="org.apache.catalina.valves.AccessLogValve" 
        prefix="{}_log." suffix=".txt" 
        pattern="common" resolveHosts="false"/> 


Replace {username}, {}, {} and {webappname} with your own.
Set up the webapp or drop in a new WAR file of the new webappname in your webapps directory. Restart tomcat.

Was this answer helpful?

« Back