1.安装所需依赖

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

2.官网复制链接 用wget 下载到 /usr/local/ 目录下

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

3.解压缩

tar -zxvf nginx-1.14.2.tar.gz 

4.检查配置

[root@localhost local]# cd nginx-1.14.2/

[root@localhost nginx-1.14.2]# ./configure --prefix=/usr/local/nginx

5.编译安装

make &&make install

6.进入目录查看
Image-001.png

7.命令

启动命令: /usr/local/nginx/sbin/nginx

停止命令: /usr/local/nginx/sbin/nginx -s stop

重启命令:/usr/local/nginx/sbin/nginx -s reload

Last modification:July 27th, 2020 at 05:22 pm
If you think my article is useful to you, please feel free to appreciate