Centos 7 编译安装 Nginx-1.17.2

卸载参考

安装

  1. 下载 http://nginx.org/en/download.html

  2. 解压 nginx

[root@bogon nginx-1.17.2]# tar -zxvf nginx-1.17.2.tar.gz
[root@bogon nginx-1.17.2]# cd nginx-1.17.2
  1. configure 生成 Makefile
[root@bogon nginx-1.17.2]# ./configure

  1. 编译
[root@bogon nginx-1.17.2]# make

  1. 安装
[root@bogon nginx-1.17.2]# make install 

  1. 安装完成
#查看nginx版本
[root@bogon nginx-1.17.2]# /usr/local/nginx/sbin/nginx  -v 
#启动:
[root@bogon nginx-1.17.2]# /usr/local/nginx/sbin/nginx
#停止:
[root@bogon nginx-1.17.2]# /usr/local/nginx/sbin/nginx -s stop
#重启:
[root@bogon nginx-1.17.2]# /usr/local/nginx/sbin/nginx -s reload