How To Map A Domain To Tomcat’s Web Application

When you deployed your application in Tomcat server you can view your app by the link like: http://localhost:port/appName. You can mapping a domain to Tomcat’s web application to access your application according by your domain (ex: after you reference the domain to your ip server.
To do this you flow theses steps:
Step 1: Open file server.xml in folder C:/Tomcat7.2/conf.
Setp 2: Change port of http tomcat to 80. This look like:

<Connector port="80" protocol="HTTP/1.1"
               redirectPort="8443" />

Step 3: Add new virtual host entry just before last closing Engine tag

<Host name="" 

		   <Context path="" docBase="C:/Tomcat7.2/webapps/yourapp" 
			   debug="0" reloadable="false"/>
		   <Context path="/yourapp" docBase="C:/Tomcat7.2/webapps/yourapp" 
			  debug="0" reloadable="false"/>

Step 3: Save file and restart apache tomcat.

Happy coding!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s