首页 > 其他 > 详细

systemd配置nginx

时间:2021-06-29 23:18:05      阅读:25      评论:0      收藏:0      [点我收藏+]

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
User=www
Group=www

[Install]
WantedBy=multi-user.target

 

service文件保存到/lib/systemd/system/nginx.service

重载systemd配置文件
systemctl daemon-reload

systemctl status nginx
systemctl start nginx
systemctl stop nginx
systemctl enable nginx

systemctl reload nginx

 

systemd配置nginx

原文:https://www.cnblogs.com/timlong/p/14951734.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!