CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了centos 7 nginx启动脚本大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

centos7使用systemd代替之前的systemv的启动脚本,可以说更简单。不再需要编写一长段脚本。 复制以下内容到/usr/lib/systemd/system/nginx.service [Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=

centos7使用systemd代替之前的systemv的启动脚本,可以说更简单。不再需要编写一长段脚本。
@H_502_2@


@H_502_2@

复制以下内容到/usr/lib/systemd/system/Nginx.service@H_502_2@

[Unit]
Description=Nginx-highperformancewebserver
Documentation=http://Nginx.org/en/docs/
After=network.targetremote-fs.targetnss-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-sHUP$MAINPID
ExecStop=/bin/kill-sQUIT$MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

即可使用systemctl start|stop|reload|restart Nginx 进行启动重启等操作。@H_502_2@

systemctl enable Nginx即可实现开机启动。@H_502_2@

systemctl disable Nginx取消开机启动。@H_502_2@

大佬总结

以上是大佬教程为你收集整理的centos 7 nginx启动脚本全部内容,希望文章能够帮你解决centos 7 nginx启动脚本所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: