JavaWeb project IDEA + Tomcat + Nginx deployment process

 

Reproduced please indicate the original address: https://www.cnblogs.com/ygj0930/p/11375100.html

 

A: IDEA Maven project package

  1, a packaging modification

  In the project maven pom file, modify packaged way: war.

 

  2, packaged by maven toolbar

  Click on the right side of IDEA, there is a maven sidebar, click to expand his;

  Select the item you want to pack, click to expand: if it is aggregation module developed by the project, select the project where the pom unified package root directory;

  Click LifeCycle:

  1) The first step: Click clean

  2) Step two: Click package

         At this point automatically performs the front of the life cycle, until the package is successful.

  3) The third step: View package results

         If the packaging process fails to compile, unit test failure did not occur, etc., will be successful package. We can project outline on the left, click on the packaging project launched to find the target directory, you can find out of the war we have just packed a bag.

 

  3, into the local tomcat test

  The war package into the directory tomcat webapps, restart tomcat, accessed through a browser.

  You can rename and then deploy war package, so extract from the project name is simple to remember, maven default package out of the project with a version number, etc., is relatively long.

 

Two: to build server

1, the installation JDK

   I'm using centOS7 system, using the yum utility to install: yum will automatically configure the environment at the same time to install, no need to set your own.

  1) Have the inspection system installed jdk

rpm -qa | grep java 

rpm -qa | grep jdk 

rpm -qa | grep gcj

  If no output, then not installed.

  If there is output, you can uninstall using the following command:

rpm -qa | grep java | xargs rpm -e --nodeps 

  Then start the installation JDK1.8.

 

  2) retrieving java1.8 related to the installation list.

yum list java-1.8*

  

  3) Install all the files java1.8.0

yum install java-1.8.0-openjdk* -y

  

  4) Check whether the installation is successful

java -version

  You can view the jdk version and the median is successful.

 

2, install the database

   

3, install tomcat

 

4, uploaded to the server war package

Three: to build a load balancing server

1, install Nginx

 

2. Configure Reverse Proxy

Guess you like

Origin www.cnblogs.com/ygj0930/p/11375100.html