The premise

  • The server has been purchased
  • XFTP, xshell has been used to connect to the server

Ali cloud set up security group, open port

Install jdk8

  • Uninstall the OpenJDK provided by CentOS and run commands to query the OpenJDK information
rpm -qa | grep jdk
Copy the code
  • uninstall
RPM -e --nodeps java-1.8.0-openJDK-1.8.0.65-3.b17.el7.x86_64 RPM -e --nodeps X86_64 RPM -e --nodeps java-1.7.0-openJDK-1.7.0.91-2.6.2.3.el7.x86_64 RPM - e -- nodeps Java - 1.7.0 - its - headless - 1.7.0.91-2.6.2.3. El7. X86_64Copy the code
  • Check whether the deletion is successful
  • Create a Java folder in /usr/local and go to
cd /usr/local
mkdir java
cd java
Copy the code
  • Use XFTP to upload the JDK to a Java directory

Jdk8 Linux version

Link: pan.baidu.com/s/1dd5_Zqfk… Extract code: 9BHJ Copy this section of content after opening Baidu web disk mobile App, more convenient operation oh

  • Install using commands
rpm -ivh jdk-8u221-linux-x64.rpm
Copy the code
  • Configuring environment Variables
vim /etc/profile
Copy the code

Press I to copy the following information

JAVA_HOME = / usr/Java/jdk1.8.0 _221 - amd64 CLASSPATH = % JAVA_HOME % / lib: % JAVA_HOME % / jre/lib PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin export PATH CLASSPATH JAVA_HOMECopy the code

Press Esc to exit and enter :wq! Press Enter to exit and save.

  • Make the configuration work
source /etc/profile
Copy the code
  • Check whether the installation is successful
java -version
Copy the code

Install tomcat

  • Create a tomcat folder in /usr/loca and go to
cd /usr/local
mkdir tomcat
cd tomcat
Copy the code
  • Use XFTP to pass the Tomcat zip file into the Tomcat directory

tomcat:

Link: pan.baidu.com/s/1tqcAYjUt… Extract code: F06V copy this section of content after opening Baidu web disk mobile App, more convenient operation oh

  • unzip
Tar ZXVF - apache tomcat - 9.0.34. Tar. GzCopy the code
  • Go to the /usr/local/tomcat/apache-tomcat-9.0.34/bin directory to start tomcat
./startup.sh
Copy the code
  • To shut down tomcat
./shutdown.sh
Copy the code
  • Checking the Firewall Status
firewall-cmd --state
Copy the code

Runing: enable, not runing: disable. If not, run the command

systemctl restart firewalld.service
Copy the code
  • Enable port 8080
firewall-cmd --zone=public --add-port=8080/tcp --permanent
Copy the code
  • Restarting the Firewall
systemctl restart firewalld.service
Copy the code
  • Reload configuration
firewall-cmd --reload
Copy the code
  • Success is as follows

Install mysql 5.7

If there was a first uninstall

  • Check the running status of the mysql service and stop it
service mysql status

service mysql stop
Copy the code
  • Example Check whether the system has a mysql file
rpm -qa | grep -i mysql
Copy the code
  • If the value queried in the previous step is not empty, the value is uninstalled

    If the RPM -ev command cannot be uninstalled due to dependencies, add –nodeps to the command to indicate that dependencies between services are not checked during uninstallation.

rpm -ev mysql-community-libs-5.734.-1.el7.x86_64 --nodeps
Copy the code

  • Check the mysql file
find / -name mysql
Copy the code
  • Use all the files we findrm -rfDelete all commands.
rm -rf /var/lib/mysql
Copy the code

  • Deleted after use RPM – qa again | grep -i mysql and find / -name mysql checked, if empty, uninstall the success.

  • If you are using mysql for the first time, you may want to remove the built-in Mariadb

  • First check for Mariadb

rpm -qa | grep mariadb
Copy the code
  • Delete RPM -e (mariadb)
The RPM -e mariadb - libs - 5.5.44-2. El7. Centos. X86_64 -- nodepsCopy the code

The formal installation

  • First of all to mirror.tuna.tsinghua.edu.cn/mysql/downl… 5.7, search for mysql-5.7.31-1.el7.x86_64. RPM -bundle.tar and download it to the local directory.

  • Create mysql directory in usr/local
cd /usr/local
mkdir mysql
Copy the code
  • Run XFTP to upload the compressed package to /usr/local/mysql
  • Unpack the
Tar XVF mysql - 5.7.31-1. El7. X86_64. RPM - bundle. The tarCopy the code
  • Then, in the current mysql installation directory common, libs, client and server four packages
RPM -ivh mysql-community-common-5.7.31-1.el7.x86_64. RPM --nodeps --force RPM -ivh RPM --nodeps --force RPM -ivh mysql-community-client-5.7.31-1.el7.x86_64. RPM --nodeps --force RPM -ivh mysql-community-server-5.7.31-1.el7.x86_64. RPM --nodeps --force RPM -ivh mysql-community-server-5.7.31-1.el7.x86_64Copy the code

Note: this should not be pasted mindfully, depending on the version of each package you extract, it should correspond to the version in the code above.

  • Initialized mysql
mysqld --initialize
Copy the code
  • Authorized firewall
chown mysql:mysql /var/lib/mysql -R;
systemctl start mysqld.service;
systemctl enable mysqld;
Copy the code
  • View the database initialization password
cat /var/log/mysqld.log | grep password
Copy the code
  • Logging In to the Database
Mysql -uroot -p mysql -uroot -pCopy the code
  • Change the password
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Copy the code
  • Log out and use the new password
quit

mysql -uroot -proot
Copy the code

  • Enabling Remote Access
create user 'root'@'%' identified with mysql_native_password by 'root';
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;
Copy the code

  • CentOS open port 3306
firewall-cmd --zone=public --add-port=3306/tcp --permanent
systemctl restart firewalld.service
firewall-cmd --reload
Copy the code

  • Change the default time zone (enter mysql)
set global time_zone='+8:00';
Copy the code

Use SQLyog to connect remotely

Importing SQL Scripts

  • Start by creating database TMALL_SSM
  • Import the script using SQlyog

Use Maven to package projects into war packages

Move the project WAR package under Tomcat’s WebApp

Tomcat automatically decompresses the project

Restart Tomcat!

Check the Tomcat status using Tomcat logs

Results:

Project Address:

Background: coderchen.com.cn:8080/tmall_ssm/a…

Front desk: coderchen.com.cn:8080/tmall_ssm/f…

The source code

Link: pan.baidu.com/s/11Sr8eiN_… Extract code: OZXD copy this section of content to open Baidu network disk mobile App, more convenient operation oh

Refer to the article

The SSM project is deployed to Ali Cloud server. It only takes five steps.

Blog.csdn.net/qq_43084651…