nginx随机启动
程序员文章站
2022-03-15 15:46:31
...
#!/bin/bash # Tengine Startup script# processname: nginx # chkconfig: - 85 15 # description: nginx is a World Wide Web server. It is used to serve # pidfile: /var/run/nginx.pid # config: /usr/local/nginx/conf/nginx.conf nginxd=/usr/local/openresty/nginx/sbin/nginx nginx_config=/usr/local/openresty/nginx/conf/nginx.conf nginx_pid=/usr/local/openresty/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 "tengine 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/local/nginx/logs/nginx.pid } 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反向代理做cache配置
推荐阅读
-
Oracle 11g 安装成功后在Linux开机利用chkconfig自动启动设置
-
PHP随机位置向字符串安插关键字
-
nginx的请求转发和php的header请求跳转原理是一样的吗?
-
nginx配置中location匹配规则详解
-
PHP 随机数 C扩展随机数,phpc扩展随机数_PHP教程
-
nginx--Beginner's Guide
-
Nginx 入门手册 (Beginner’s Guide)
-
Nginx重新编译
-
在Mac OS上编译安装Nginx+PHP+MariaDB开发环境的教程,nginxmariadb_PHP教程
-
mac os nginx php mysql mac os mysql 启动 mac os 10.11 mysql mac os x 安装mysq