Apache Tomcat is a Java web application server that provides possibility to deploy your Servlet application.
There are two ways to configure your different web application to deploy in tomcat:
- server.xml
- via Context file
Most of the case, it’s discouraged to configure the deployment on server.xml so here I propose for deploying application using context file.
The context file:
- is located at apache-tomcat-7.x.x\conf\Catalina\localhost
- Filename is the application context name (e.g. http://localhost:8080/mycontextapp/)
- One context file is for deploying one application war
Sample configuration (file: apache-tomcat-7.x.x\conf\Catalina\localhost\mycontextapp.xml)
<Context path="/mycontextapp" reloadable="true" docBase="D:/tmp/webapp" workDir="D:/tmp/webapp/work" />
If you are looking for the way to call this context and deploying the application with eclipse, please have a look to this article.
And enjoy other application server topic.
2 replies on “Deploy Application via Apache Tomcat Context”
One of the solution, share yours in comment.
[…] As shown above, we can place different application context file in different folder (refer to each connection port) we wish. If you don’t know how to create tomcat context file, you can read here. […]