Java deployment in linux

Source: Internet
Author: User

Java deployment in linux

Note: Here we only record the steps for deploying the java war package and some linux commands. Installation and deployment of JDK, tomcat, redis, and nginx in linux are not discussed and documented.

1. Prepare the war package.

Take the project I currently participate in as an example. We use maven to build the project automatically, first clean the jar package of the maven project, and then maven install to prepare the jar, then, use maven install to create a war package for the project to be deployed.

2. Upload the war package and start tomcat

Use SSH Secure Shell Client (or SecureCRT_6.5) to log on to the linux server.

Ps-ef | grep tomcat // view the tomcat process. You can obtain the directory of the tomcat server.
Cd/tomcat server directory // open the tomcat root directory
Ll // or use ls to view the structure in this directory
Cd/apache-tomcat-6.0.37/bin // open the tomcat bin directory
./Shutdown. bat // shut down the currently running tomcat server. Another way is to directly kill the process. After ps-ef | grep tomcat, kill-9 tomcat process number
Cd ../webapp // open the webapp directory
Rm-rf XXXX * // delete a file or folder containing XXXX (Project war package name)
Then, use SSH Secure File Transfer Client or another FTP upload tool to put the locally prepared war package in the directory of tomcat webapp on the server, that is, the Directory of the File just deleted.
Cd ../bin // return to the bin directory
./Startup. bat // start tomcat
Cd ../logs // open the tomcat log directory
Tail-f catalina. out // open the log to check whether tomcat is started properly
Ctrl + C jump out
3. Open a browser to access the project homepage. If there is no problem, transfer it to the test.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.