nginx设置成开机自动启动服务
1、nginx的安装目录 /usr/local/nginx 启动nginx cd /usr/local/nginx/sbin ./nginx 更改配置重启nginx cd /usr/local/nginx/sbin ./nginx -s reload 2、nginx设置成开机自动启动服务 1)在/etc/init.d下创建文件nginx,文件的内容拷贝官网内容,主要修改下面两个参数的值 nginx="/usr/sbin/nginx" #修改成nginx执行程序的路径。 NGINX_CONF_FILE="/etc/nginx/nginx.conf" #修改成nginx.conf文件的路径。 目前我的环境修改成如下内容 nginx=”/usr/local/nginx/sbin/nginx” NGINX_CONF_FILE=”/usr/local/nginx/conf/nginx.conf” 样例如下 #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: NGINX is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 proxy server #