CentOS7 源码安装 Nginx1.16


 源码下载:wget https://nginx.org/download/nginx-1.16.0.tar.gz

解压安装:

[root@mt LAMP]#  tar zxvf nginx-1.16.1.tar.gz

[root@mt nginx-1.16.1]#  ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --h
ttp-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_ssl_module --
with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-pat
h=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --user=nginx --gro
up=nginx

[root@mt nginx-1.16.1]# make && make install


配置Nignx:

[root@mt LAMP]# vim /etc/bashrc  

       PATH=$PATH:/usr/local/nginx/sbin/

[root@mt LAMP]# source /etc/bashrc 


 

Nginx 命令:

[root@mt LAMP]# nginx -V                      # 查看版本

[root@mt LAMP]# nginx                          # 启动

[root@mt LAMP]# nginx -s reload           # 重新加载 nginx 配置文件

[root@mt LAMP]# nginx -s reopen          # 重启

[root@mt LAMP]# nginx -s stop              # 停止

posted on 2020-06-19 20:43  姜兆宝  阅读(188)  评论(0)    收藏  举报