I have copied the sample.war
file into the webapps
directory of Tomcat, and I can access localhost:8080
.
Now how will Tomcat deploy it, I mean do I need to open it in browser? How can I access the application?
I have copied the sample.war
file into the webapps
directory of Tomcat, and I can access localhost:8080
.
Now how will Tomcat deploy it, I mean do I need to open it in browser? How can I access the application?
You can access your application from:
http://localhost:8080/sample
Deploying or redeploying of war files is automatic by default - after copying/overwriting the file
sample.war
, check yourwebapps
folder for an extracted foldersample
.If it doesn't open properly, check the log files (e.g. tomcat/logs/catalina.out) for problems with deployment.
There are two ways:
Just use tomcat manager console for console deployment or simply copy and paste your application in webapp folder of your server's tomcat_home directory.
Note: Make sure if your war file size is more than 52 MB (the default configuration value), you need to make two little changes in web.xml file of Manager application of your webapp folder(Manager application is provided by Apache tomcat by default upon installing the server).
Go to the web.xml of the manager application (for instance it could be under /tomcat7/webapps/manager/WEB-INF/web.xml.
Increase the max-file-size and max-request-size values in web.xml file:
<multipart-config>
Increase the size by putting the values for
<max-file-size>
and<max-request-size>
according to your requirement.In addition to the ways already mentioned (dropping the war-file directly into the webapps-directory), if you have the Tomcat Manager -application installed, you can deploy war-files via browser too. To get to the manager, browse to the root of the server (in your case, localhost:8080), select "Tomcat Manager" (at this point, you need to know username and password for a Tomcat-user with "manager"-role, the users are defined in tomcat-users.xml in the conf-directory of the tomcat-installation). From the opening page, scroll downwards until you see the "Deploy"-part of the page, where you can click "browse" to select a WAR file to deploy from your local machine. After you've selected the file, click deploy. After a while the manager should inform you that the application has been deployed (and if everything went well, started).
Here's a longer how-to and other instructions from the Tomcat 7 documentation pages.
If you installed tomcat7 using
apt-get
in linux then, deploy your app to/var/lib/tomcat7/webapps/
eg.
Also, keep tailing the tomcat log so that you can verify that your app is actually making peace with tomcat.
The deployed application should appear in
http://172.16.35.155:8080/manager/html
You just need to put your war file in webapps and then start your server.
it will get deployed.
otherwise you can also use tomcat manager a webfront to upload & deploy your war remotely.
1.Generate a war file from your application
2. open tomcat manager, go down the page
3. Click on browse to deploy the war.
4. choose your war file. There you go!