1. 程式人生 > >Centos7 nginx啟動腳本

Centos7 nginx啟動腳本

centos7 user work sbin targe all true ins gin

vim /usr/lib/systemd/system/nginx.service

[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/nginx/sbin/nginx -c /usr/local/bin/nginx/conf/nginx.conf
ExecReload=/usr/local/bin/nginx/sbin/nginx -s reload
ExecStop=/usr/local/bin/nginx/sbin/nginx -s stop
Restart=always
RestartSec=30
PrivateTmp=true

[Install]
WantedBy=multi-user.target
#systemctl enable nginx.service
#systemctl start nginx.service

Centos7 nginx啟動腳本