nginx快捷安装

2019-11-04  本文已影响0人  指尖架构141319

1.下载

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

2.解压

tar -zvxf nginx-1.13.6.tar.gz

3.配置路径

进入nginx安装目录执行下面指令:

./configure --prefix=/usr/local/nginx

如果报错:
./configure: error: the HTTP rewrite module requires the PCRE library.
执行:
yum -y install pcre-devel
如果还报错:
./configure: error: the HTTP cache module requires
执行:
yum -y install openssl openssl-devel

4.执行make安装

make
make install

5.启动

/usr/nginx/sbin/nginx

6.停止

杀进程

7.平滑启动

/usr/nginx/sbin/nginx -s reload

8.重启配置文件conf

cd /usr/local/nginx/sbin/ ./nginx -c conf/nginx.conf
上一篇下一篇

猜你喜欢

热点阅读