Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy war package under Linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to deploy the war package under Linux, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

Java web projects are all packed into war packages and released, and the advantage of war packages is that there is no shortage of directories, and only one release file is managed, and the tomcat server can automatically identify the war package under the webapps of the tomcat container, start the service, and then run the project.

1. Linux quickly deploy War package operation, which is the easiest operation for the time being.

1. Close Tomcat first

/ home/java/tomcat7/bin/shutdown.sh

2. Enter the War package storage directory (you can transfer War to the Linux server through the tool: SSH Secure Shell Client)

Cd / home/project

3. Extract the War package into the deployed project

Java code

Unzip-oq finance.war-d / home/java/tomcat7/webapps/finance/

Description:

Unzip-o: you don't have to ask the user first, unzip executes and overwrites the original file.

Unzip-Q: no information is displayed during execution.

4. Start Tomcat after deployment

Java code

/ home/java/tomcat7/bin/startup.sh

2. Commands that may be used

1. View the Tomcat process ps-ef | grep java 2, kill the process (10740 is the process Pid) kill-9 10740 3, restart the Linux server reboot 4, go to the logs directory under Tomcat, and view the log file dynamically Use Ctrl+Z tail-f catalina.out 5. Jar command to extract war package jar-xvf game.war to current directory 6. Delete folder instance: rm-rf / var/log/httpd/access will delete / var/log/httpd/access directory and all files and folders under it. Delete all files under a folder. Do not delete the folder rm-rf / test/* or go to the test folder: cd test, and then: rm-rf * Delete a single folder: rmdir folder name, such as: rmdir aa VII. Delete file usage example: rm-f / var/log/httpd/access.log will force the file / var/log/httpd/access.log to be deleted

Thank you for reading this article carefully. I hope the article "how to deploy war package under Linux" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report