[Systemctl指令]
router:/lib/systemd/system
file:nginx.service
# Stop dance for nginx
# =======================
#
# ExecStop sends SIGSTOP (graceful stop) to the nginx process.
# If, after 5s (--retry QUIT/5) nginx is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if nginx is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
#
# nginx signals reference doc:
# http://nginx.org/en/docs/control.html
#
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
2、systemctl daemon-reload
3、sysremctl start nginx
4、systemctl enable nginx
[PHP-FPM連接]
1、file:/usr/local/php/etc/php-fpm.conf
listen = /tmp/php-cgi.sock => listen = 127.0.0.1:9000
2、file:/usr/local/php/conf/enable-php.conf
fastcgi_pass unix:/tmp/php-cgi.sock; => fastcgi_pass 127.0.0.1:9000;
3、systemctl restart php-fpm && systemctl restart nginx