Deploy Tomcat Applications in Custom Directory

I have already written about how to change the directory of applications deployed in tomcat 7 by configuring the server.xml. However, there is an easier way to change the deployment directory using the tomcat manager.

  1. Deploy the WAR file using tomcat manager’s web upload feature (make sure to change the manager’s web.xml if you are deploying large applications in tomcat 7).

  1. Use the function “Deploy directory or WAR file located on server” to specify the desired context path for your application.

For this, you need to know the path of the ‘webapps’ directory, to which tomcat deploys applications by default.

Be sure to start the context path with a slash: eg /path/mydir rather than path/mydir

  1. Undeploy the original WAR file you have uploaded.



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 )

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