nginx自启动

1. 将自启动文件上传到/etc/rc.d/init.d目录下 2. 运行命令行
#cd /etc/rc.d/init.d
#chmod +x nginx 
#chkconfig --add nginx
# chkconfig nginx on
3. 测试一下
# service nginx test
如果显示 the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok configuration file /usr/local/nginx/conf/nginx.conf test is successful 说明配置文件正常 4. 之后启动,停止nginx就方便很多了
# service nginx {start|restart|reload|stop}
点此下载nginx自启动文件