在centos中创建nginx启动脚本
2014-12-30 14:25
225 查看
1. 建立脚本文件nginxd
[root@could]# vi /etc/init.d/nginxd
插入以下内容
2、更改nginxd权限
[root@could]# chmod 755 /etc/init.d/nginxd
3、设置开机启动
[root@could]# chkconfig nginxd on
[root@could]# vi /etc/init.d/nginxd
插入以下内容
#!/bin/bash # # chkconfig: - 85 15 # description: Nginx is a World Wide Web server. # processname: nginx nginx=/usr/local/nginx/sbin/nginx conf=/usr/local/nginx/conf/nginx.conf case $1 in start) echo -n "Starting Nginx" $nginx -c $conf echo " done" ;; stop) echo -n "Stopping Nginx" killall -9 nginx echo " done" ;; test) $nginx -t -c $conf ;; reload) echo -n "Reloading Nginx" ps auxww | grep nginx | grep master | awk '{print $2}' | xargs kill -HUP echo " done" ;; restart) $0 stop $0 start ;; show) ps -aux|grep nginx ;; *) echo -n "Usage: $0 {start|restart|reload|stop|test|show}" ;; esac |
[root@could]# chmod 755 /etc/init.d/nginxd
3、设置开机启动
[root@could]# chkconfig nginxd on
相关文章推荐
- 在centos中创建nginx启动脚本
- windows php nginx服务器搭建 配置 创建启动 停止 重启脚本
- centos下nginx启动脚本和chkconfig管
- CentOS 6.5 开机启动MySQL Apache Nginx脚本
- centos6.4下NGINX启动脚本
- CentOS6.8 x86_64bit shell脚本实现模拟nginx服务启动与关闭
- centos6.5 nginx启动脚本
- Centos7 编译安装nginx1.10.2 脚本启动失败解决思路
- centos LNMP第一部分环境搭建 LAMP LNMP安装先后顺序 php安装 安装nginx 编写nginx启动脚本 懒汉模式 mv /usr/php/{p.conf.default,p.conf} php运行方式SAPI介绍 第二十三节课
- Centos7 nginx启动脚本
- 制作CentOS中Nginx开机启动脚本(转)
- centos下nginx启动脚本和chkconfig管理
- Nginx的启动脚本(Centos)
- centos7 添加Nginx启动脚本
- CentOS7 Nginx和PHP启动脚本
- URL检查 跳板机 创建用户 Nginx启动 随机密码的脚本
- CentOS下nginx启动脚本
- centos下nginx启动脚本和chkconfig管理
- CentOS上可用的nginx启动脚本