About the Cloud Linux deployment Tomcat Server (MAVEN multi-Module war pack)

Source: Internet
Author: User
Tags pack tomcat server apache tomcat linux mint

Blogger's operating Environment: computer systems: Linux Mint JDK Version: Java Edition "1.8.0_171" maven version: Apache maven 3.5.31, about the generation of war packages:

  

, this is a multi-module project, is divided into front and back end, the resulting war package will be generated in the Web Part, but the Web Part is dependent on the service part, so we need to first build the service part of the jar package to ensure that the Web Part of the war package successfully generated:

Build the jar package for the service section:

  

After you see the build, you successfully place the MAVEN repository:

  

Next we're going to build the war package for the Web:

  

We can see that the build was successful and placed under cn/zuoyu/ssm/ssm-web/:

  

So now many novice will ask, deploy only Web.war package, then service project? To know that the web has a strong dependency on service, let's Open the war package:

  

Clearly see there are four of folders

  

Seeing what we want to know in the Web-inf directory, will the service class file be in the classes directory? Let's see:

  

There's nothing in this, let's see if there's anything we want to see in the Lib directory:

  

Look closely, you will see the Ssm-service-0.0.1-snapshot.jar package, this is the service we have just generated the jar package, then we have to see if there is something we want in this package:

  

See here to understand, the service so the content is in this jar package, so we just need to deploy this Web.war package.

Second, upload to the cloud Linux server: Cloud Server System: Contes 6.5 JDK version: Java version "1.8.0_112" Tomcat versions: Apache TOMCAT/9.0.0.M15

First we want to connect SSH:

Format is #ssh [email protected]

  

Let's look at the address of Tomcat and enter:

  

Let's take a look at the WebApps directory:

  

Empty, except that comes with nothing else. Now we're going to upload the local war package to the Cloud Server directory (to make it easy for me to rename this war package to Zuoyu.war and put it in this directory:

  

Now you need to upload it to the cloud server:

episode, if we transfer files from the server to the local SCP [email protected]:/path/filename /var/www/local_dir (local directory)

If we upload locally to the server scp/path/filename [email Protected]:/path
If we download the entire directory from the server scp-r [email protected]:/var/www/remote_dir/(remote directory)/var/www/local_dir (local directory)

If we upload directory to server scp-r local_dir [email protected]:remote_dir

  

Upload success! Let's see if there are any on the server:

  

OK, upload successful, now we start the server! If it starts successfully then it will automatically unzip the Zuoyu.war package:

  

We can see that Tomcat is started and we look at the boot log:

  

Check out the WebApps directory:

  

Very complete, we visit the browser to try:

  

It's perfect!

   don't ask the future, but good!

  

About the Cloud Linux deployment Tomcat Server (MAVEN multi-Module war pack)

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.