编译nginx使用systemctl 开启关闭脚本

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/apps/nginx/logs/nginx.pid 
ExecStart=/apps/nginx/sbin/nginx -c /apps/nginx/conf/nginx.conf
ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)"
ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"

[Install]
WantedBy=multi-user.targe
PIDFile=/apps/nginx/logs/nginx.pid  来自于/apps/nginx/conf/nginx.conf ,nginx配置中写的pid路径是什么这里就写什么
 

编译nginx使用systemctl 开启关闭脚本

上一篇:VUE-图片缓存解决


下一篇:部署项目时遇到的问题---IIS7.X配置ASP.NET MVC4