#!/bin/sh
# chkconfig: 2345 80 90
# description: Start and Stop nginx #PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="nginx daemon"
NAME=nginx
DAEMON=/usr/local/nginx/sbin/$NAME
CONFIGFILE=/usr/local/nginx/conf/$NAME.conf
PIDFILE=/usr/local/nginx/logs/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME set -e
[ -x "$DAEMON" ] || exit 0 do_start() {
$DAEMON -c $CONFIGFILE || echo -n "nginx already running"
} do_stop() {
kill -INT `cat $PIDFILE` || echo -n "nginx not running"
} do_reload() {
kill -HUP `cat $PIDFILE` || echo -n "nginx can't reload"
} case "$1" in
start)
echo -n "Starting $DESC: $NAME"
do_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
do_stop
echo "."
;;
reload|graceful)
echo -n "Reloading $DESC configuration..."
do_reload
echo "."
;;
restart)
echo -n "Restarting $DESC: $NAME"
do_stop
do_start
echo "."
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|reload|restart}" >&2
exit 3
;;
esac exit 0

  chmod +x /etc/init.d/nginx

chkconfig --add nginx

chkconfg on

centos7.3nginx启动命令的更多相关文章

  1. Centos7 开机启动命令行模式

    1.在图形界面下单击鼠标右键,选择“Konsole”: 2. 获取当前系统启动模式,输入:systemctl get-default 3.查看配置文件, cat /etc/inittab 4.通过以上 ...

  2. Centos7上启动vpn客户端失败问题处理

    在某台云主机上(Centos7)搭建vpn客户端,发现一直启动失败,检查了下日志,报错如下: Sat Jan :: WARNING: Your certificate is not yet valid ...

  3. centos7 无法启动网络(service network restart)错误解决办法

    centos7 无法启动网络(service network restart)错误解决办法: (以下方法均为网上COPY,同时感谢原博主分享) systemctl status network.ser ...

  4. centos7的systemd命令对比

    centos7的systemd命令对比 http://www.linuxidc.com/Linux/2014-09/106490p2.htmhttp://www.linuxidc.com/Linux/ ...

  5. 在CentOS7服务器端启动jupyter notebook服务,在windows端使用jupyter notebook,服务器充当后台计算云端

    在CentOS7服务器端启动jupyter notebook服务,在windows端使用jupyter notebook,服务器充当后台计算云端 在服务器端启动jupyter notebook服务,在 ...

  6. 【CentOS7】常用命令

    [CentOS7]常用命令 转载:https://www.cnblogs.com/yangchongxing/p/10646640.html 目录 ========================== ...

  7. centos7中启动tomcat提示bash: tomcat8.0.39/bin/startup.sh: 权限不够

    问题描述: centos7中启动tomcat提示bash: tomcat8.0.39/bin/startup.sh: 权限不够 解决方案:先进入bin目录 [root@localhost/]# cd ...

  8. centos7虚拟机端口命令

    cat /etc/redhat-release  #  查看centos 版本 Centos7端口常见命令 虚拟机新开了5005端口,系统内部是显示开了的,但是外部不能访问端口. 一些需要用到的命令: ...

  9. centOS7杀死进程命令

    查看当前所有正在运行的进程,可以看到80端口被httpd占用了(80端口希望分配给nginx使用,而不是httpd) netstat -tpnul 这里以杀死httpd进程为例: 先查看 httpd ...

随机推荐

  1. 创建网站 并未网站指定ftp用户

    这里有个视频 前10分钟可以参考 在windows server2008 r2上面安装iis 带ftp服务 :http://v.youku.com/v_show/id_XMjUyMTE1MTI0NA= ...

  2. JDBC学习笔记——简单的连接池

    1.使用LinkedList保存连接                                                               即使是最简单的JDBC操作,也需要包含 ...

  3. WPF中StringFormat的用法--显示特定位数的数字

    原文:WPF中StringFormat的用法--显示特定位数的数字 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/huangli321456/art ...

  4. 通过浏览器调用Android要么iOS应用

    在做移动应用的单点登录时间,需要点击浏览器中启动链接APP和参数传递APP其中,用于处理相应的接口,现在,通过浏览器调用Android和iOS在应用过程中实现理清固化博客.为了查询. 一:通过浏览器调 ...

  5. HDU 2845 Beans(dp)

    Problem Description Bean-eating is an interesting game, everyone owns an M*N matrix, which is filled ...

  6. springboot 使用日志

    spring boot 默认使用日志打印到console 添加application.properties文件在src/main/resoures文件夹下 logging.file=my.log 将日 ...

  7. Entity framework 更改模型,新增表

    在Package Manager Console 中运行命令Enable-Migrations 再次运行可以更新 抄袭 在实体类中增加一个属性以后,执行 Update-Database 命令 ,可以更 ...

  8. Something write in FSE 2014

    Now, I find a problem, I have become my personal CSDN into a personal electronic diary. Actually, th ...

  9. DevExpress XtraTreeList TreeList复选框选择

    权限管理涉及复选框多勾选. 1.控件属性设置 TreeList.OperationView.ShowCheckBoxes=true;用于显示CheckBox: TreeList.OperationBe ...

  10. MVVM 下 ContextMenu的命令绑定

    原文:MVVM 下 ContextMenu的命令绑定 由于ContextMenu不继承父级的DataContext,所以如果要绑定父级的DataContext,直接DataContext=" ...