Jenkins java project deployment

And background :
Nginx springboard-server: 192.168.10.1
Tomcat application server: 192.168.10.3 port: 10083
Application Name: appXXX

1. Configure forwarding path springboard machine
such as: 192.168.10.1

cd /usr/local/nginx/conf
vi nginx.conf

location /appXXX {
             proxy_pass http://192.168.10.3:10083/appXXX;
             proxy_set_header   Host             $host;
             proxy_set_header   X-Real-IP        $remote_addr;
             proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
        }

Configuring the jump path jenkins

location ^~ /app11/ {
            proxy_pass   http://192.168.10.3:10083/;
            proxy_redirect  off;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        }

2. Configure the tomcat server

2.1 Copy the tomcat package to the target directory, it is recommended to copy the application package has been running

cd /opt/app/
cp -a tomcat appXXX

2.2 modify the server.xml file in the conf directory, shutdown port number and http port number.

2.3 modifications webconfig directory application.properties related jdbc.url, jdbc.username, jdbc.password and so on.

2.4 modify logback.xml.

2.5 Changing the owner of the application package for tomcat: deploy, not to use the root, so that other users of the operating authority is not enough

3. Upload application war package to webApps directory

cd webApps
rz appXXX.war

Tips:
Note that modifying setenv under the tomcat bin bag

Guess you like

Origin www.cnblogs.com/initx/p/11257202.html