Knowledgebase: VPS Hosting Plans
How can I map my new addon domain to Tomcat?
Posted by - NA - on 02 April 2009 07:43 AM

If you have added a new account or addon domain to your server, but going to http://newdomain.com/jspage.jsp see the source code instead of parsed content, please follow the steps to map your domain to Tomcat:

1. Open /usr/local/apache/conf/httpd.conf file with any text editor, for example vim, find there appropriate VirtualHost container and add the following section:

<IfModule mod_jk.c>
JkMount /* ajp13
JkUnmount /*.php* ajp13
JkUnmount /*.cgi ajp13
JkUnmount /*.shtm* ajp13
JkUnmount /*.pl ajp13
</IfModule>

You can use VirtualHost container of your main domain as example, also please see the following articles to learn more about mod_jk configuration:

http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

2. Open /usr/local/tomcat/default/conf/server.xml file and add there the Host container for your new domain, it should be something like this:

<Host name="newdomain.com" appBase="/home/username/public_html">
<Alias>www.newdomain.com</Alias>
<Context path="" reloadable="true" docBase="/home/username/public_html" />
</Host>

where 'newdomain.com' and 'username' are real values. You can use appropriate section of your main domain as example, also please see the following article about Tomcat configuration:

http://tomcat.apache.org/tomcat-5.5-doc/

3. Restart Apache:

#service httpd restart

4. Restart Tomcat:

#service tomcat restart

(147 vote(s))
Helpful
Not helpful

Comments (0)