nginx自启动脚本
来源:互联网 发布:安卓开发用什么数据库 编辑:程序博客网 时间:2024/05/16 19:55
一、在/etc/init.d/下建立一个文件,名为nginx
二、 给它755权限
三、写入以下脚本,
四、然后chkconfig --add nginx即可
注意:路径需要改成与自己机器相应的配置
脚本出自网络,非本人之手,记在此处,以备不时之需
#!/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/local/nginx/conf/nginx.conf############需要自行修改成对应的配置#########nginxd=/usr/local/nginx/sbin/nginxnginx_config=/usr/local/nginx/conf/nginx.confnginx_pid=/var/run/nginx.pid############需要自行修改成对应的配置#########RETVAL=0prog="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 1fi 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 /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" instart) start ;;stop) stop ;;reload) reload ;;restart) stop start ;;status) status $prog RETVAL=$? ;;*) echo $"Usage: $prog {start|stop|restart|reload|status|help}" exit 1esacexit $RETVAL
0 0
- nginx自启动脚本
- nginx自启动脚本
- debian 增加 nginx 自启动脚本
- debian 增加 nginx 自启动脚本
- Linux下nginx的自启动脚本
- nginx启动脚本并且开机自起
- Nginx自启动脚本(ubuntu 安装版)
- centos6.x下nginx自启动脚本
- Linux Nginx 设置开机 自启动 代码 脚本 命令
- cat /etc/init.d/nginx 自启动脚本
- 开机自启动nginx
- nginx没有自启动
- 开机自启动nginx
- nginx开机自启动
- nginx 自启动
- nginx的启动脚本
- nginx启动脚本--
- Nginx 启动脚本
- Linux中IIC总线驱动分析
- 通信协议与序列化方案的纠结: Protocol Buffer, thrift or hessian?
- MVC大型商贸系统(库存管理)技术解释(七) 商品转库
- js中二维数组篇
- UVa 10683 - The decadary watch
- nginx自启动脚本
- Python IDE: PyCharm程序输出乱码问题(含中文乱码)
- 帮助初学者区分doget和dopost
- Ubuntu怎么在桌面上添加应用图标
- linux设备驱动程序之简单字符设备驱动
- Android设备唯一标识ID的获取
- 好好的吧——身边
- n个骰子的点数
- Mybatis 高级结果映射 ResultMap Association Collection