nginx 和 php 启动文件

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


[Unit]
Description=nginx service
After=network.target

[Service]
Type=forking
ExecStart=/bin/nginx
ExecReload=/bin/nginx -s reload
ExecStop=/bin/nginx -s quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target

nginx vim /usr/lib/systemd/system/php-fpm.service


[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target

[Service]
Type=simple
PIDFile=/opt/app/php/php-fpm.pid
EnvironmentFile=php-fpm
ExecStart=php-fpm --nodaemonize --fpm-config /opt/app/php/etc/php-fpm.conf
ExecStop=/bin/pkill php-fpm
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

posted @ 2025-06-24 16:59  六月OvO  阅读(4)  评论(0)    收藏  举报