How to deploy web project on tomcat?
There are two methods to deploy an application in tomcat
1- Deploy the application in webapps directory directly under tomcat directory.
Put the .war file of project in webapp directory and restart tomcat.
2- You have a working project with correct directory structure anywhere on filesystem and you want to deploy that without moving it to webapps directory.
But I don’t wanna create a war file then putting it in webapps directory and later on whenever I make a change I’ll have to deploy it again.
To overcome this issue do the following
2.1- Go to tomcat directory
2.2- Then go to tomcat_home/conf/Catalina/localhost directory
Note: sometimes Catalina/localhost directory structure does not exit. If this is case then first create Catalina direcoty and then inside Catalina create localhost directorie.
2.3- Create an xml file. Give it a name. This name will be used to access the application from URL. In my case I name it adbank.xml and in the URL for my application is
2.4- Add the following line in this xml file
<Context path="/AdBlast" docBase="/home/baig/Workspace-AdBlast/AdBank/webapp/webroot" debug="0" reloadable="true"/>
path: provide any name(I personally don’t know its functionality but the path did not matte for me)
docBase: provide the path to you project. I had a few problems with it, I solved it when I provided the path up to the directory where my project’s WEB-INF directory is placed.
2.4- Restart tomcat
2.4- Access you application with a URL similar to this one
replace adbank with the name of your xml file.
Filed under: Programming, Tomcat, Tutorials | 1 Comment
Tags: deploying appllication on tomcat, Tomcat, tomcat web project
- RT @NadeemfParacha: Ian Chapelle says Aus should not invite Pak if it can't win in Aus. What about Aus losing 3-0 in SL, 2-0 in UAE and 4-0… 1 month ago
- @miyankimalhara @Rekhta barri fauj for army, behri fauj for navy and fizai fauj for air force 1 month ago
- How do I become a data scientist without a PhD? lnkd.in/g53ngg6 3 months ago
- @SydneyAirport Please share location of P9 car park on map. I was unable to find it 4 months ago
- Data Scientists vs. BI Analysts: What's the Difference? lnkd.in/bE7g-K8 4 months ago
Ash on How to Find and Kill a Process… manukyanartavazd on How to Find and Kill a Process… Ali on Find Second Or nth Highest Val… ranjanm on Find Second Or nth Highest Val… Kellee on How to deploy web project on…
Follow me on Twitter