Installation preparation

1. Know the directory structure of the server so that you can quickly locate the directory in which the software is installed. If you haven't changed the default login directory, then we are logging into /root, not root directory B. Run CD/to go to the root directory, and run ls to view the folders in the root directoryCopy the code

2. You can create a directory in the root directory to save the downloaded installation package mkdir folder name for example, mkdir soft 3. Yum install GCC -c++ yum install pcre pcre-devel yum install zlib zlib-devel yum install openssl openssl--develCopy the code

The ngniX is installed

# 1. / / CD/soft is 2. The official website to download the latest installation package from http://nginx.org/en/download.htmlCopy the code

[/ soft] # wget - c/https://nginx.org/download/nginx-1.15.8.tar.gz/download the installation package [/ soft] # tar - ZXVF nginx - 1.15.8. Tar. Gz / / uncompress compressed package [/soft]# CD nginx-1.15.8 /usr/local/nginx [/nginx-1.15.8]# make && make install 3 Start the nginx [/ any directory] # / usr/local/nginx/sbin/nginx - c/usr/local/nginx/conf/nginx. Conf / / executes the command to start the 4 can enter any directory. Pause nginx [/ any directory]# killall-9 nginxCopy the code

Modify the nginx configuration file

[/ any directory] # vim/usr/local/nginx/conf/nginx. ConfCopy the code

Configuration file is modified, suspend nginx first, and then restart the/usr/local/nginx/sbin/nginx - c/usr/local/nginx/conf/nginx. ConfCopy the code

Have wrong place, hope message guidance!! Thank you for reading