nginx设置nginx.service文件
###nginx.service ## 快速关闭 ##nginx -s stop ##// 优雅关闭 ##nginx -s quit cat /lib/systemd/system/nginx.service [Unit] Description=nginx - high performance web server After=network.target remote-fs.target nss-lookup.target [Service] Type=forking ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s quit [Install] WantedBy=multi-user.target chmod 755 /lib/systemd/system/nginx.service ###使配置生效 systemctl daemon-reload ###设置开机启动 systemctl enable nginx.service ###nginx 操作指令 systemctl start nginx.service systemctl stop nginx.service systemctl reload nginx.service systemctl restart nginx.service systemctl status nginx.service
请登录之后再进行评论