#!/bin/bash
#nx Startup script for the Nginx HTTP Server # it is v.0.0. version. # chkconfig: - # 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/local/nginx/conf/nginx.conf nginxd=/usr/local/nginx/sbin/nginx nginx_config=/usr/local/nginx/conf/nginx.conf nginx_pid=/var/run/nginx.pid RETVAL= 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 [ -x $nginxd ] || exit # Start nginx daemons functions. start() { if [ -e $nginx_pid ];then echo "nginx already running...." exit fi echo -n $"Starting $prog: " daemon $nginxd -c ${nginx_config} RETVAL=$? echo [ $RETVAL = ] && touch /var/lock/subsys/nginx return $RETVAL } # Stop nginx daemons functions. stop() { echo -n $"Stopping $prog: " killproc $nginxd RETVAL=$? echo [ $RETVAL = ] && rm -f /var/lock/subsys/nginx /var/run/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 esac exit $RETVAL

nginx-nginx脚本的更多相关文章

  1. linux nginx 启动脚本

    linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the ...

  2. Nginx+Keepalived(带Nginx监控脚本)

    转载于:http://www.itxuexiwang.com/a/liunxjishu/2016/0220/151.html?1456381460 Keepalived+ nginx的安装部署 主机: ...

  3. Nginx 启动脚本/重启脚本

    第一步先运行命令关闭nginx sudo kill `cat /usr/local/nginx/logs/nginx.pid` 第二步 vi /etc/init.d/nginx 输入以下内容 #!/b ...

  4. 在centos中创建nginx启动脚本

    1. 建立脚本文件nginxd [root@could]# vi /etc/init.d/nginxd 插入以下内容 #!/bin/bash## chkconfig: - 85 15# descrip ...

  5. nginx启动脚本,手动编辑

    nginx启动脚本,手动编辑 #! /bin/bash # chkconfig: - # description: nginx service XDIR=/www/server/nginx DESC= ...

  6. 利用系统函数模拟实现nginx 系统脚本启动的特殊颜色专业效果

    利用系统函数模拟实现nginx 系统脚本启动的特殊颜色专业效果/etc/init.d/nginxd {start/stop/restart/reload}利用if语句实现: ============= ...

  7. nginx 服务脚本编写模板

    编写nginx服务脚本:脚本内容如下: [root@www ~]# cat /etc/init.d/nginx #!/bin/bash # nginx Startup script for the N ...

  8. nginx 自启动脚本

    nginx 自启动脚本 创建脚本 cd /etc/init.d vi nginx 脚本如下: #! /bin/bash # chkconfig: 35 85 15 # description: Ngi ...

  9. Ubuntu 16.04开机自启Nginx简单脚本

    本文要记述的是最简单的Ubuntu下开机自启 nginx的脚本 这里将nginx装在了/usr/local/nginx目录下,nginx本身没有注册成服务,所以直接使用服务开机自启是不行的,除非自己写 ...

  10. nginx安装脚本

    #!/bin/bash#auto config Nginx#by zhangjia 2019#define Path variables#date:2019/1/16 check_ok() { ]] ...

随机推荐

  1. linux添加私有的ip

    在虚拟机上的网络适配器设置为仅主机模式,重启linux系统,ifconfig查看所得的就是linux自动配置的私有ip.

  2. 悬浮TabBar的实现--此段代码来自网络

    悬浮TabBar的实现 这个TabBar看着像是用自定义TabBar做的,但事实上它还是用的系统的TabBar,给系统的tabBar.backgroundImage设置一张设计好的背景图片. TabB ...

  3. OE学习笔记流水

    Terrain.cpp中的getWorldCoordsUnderMouse函数,进行标记.

  4. 何为HDFS?

    该文来自百度百科,自我收藏. Hadoop分布式文件系统(HDFS)被设计成适合运行在通用硬件(commodity hardware)上的分布式文件系统.它和现有的分布式文件系统有很多共同点.但同时, ...

  5. node(Buffer缓存区)

    // 创建buffer类 var buf=new buffer(10); var buf=new buffer([10,20,30,40]); var buf=new buffer("www ...

  6. ubuntu selinux

    apt install selinux-utils apt install policycoreutils https://zhidao.baidu.com/question/917938889387 ...

  7. 二.TimesTen原理及应用场景

    声明:本文章转自麻袋爸爸 一,TimesTen应用场景 在谈论TimesTen内存数据库应用场景之前,我们先来介绍一下什么是内存数据库,及其工作原理吧.内存数据库,顾名思义就是将数据存放在内存中,并通 ...

  8. Idea在src下不能编译XML文件

    IDEA编译XML文件,如果需要在src下编译就需要在maven配置中加如下配置: <build> <finalName>SpringDemo</finalName> ...

  9. node - glob模块

    node的glob模块允许你使用 *等符号, 来写一个glob规则,像在shell里一样,获取匹配对应规则的文件. 这个glob工具基于javascript.它使用了 minimatch 库来进行匹配 ...

  10. cocoapods导入shareSDK分享实现

    这个在官方文档没有说这两个库是必须导入的,但是不导入是会有错误的 pod 'ShareSDK3/ShareSDKConfigurationFile' pod 'ShareSDK3/ShareSDKEx ...