在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
跟MySQL安装一样,先进入“/usr/local/src”中,键入“cd /usr/local/src”回车,进入到文件夹中,接着键入“sudo wget http://nginx.org/download/nginx-0.8.37.tar.gz”回车,等待下载完毕。 复制代码 代码如下:#!/bin/bash # # chkconfig: - 85 15 # description: Nginx is a World Wide Web server. # processname: nginx nginx=/usr/local/server/nginx/sbin/nginx conf=/usr/local/server/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 |
请发表评论