After recording the learning process, Bi set made a small project, but it was not deployed on the server. Now start building the centos8 server environment.
1. Execute the following command to view JDK1.8 version in Yum source.
yum list java-1.8*
2. Execute the following command to install JDK1.8 using yum.
yum -y install java-1.8.0-openjdk*
3. Execute the following command to check whether the installation is successful.
If the version information is shown in the figure below, it indicates that the JDK installation is successful
Install MySQL database
1. Execute the following command to download and install the official Yum source of MySQL
wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm yum -y install mysql57-community-release-el7-10.noarch.rpm yum -y install mysql-community-server
Note that when the third command is executed, it may appear
Unable to find a match: MySQL community server error, as shown in the figure below
In this case, first execute:yum module disable mysql
Re execution:yum -y install mysql-community-server
The following figure shows that the installation is successful
2. Execute the following command to start MySQL database.
service mysqld start
3. Execute the following command to view the initial password of MySQL.
grep 'temporary password' /var/log/mysqld.log
4. Execute the following command to log in to the database.
mysql -uroot -p
5. Execute the following command to modify the password security policy and MySQL default password
set global validate_password_policy=0; ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678';
6. Execute the following command to grant remote management rights to root user.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678'; flush privileges;
7. Enter quit database
Note 1: you can enter the following command to view the status of firewall. If you need to open port 3306, the following are common commands for firewall
Systemctl status firewalld view firewall status Systemctl start firewalld Firewall CMD -- zone = public -- add port = 3306 / TCP -- permanent open a port Firewall CMD -- reload restart Firewall CMD -- zone = public -- List ports to view the opened ports Firewall CMD -- zone = public -- remove port = 3306 / TCP -- persistent to close a port
Note 2: if it is an alicloud server, you need to release port 3306 in the security group.
8. Navcat remote connection test. If the connection fails, please refer to the above precautions.
1. Execute the following command to download the Tomcat package.
2. Execute the following command to unzip the Tomcat package just downloaded.
tar -zxvf apache-tomcat-8.5.59.tar.gz
3. Execute the following command to move Tomcat to the desired directory.
mv apache-tomcat-8.5.59 /usr/local/Tomcat8.5
4. Execute the following command to authorize Tomcat.
chmod +x /usr/local/Tomcat8.5/bin/*.sh
5. Change the default port 8080 of Tomcat to the default port 80 of browser.
sed -i 's/Connector port="8080"/Connector port="80"/' /usr/local/Tomcat8.5/conf/server.xml
6. Start Tomcat.
7. Visit Tomcat.
Open the browser and enter the public IP address of the server. If the following interface appears. Then Tomcat is installed and configured successfully.
So far, the Java Web development environment is completed. (this tutorial refers to Alibaba cloud’s rapid construction of Java Web development environment)