Prerequisite: Select CentOs8 for this Linux distribution
Configure MySQL:
-
Open a terminal and log in to the system as the root user.
-
Use the following command to install the MySQL software source configuration package:
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
-
Install MySQL server:
sudo yum install mysql-server
-
Start the MySQL service and set it to start automatically at boot:
systemctl start mysqld sudo systemctl enable mysqld
-
Check MySQL running status:
systemctl status mysqld
-
Enter MySQL:
mysql
-
Change password: (This is a MySQL statement)
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';
-
Re-enter MySQL:
mysql -uroot -p
-
Configure remote login: (for learning purposes only)
# Set up root remote login for the first time and configure the remote password using the following SQL command
CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';
A password needs to be: more than 8 characters, with uppercase letters, special symbols, and cannot be a continuous simple statement such as 123, abc
# Use the following SQL command to modify the password later< /span>
ALTER USER 'root' @'%’IDENTIFIED WITH mysql_native_password BY '密码';
10.Authorization permissions:
GRANT ALL PRIVILEGES ON ProDB.* TO 'root'@'%';
Configure JDK:
1. Download jdk: Go to the official website to download, use jdk8 here
2. Upload to Linux cloud server: Upload to the /export/server directory here
3. Unzip:
tar -zxvf jdk-8u181-linux-x64.tar.gz
4. Configure the soft link of jdk:
ln -s /export/server/jdk1.8.0_351 /export/server/jdk
5. Configure Java environment variables and add them to path:
#编辑/etc/profile文件:
vim /etc/profile
#在文件末尾加入:
export JAVA_HOME=/export/server/jdk
export PATH=$PATH:$JAVA_HOME/bin
6. Validate environment variables:
source /etc/profile
Configure Tomcat:
1. Create a new user to operate tomcat:
#创建tomcat用户
useradd tomcat
#切换tomcat用户
su - tomcat
2. Download tomcat:
wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.0.27/bin/apache-tomcat-10.0.27.tar.gz
3. Unzip: (here still decompress to /export/server)
4. Configure soft links:
ln -s /export/server/apache-tomcat-8.5.95 /export/server/tomcat
5.Grant tomcat user permissions:
chown -R tomcat:tomcat tomcat
chown -R tomcat:tomcat apache-tomcat-8.5.95
6. Start tomcat:
#切换到tomcat/bin目录:
cd /export/server/tomcat/bin
#启动tomcat:
./startup.sh
7. Check whether the port is open:
netstat -anp | grep 8080
Configure Redis:
For CentOS 7.6:
1. Open the terminal and log in to the server as the root user or a user with sudo permissions.
2. Install the necessary dependent software packages. Run the following command to install the required dependency packages:
sudo yum install epel-release sudo yum install make gcc tcl git wget
3. Download the Redis source code. Use the wget command to download the stable version source code of Redis:
wget http://download.redis.io/releases/redis-5.0.13.tar.gz
4. Unzip the source code. Execute the following command to decompress the Redis source code:
tar xzf redis-5.0.13.tar.gz
5. Enter the Redis source code directory. Execute the following command to enter the Redis source code directory:
cd redis-5.0.13
6. Modify the src/server.h file. Open the server.h file using a text editor (such as vi or nano) and add the following line before line 1045:
#define __STDC_LIMIT_MACROS
Save and close the file after modifications.
7. Compile Redis. Execute the following command to compile Redis:
make
8. Install Redis. Execute the following command to install Redis:
sudo make install
9. After completing the installation, you can use the following command to start the Redis service:
sudo systemctl start redis
10. If you need to configure Redis to start automatically as a system service, please execute the following command:
sudo systemctl enable redis
Now, Redis is successfully installed and running on the server. You can test whether Redis is working properly by executing the following command:
redis-cli ping
If "PONG" is returned, it means that Redis has run successfully.