Knowledgebase & Downloads
The knowledgebase provides documentation written by our team. Please select a category or search for answers.
How to map a domain to Tomcat's web application?
Adding new domains and mapping them to separate java web application is common in Java hosting environments. Tomcat and other Java application servers or servlet containers allow for defining virtual hosts for the purpose. For our example let's assume our new (additional) domain is domain.com, the web application is app1 (app1.war) and the appserver is apache-tomcat-7.0.5
1) Update nameservers at registrar if needed and add the domain to your control panel as either addon domain or parked domain
2) Map domain.com (use default mappings) to your application server using Java Control Panel
3) Login to your account via SSH and edit ~/appservers/apache-tomcat-7.0.5/conf (mcedit and nano are simple editors)
3a) Add new virtual host entry just before last closing Engine tag
<Host name="domain.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="app1" debug="0" privileged="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
pattern="%h %l %u %t "%r" %s %b" resolveHosts="false" />
3b) If you previously put app1.war into webapps directory Tomcat should have deployed the application
but make sure your application files are indeed deployed to ~/appservers/apache-tomcat-7.0.5/webapps/app1 directory.
4) Restart your tomcat via Java Control Panel with 'jr' shell command
- © 2016 JVMHost.com All rights are reserved.