1. Install
1. Install wget, nginx for downloading the installation package (installed negligible)
cd /
yum install wget -y
2. Install gcc
yum install gcc-c++
Because since Nginx and gcc compiler environment, so the mini centos need to install the build environment to enable them to compile Nginx
3. Install pcre
yum -y install pcre pcre-devel
Nginx's http module requires pcre regular expressions to parse
4. Installzlib
yum -y install zlib zlib-devel
Dependent extracting archive
5. Installation openssl
yum install -y openssl openssl-devel
6. Download nginx
wget http://nginx.org/download/nginx-1.13.11.tar.gz
wget behind the self-address in nginx own official website to find the right system version Download
This step may also correspond to a browser to download again nginx cp or scp to the linux / opt / nginx directory (directory nginx self-created)
7. decompression nginx
cd /opt/nginx tar zxvf nginx-1.13.11.tar.gz
8. Install
先切换到opt目录下,新建文件夹nginx-1-13
cd /opt midir nginx-1-13
Enter /opt/nginx/nginx-1.13.11
cd /opt/nginx/nginx-1.13.11
Specify the installation directory
./configure --prefix=/opt/nginx-1-13
Compile
make
installation
make install
9. Start
Into the / opt / nginx-1-13 / sbin and start
cd /opt/nginx-1-13/sbin ./nginx
10.nginx some relevant command
./nginx // start ./nginx -s STOP // stop ./nginx -s quit // This step is a way to stop the process of processing tasks to be completed nginx be stopped. -sreload ./nginx // restart
11. Some Frequently Asked Questions
1. Check the relevant port number is open
2.nginx.conf profile user xxx must be consistent and start-user permission issues reported otherwise inaccessible