下载地址:http://nginx.org/en/download.html
下载最新稳定版本Stable version,目前最新版本为:1.18.0
安装前的检查:检查并安装所需的依赖软件
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
解压编译
[root@leo ~]# tar -zxvf nginx-1.18.0.tar.gz
[root@leo ~]# cd nginx-1.18.0
[root@leo ~]# ./configure
[root@leo ~]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module --with-http_realip_module
常用命令:
重启: [root@leo ~]# ./nginx -s reload
(最好是停止后启动、不要直接用重启)
启动: [root@leo ~]# ./nginx
停止: [root@leo ~]# pkill -9 nginx
关闭进程: [root@leo ~]# nginx -s stop
平滑关闭: [root@leo ~]# nginx -s quit
检测: [root@leo ~]# nginx -t
版本: [root@leo ~]# nginx -V (注意大写)
开机自启动: [root@leo ~]# systemctl enable nginx.service
本文暂时没有评论,来添加一个吧(●'◡'●)