linux下安装Nginx

网上的操作和自己很多不符合,自己笔记下

版本:

linux 7.5

1.安装Nginx相关的依赖

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

2.下载安装Nginx

wget -c https://nginx.org/download/nginx-1.11.6.tar.gz
tar -zxvf nginx-1.11.6.tar.gz

3.编译及安装

./configure
make install

启动、停止nginx

启动和停止nginx的命令

(1)先进入nginx的目录

cd /usr/local/nginx/sbin/

(2)再执行命令

./nginx 开启
./nginx -s stop 停止
./nginx -s quit
./nginx -s reload

参考:

https://blog.csdn.net/u010246789/article/details/51501710
https://www.jianshu.com/p/3b045336b4b1
http://www.runoob.com/linux/nginx-install-setup.html
https://blog.csdn.net/w410589502/article/details/70787468

你可能感兴趣的:(linux下安装Nginx)