Install Nginx under CentOS7

Operating System: CentOS 7.3 64-bit

1. Download nginx

http://nginx.org/en/download.html

Choose stable version

2. Upload to the /usr/local directory via SSH

3. Unzip tar -xzvf nginx-1.12.0.tar.gz

4. Installation dependencies 

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel  

5、cd /usr/local/nginx-1.12.0  

6、./configure

7、make

8、make install

9. Start, shutdown, stop commands

  1. /usr/local/nginx/sbin/nginx //启动  
  2.     /usr/local/nginx/sbin/nginx -s stop //关闭  
  3.     /usr/local/nginx/sbin/nginx -s reload //重启  

10. Check the startup status  

    ps -ef | grep nginx  

11. Enter the IP in the browser to see if the startup is successful

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325561122&siteId=291194637