nginx源码安装,下载地址:
http://nginx.org/download/nginx-1.14.0.tar.gz
源码放置路径:
/usr/local/nginx/src
默认安装模块,指定安装目录
./configure --prefix=/usr/local/nginx
依赖PCRE zlib等库
make && make install
1、nginxServer.sh 启动脚本
sh nginxServer.sh start|stop|restart|reload
2、nginx开机自启动 (systemd)
1)、编辑nginx.service, 路径:/lib/systemd/system/nginx.service
2)、建立软链接,ln -s /lib/systemd/system/nginx.service /etc/systemd/system/multi-user.target.wants/nginx.service
路径:/etc/systemd/system/multi-user.target.wants/nginx.service
3)、systemctl daemon-reload
4)、systemctl enable nginx.service (开机启动)