Complete project learning-10 project release is to complete the deployment in linux system

1. Deploy JDK

1.1 upload JDK

1.2 decompress the compressed package

   tar -xvf jdk-8u51-linux-x64.tar.gz

1.3 deleting installation files

[root@localhost src]# rm -f jdk-8u51-linux-x64.tar.gz

1.4 modify JDK name

	mv jdk1.8.0_51 jdk1.8 

1.5 check whether JDK is valid

1.6 JDK environment variable configuration

Command:

vim   /etc/profile

Configuration information:

#Set jdk environment
export JAVA_HOME=/usr/local/src/jdk1.8
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib

Supplementary knowledge
The browser automatically converts http to https

Set security policy

After the modification, you need to empty the browser cache and restart. ctrl + shift + delete

2. Linux project deployment

2.1 project construction process

2.2 Linux Installation Mariadb database

Database installation

2.3 backend project release

2.3.1 back end item modification

  1. Modify the user name and password of the database
  2. Modify file upload path

2.3.2 backend project packaging

2.3.3 uploading jar package files

2.3.4 Release Project

    java -jar 8091.jar

2.3.5 project test

2.4 jar package file project startup error description


Check the main method to see whether it is the method of the main startup class

2.5 description of Linux Process items

2.5.1 query process

  1. jps retrieving java service items
  2. Retrieve any service
 	ps -ef | grep mysql

2.5.2 kill process

Close current thread: ctrl + c
Kill process:

  1. kill PID ordinary kill
  2. kill -15 PID harder kill
  3. kill -9 PID forced kill

2.6 project background release

2.6.1 Front Office release test

Note: start the project through java -jar xxx.jar. The project is bound with the started terminal. If the terminal is closed, the project will also be closed

2.6.2 background Publishing

Effect: after closing the terminal, the service will not be affected

	 nohup java -jar 8091.jar => 8091.log &
	 nohup java -jar 8092.jar => 8092.log &

3. Install Nginx server

3.1 download Linux version Nginx

3.2 upload to the specified directory

3.3 unzip / delete / rename

  1. Decompression command
	tar -xvf nginx-1.21.4.tar.gz
  1. Delete file / modify name

3.4 installation steps of nginx

nginx development language: C language

3.4.1 configuration and installation files

3.4.2 installation nginx

1). make
2). make install

3.5 project release before / after nginx implementation

Nginx installation and use

3.6 path description

  1. Static resource file dist /usr/local/nginx/dist
  2. nginx.conf /usr/local/nginx/config/nginx.conf
  3. Nginx startup project path / usr/local/nginx/sbin/
  4. tomcats publishing path / usr/local/src/tomcats

3.7 error prone items

  1. Failed to query the table. It may be due to the case of table letters
  2. Database link address: root/root 3306 port
  3. There should be no extra spaces in the image.properties configuration file
  4. nginx configuration information:
#Configure picture proxy
	server {
		listen 80;
		server_name image.jt.com;
		location / {
			root /usr/local/src/images;
		}
	}

	#2. Configure tomcat server cluster
	#2.1 local IP access 127.0.0.1:8091
	#2.2 remote access 192.168.126.129:8091
	upstream tomcats {
		server 192.168.126.129:8091;
		server 192.168.126.129:8092;
	}
	#Implement backend server proxy
	server {
		listen 80;
		server_name manage.jt.com;
		location / {
			proxy_pass http://tomcats;
		}
	}

	#Front end server proxy
	server {
		listen 80;
		server_name www.jt.com;
		location / {
			root dist;
			index index.html;
		}
	}

3.8 log viewing

cat outputs all the contents of the file
more output all the contents of the document, page output, space browse to the next screen, q exit
The usage of less is the same as that of more, but it is controlled by PgUp and PgOn keys
tail is used to display the last number of the file, which is frequently used
tail -10 nginx.conf view the last 10 lines of nginx.conf
tail – f nginx.conf dynamically view the log to facilitate viewing the new information in the log
ctrl+c ends viewing

Tags: SSM Project management

Posted on Thu, 18 Nov 2021 06:04:51 -0500 by AwptiK