preface
I use:
- Development tool: idea
- jdk: 1.8
- mysql: 5.7.35
- tomcat: 8.0.35
- ssh tool: FinalShell
1, Environment configuration and construction
1. Installation and configuration of JDK
-
download
1) I use the Linux version of tar GZ compressed package, you need to download others by yourself
-
install
1) After downloading, put the compressed package in the specified directory of the server. I put it in the java file of usr here. After that, basically all installations are under usr
2) Decompresstar -zxvf jdk-8u301-linux-x64.tar.gz
-
to configure
1) Similar to windows, configure the environment and find the etc/profile file
2) vim command to open the file, add the following content, and modify it according to your jdk locationexport JAVA_HOME=/usr/java/jdk1.8.0_301 export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar export PATH=$PATH:${JAVA_HOME}/bin
3) Then exit editing and re execute the profile file, source /etc/profile
4) Testingjava -version
2. Mysql installation and configuration
-
download
https://dev.mysql.com/downloads/mysql/5.7.html#downloads
-
install
decompressiontar -zxvf mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz
-
to configure
1) Modify file namemv mysql-5.6.44-linux-glibc2.12-x86_64 mysql
2) Environment configuration, find the etc/profile, vim command, and add the following
export MYSQL_HOME=/usr/mysqld/mysql export PATH=$PATH:$MYSQL_HOME/bin:$MYSQL_HOME/lib
3) Start mysql
service mysqld start
4) Set on self start
chkconfig --list | grep mysqld chkconfig mysqld on
5) Create the root user and set the password
mysqladmin -u root password 'root';
6) Configure permissions and modify passwords
a. Login to mysqlmysql -u root -p
b. Configure the permissions for Database Internet access
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
c. Change password
UPDATE mysql.user SET password=PASSWORD('New password') WHERE User='root';
After modification, execute this command
FLUSH PRIVILEGES;()
7) Stop mysql
service mysqld stop
8) Restart mysql
service mysqld restart
3. Tomcat installation and configuration
-
download
https://tomcat.apache.org/download-80.cgi -
install
1) Decompresstar -zxvf apache-tomcat-8.5.37.tar.gz
2) Modify file name
mv apache-tomcat-8.5.37 tomcat
-
to configure
1) Environment configuration, find the etc/profile, vim command, and add the followingexport CATALINA_HOME=/usr/tomcat export PATH=$PATH:$CATALINA_HOME/bin:$CATALINA_HOME/lib
2) Modify port number
3) Start
Enter the bin directory of the tomcat file./startup.sh
4) Testing
Access the ip + port number to see if the tomcat screen will appear
2, Deployment project
-
to configure
1) Port number modification (use the port number defined by yourself)2) Modify the database in the configuration file, and change the user name and password of Mysql to that of the server mysql
-
Packing note: I use idea development here
I called the war package. If you have different needs, you can go to the POM of the main project XML self modification
-
Deployment project
1) Upload the downloaded war package to the webapps directory under tomcat on the server
2) Stop tomcat from executing in the bin directorymv apache-tomcat-8.5.37 tomcat
3) On tomcat's server Add the startup page specified by the project to the XML
<Context path="" docBase="/usr/tomcat/webapps/war Package name" debug="0" reloadable="true" crossContext="true"/>
4) Start Tomcat/ startup. sh
./startup.sh
4. Test project browser request ip + port