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


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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM