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 , 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.
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. 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.
Go to the web. If you try uploading the new file as a war file, with tomcat still running, it will attempt to expand it before it is all there. It will fail. Having failed, it will not try again. Thus, uploading a www file, then renaming it, allows the whole war file to be present before tomcat notices it.
Also, keep tailing the tomcat log so that you can verify that your app is actually making peace with tomcat. Generate a war file from your application 2. Click on browse to deploy the war. There you go! I followed the instruction in the following link, it works for me. The application name goes into the context of your tomcat deployed URL, eg. By default, Port is , but if you wish to change it, or want to know the port where tomcat is running, simply go to server.
If anything goes wrong, check the log files e. How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to deploy a war file in Tomcat 7 Ask Question.
Asked 10 years, 10 months ago. Active 4 months ago. Viewed k times. John John. So to overcome this difficulty you can use a deployment software like Jenkins to auto deploy the application. We will see the steps to deploy application war file in detail in below section. Apache tomcat is a free and open source Java based web server which provides an environment to run Java applications, Servlet and JSP Pages.
Resources in tomcat web server can accessed through http or https based requests. Jenkins is an open source automation server used for building, testing and deploying software in multiple environments with the help of supported frameworks and Libraries. Ambivert Mr. Ambivert 15 1 1 silver badge 8 8 bronze badges. Can you provide your project structure — utsav anand.
I got the solution from the answers. Add a comment. Active Oldest Votes. Tomcat will then automatically unpack into a directory named after a war file and deploy it. If the name is MyProject. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.
0コメント