#chkconfig: 345 60 60 #!/bin/bash # nginx Startup script for the Nginx HTTP Server # it is v.0.0.2 version. # chkconfig: - 85 15 # description: Nginx is a high-performance web and proxy server. # It has a lot of features, but it's not for everyone. # processname: nginx # pidfile: /var/run/nginx.pid # config: /usr/nginx/conf/nginx.conf nginxd=/usr/nginx/sbin/nginx nginx_config=/usr/nginx/conf/nginx.conf nginx_pid=/usr/nginx/logs/nginx.pid RETVAL=0 prog="nginx" # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x $nginxd ] || exit 0 # Start nginx daemons functions. start() { if [ -e $nginx_pid ];then echo "nginx already running...." exit 1 fi echo -n $"Starting $prog: " daemon $nginxd -c ${nginx_config} RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx return $RETVAL } # Stop nginx daemons functions. stop() { echo -n $"Stopping $prog: " killproc $nginxd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /usr/nginx/logs/nginx.pid } # reload nginx service functions. reload() { echo -n $"Reloading $prog: " #kill -HUP `cat ${nginx_pid}` killproc $nginxd -HUP RETVAL=$? echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) stop start ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|reload|status|help}" exit 1 esac exit $RETVAL
相关推荐
nginx开机启动脚本
windows启动nginx脚本
Nginx开启自启文件,在/etc/init.d 目录下创建一个新的nginx文件后将内容复制进去。(不建议将文件直接复制到/etc/init.d 目录下,以免引起windows和linux环境下格式转换的不必要麻烦)
nginx配置修改后运行此脚本启动nginx。 其脚本的作用往往是简化了启动的便利
nginx启动脚本
# nginx Startup script for nginx # # chkconfig: - 85 15 # processname: nginx # config: /etc/nginx/nginx.conf # config: /etc/sysconfig/nginx # pidfile: /var/run/nginx.pid # description: nginx is a ...
解决Nginx启动脚本在redhat上无法启动的问题
CentOS 8 开机启动Nginx脚本
http://blog.csdn.net/yaoxun1990/article/details/49590831 对应部署教程地址
Nginx启动或重启失败,一般是因为配置文件出错了,我们可以使用nginx -t方法查看配置文件出错的地方。 也可以通过查看Nginx日志文件定位到Nginx重启失败的原因,Nginx日志文件的路径一般在:/var/log/nginx目录下 ...
nginx启动脚本,下载后可以直接上传使用
window下Nginx启动bat脚本若中文乱码,则新建脚本文件时改为ANSI编码格式即可 稳定版:nginx-1.15.12:https://download.csdn.net/download/luxiukang/11171445 最新版:nginx-1.16.0:...
这里给大家介绍一个很好用的nginx启动脚本。以及简单的使用,如下: 1. 执行如下命令: vim /etc/init.d/nginxd 2.输入如下内容: 注意:该文件中的如下几个变量,都需要根据你实际的目录来改写。 nginx=/usr/...
windows+nginx+php带启动/停止脚本 ,需要自己修改压缩包里的start.bat,stop.bat 和nginx.conf文件内的路径设置成你自己的就OK了。
本nginx资源,是nginx完成后,为了启动停止等操作方便,写的shell脚本,大家有需要,可以下载使用,不用积分的
该资源包括Linux系统nginx安装包,docker安装包,jdk的安装包以及docker容器的nginx启动脚本,可用于前端jar包部署,只需把前端包放在nginx/www/html目录下,启动nginx脚本即可,拥有搭建redis+sentinel集群的文件以及...
下载后放在目录:/etc/init.d 赋予nginx 启动权限即可 service start | restart | stop nginx
NULL 博文链接:https://yunlong167167.iteye.com/blog/2373286
一键安装mysql,redis,nginx,rabbitmq中间件服务,也可以单独安装某一个中间件服务,只需要执行脚本即可,方便快捷
Nginx 启动脚本 重启脚本,学习使用centos配置服务器的朋友可以参考下。