首页 > 其他 > 详细

CentOS快速安装Nginx的方法,nginx如何启动重启停止

时间:2020-06-19 17:29:41      阅读:69      评论:0      收藏:0      [点我收藏+]

1、防止 make: command not found,提前安装一些插件,取决于当前环境是否已安装,如果已经安装就不需要执行此命令

yum -y install gcc automake autoconf libtool make

防止 make: command not found

2、下载源码进行安装

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

3、安装需要的插件

yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

4、解压压缩包

tar -zxvf nginx-1.18.0.tar.gz

5、指定安装路径

./configure --prefix=/root/nginx/nginx-1.18.0

6、编译并安装

make && make install

7、启动服务(进入到安装目录的sbin)

 ./nginx

8、重启服务(进入到安装目录的sbin)

./nginx -s reload         

9、停止服务(进入到安装目录的sbin)

./nginx -s stop  或者 ./nginx -s quit

CentOS快速安装Nginx的方法,nginx如何启动重启停止

原文:https://www.cnblogs.com/tonyzt/p/13163903.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!