Linux下安装nginx

1.检查和安装依赖包

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


2.编译和安装

make&&make install


3.检查配置文件正确性

/usr/local/nginx/sbin/nginx -t


4.启动nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf


5.重启nginx

/usr/local/nginx/sbin/nginx -s  reload


6.查看nginx版本号
/usr/local/nginx/sbin/nginx  -v
原文地址:https://www.cnblogs.com/xialiaoliao0911/p/7524036.html