Subdomain Handling Tutorial

This tutorial explains how you can host subdomains with a Java hosting package at JavaPipe. 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 just before the closing tag:
    <Host name="{sub.primarydomain.com}" debug="0"     appBase="webapps"       unpackWARs="true" autoDeploy="true">  <Context path=""     docBase="/home/{username}/{primarydomain.com}/tomcat/webapps/{webappname}"        crossContext="false" reloadable="true">  <Valve className="org.apache.catalina.valves.AccessLogValve"     directory="/home/{username}/primarydomain.com}/tomcat/logs"        prefix="{sub.primarydomain.com}_log."          suffix=".txt" pattern="common" resolveHosts="false"/> </Context>  </Host>
Replace {username}, {primarydomain.com}, {sub.primarydomain.com} 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?

 Print this Article

Also Read

How to Redirect Your Tomcat or JBoss Over Port 80

How to Redirect Your Tomcat or JBoss Over Port 80 This article is for customers with a dedicated...

Spring Framework

Need to develop Plain Old JAVA Objects? Want to have fun developing your application? Then we...

How do I upgrade or downgrade my JVM memory requirements?

This article explains how you can upgrade or downgrade your JVM heap and perm gen memory...

How to Setup Glassfish on Ubuntu or CentOs

How to install Glassfish on a virtual or dedicated server. Note: # prompt is root and $ prompt...

How to use Tomcat Control in Siteworx

Tomcat Control provides you a way to control your Tomcat instance from Siteworx if you're using...