Linux Server Tomcat launches MAVEN project

Source: Internet
Author: User

The local idea wrote a simple Maven project that showed only one page. Then push the project git to the server.

After the server git pull fetch (clone is needed for the first time), the following is the way to package the project after compiling:

Premise (server environment to be set up (Java, MAVEN, Tomcat, git details see previous blog))

1. Cloning the project to the server

/srv/www/wizzie/

2. Project packing and compiling

  MVN Clean Package Install

Package path to maven warehouse path/root/.m2/respobility/..../version folder/. War file

3. Move the war packet to the configured Tomcat project release path

MV War package current path target path

When you are finished, view the catalog file:

Three path locations for general Tomcat:

  Typically under the/usr/share/tomcat8/webapps/path

If you want to modify the project path, modify it in/usr/tomcat8/server.xml, open server.xml and add it to the final host tag.

<context path= "/srv/www/" (custom project path) docbase= "photo" debug= "0" reloadable= "true"/>

4. Restart Tomcat after the Tomcat/bin directory (run two commands directly in the directory)

5. When you close Tomcat, you will encounter many problems:

At this point, you can view the log for detailed errors to resolve the issue:

 Cat log log: View detailed errors after

6, after the browser input:

http://www.wizzie.top:8080/sunblog-1.0-snapshot/

7, the discovery of such input domain name into the site is very troublesome

You need to modify the port at this time, modify the port to 80 in the Tomcat profile Server.xml to map directly to the extranet IP without adding 8080 ports

8. Viewing effects

Linux Server Tomcat launches MAVEN project

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.