在ubuntu手动安装nginx1.6的/etc/init.d/nginx配置

手动安装升级到nginx1.6

1
2
3
4
5
6
7
cd tmp/
wget http://nginx.org/download/nginx-1.6.0.tar.gz
tar -zxvf nginx-1.6.0.tar.gz
cd nginx-1.6.0/
./configure --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module 
make 
sudo make install

/etc/init.d/nginx的配置脚本

1
2
sudo wget http://dlj.bz/OHaQ -O /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx

nginx常用脚本

1
2
3
service nginx status  # to poll for current status
service nginx stop    # to stop any servers if any
service nginx start   # to start the server

加入系统启动项

1
sudo update-rc.d -f nginx defaults

移除系统启动项

1
sudo update-rc.d -f nginx remove
Resources
原文地址:http://dlj.bz/JZqQF3

Comments