Nginx Installation and Configuration Guide

A, Nginx Profile

   Nginx is a high-performance HTTP server and reverse proxy web server, but also provides IMAP / POP3 / SMTP services. Nginx is Rambler.ru Russia visited the second site developed by Igor Saisuoyefu is.
   Nginx is a lightweight Web server / reverse proxy server and e-mail (IMAP / POP3) proxy server, distributed under BSD-like agreement. It features occupy less memory, high concurrency, concurrent nginx fact the same type of ability in web server performance is better, mainland China use nginx web site users are: Baidu, Jingdong, Sina, Netease, Tencent, Taobao.

Second, the installation step

1. Download Nginx

Official website address: http://nginx.org/
Here Insert Picture Description
version of their choice, the best selection of stable version.

wget http://nginx.org/download/nginx-1.14.2.tar.gz

2, mounted reliance Nginx

yum install -y gcc-gcc++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

Here Insert Picture Description

3, a packet extracting Nginx

tar xf nginx-1.14.2.tar.gz

4, Configuration

./configure --prefix=/usr/local/nginx

Here Insert Picture Description
If you encounter an error "./configure: error: C compiler cc is not found", as shown below
Here Insert Picture Description
solution:

yum -y install gcc gcc-c++ autoconf automake make

5, compile and install

make & make install -j 4

Here Insert Picture Description

6, start nginx

cd /usr/local/nginx
./sbin/nginx

7, view the Startup status

ps -ef|grep nginx

Here Insert Picture Description
Browser to visit:
Here Insert Picture Description
Other commonly used commands:

./nginx -s stop     #停止
./nginx -s quit     #退出
./nginx -s reload   #重新加载
He published 198 original articles · won praise 1174 · Views 1.34 million +

Guess you like

Origin blog.csdn.net/sinat_27933301/article/details/104958330