Setup method for deployment project under Linux system

  • 2020-12-09 01:25:23
  • OfStack

1. Modify the firewall Settings and open the corresponding ports

To modify the Linux system firewall configuration, you need to modify the file /etc/sysconfig/iptables. If you want to open the port, add one to it

A ES10en-1-ES12en-ES13en state --state ES16en-ES19en tcp --dport 8080-ACCEPT, which is the port number you want to open, and then restart the firewall service for linux

2. Install jdk

1. Check jdk version in the system under 1


[root@localhost software]# java -version 

2. Test the jdk installation package


[root@localhost software]# rpm -qa | grep java 

Display:

[

java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64 python-javapackages-3.4.1-11.el7.noarch tzdata-java-2016g-2.el7.noarch javapackages-tools-3.4.1-11.el7.noarch java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64 java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64

]

3. Uninstall openjdk


[root@localhost software]# rpm -e --nodeps tzdata-java-2016g-2.el7.noarch
[root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64
[root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
[root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
[root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64

Or use


[root@localhost jvm]# yum remove *openjdk*

And then I'll type it in again rpm -qa | grep java Check the unloading situation:


[root@localhost software]# rpm -qa | grep java python-javapackages-3.4.1-11.el7.noarch javapackages-tools-3.4.1-11.el7.noarch

4. Install new jdk

First go to the jdk official website to download the version of jdk you want. After downloading, put the jdk installation package you need to install into the folder specified by the Linux system and command to enter the folder

Unzip the ES65en-8u131-ES67en-x64. tar.gz installation package


[root@localhost software]# mkdir -p /usr/lib/jvm
[root@localhost software]# tar -zxvf jdk-8u131-linux-x64.tar.gz -C /usr/lib/jvm 

5. Set environment variables


[root@localhost software]# vim /etc/profile

At the front, add:


export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_131 
export JRE_HOME=${JAVA_HOME}/jre 
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib 
export PATH=${JAVA_HOME}/bin:$PATH

6. Execute profile file


[root@localhost software]# source /etc/profile

This allows the configuration to take effect immediately without restarting.

7. Check the newly installed jdk

3. Install tomcat

4. Install mysql

1. If it has been installed before, uninstall it first

2. Enter the yum list | grep mysql command to view the downloadable version of the mysql database available on yum

3.yum install -y mysql-server mysql mysql-devel

yum will help us select the software we need to install the mysql database as well as the additional 1 software

4. Start mysql, service mysqld start

Log in mysql and set the password as follows:


mysql> use mysql;
mysql> update user set password=password('123') where user='root' and host='localhost';
mysql> flush privileges; 

5. Set mysql to allow remote connections


[root@localhost software]# rpm -qa | grep java 
0

6. Open ports

7. Start mysql service, ES130en-ES131en username -p password

5. Package the project under tomcat, configure other required environments, and start tomcat

conclusion


Related articles: