Because the project needs to apply for a new server, it is necessary to reconfigure the environment.
nginx installation:
- One click installation of four dependencies:
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
- Enter / usr/local/src directory and create nginx folder
cd /usr/local/src mkdir nginx
- Enter the nginx directory you just created and download the nginx tar package
cd nginx wget https://nginx.org/download/nginx-1.17.9.tar.gz
Unexpectedly, my prompt [error: Certificate common name "*. nginx.com" does not match the required host name "nginx. Org". To connect to nginx.org in an insecure way, use '- no check certificate'.
Modify download commandwget --no-check-certificate https://nginx.org/download/nginx-1.17.9.tar.gz
-
decompression
tar -zxvf nginx-1.17.9.tar.gz
-
Enter the directory generated by decompression for configuration
cd nginx-1.17.9 ./configure
-
Compilation and installation
make make install
-
Find installation path
whereis nginx
-
nginx.conf partial configuration
#Configure the maximum number of open files for Nginx worker process worker_rlimit_nofile 65535; events { #Maximum number of client connections allowed for a single process worker_connections 8192; } #Log log configuration access_log /opt/nginx-logs/access.log main; error_log /opt/nginx-logs/error.log ; #Set load balancing background server list upstream wxsd1.unisk.cnxx { ip_hash; server 127.0.0.1:8081 max_fails=3 fail_timeout=5s; #server 127.0.0.1:8082 max_fails=3 fail_timeout=5s; server 127.0.0.1:8083 max_fails=3 fail_timeout=5s; server 127.0.0.1:8084 max_fails=3 fail_timeout=5s; #server 127.0.0.1:8085 max_fails=3 fail_timeout=5s; }
jdk installation:
- Check whether the jdk that comes with linux is installed
java -version
You can see it's OpenJDK
- View jdk installation package
rpm -qa | grep java
- Uninstall OpenJDK
yum remove *openjdk
- Install Oracle JDK
Download address: https://www.oracle.com/java/technologies/javase-downloads.html
In the / usr/local directory, create the java installation directorycd /usr/local mkdir java
Use xftp to upload the downloaded jdk-8u231-linux-x64.tar.gz file to this directory
- decompression
tar -zxvf jdk-8u231-linux-x64.tar.gz
Because the previous project uses jdk1.7, download and install jdk1.7 in the same way
Configure environment variables
- Configure jdk to / etc/profile to access jdk in any directory
vim /etc/profile
Press i to enter editing, and add the following content at the end of profile file:
export JAVA_HOME=/usr/local/java/jdk1.7.0_80 #jdk installation directory export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin export PATH=$PATH:${JAVA_PATH}
Save and exit editing, ESC -- >: WQ
- Execute profile file (read and execute commands in profile in current bash environment)
source /etc/profile
- Test whether the installation is successful
java -version javac
redis installation:
- Enter / usr/local/src directory and create redis folder
cd /usr/local/src mkdir redis
- Install redis
Visit download address: https://redis.io/download
Upload the downloaded redis-5.0.8.tar.gz to the new redis folder through the remote management tool - decompression
tar -zxvf redis-5.0.8.tar.gz
- Enter the directory of the generated files and perform make compilation
cd redis-5.0.8 make
- Perform the make install installation (the software can specify the installation directory)
make PREFIX=/usr/local/redis install
- redis start and stop commands:
#Enter the / usr/local/redis/bin directory and execute the redis server script file ./redis-server #Turn off redis services pkill redis-server #Set redis to run in the background, modify the redis.conf configuration file, and set the daemonize option from no to yes
Knock off.