服务器启动时如何自动启动NGINX?

我有两个在两台Linode服务器上运行的站点。

当我重新启动服务器#1时,它会立即再次自动启动NGINX

当我重新启动服务器#2,它不!

我怎样才能configuration我的服务器,以便重启服务器时重启NGINX?

提前致谢…

放在/etc/rc.local中:

/www/nginx/sbin/nginx (or what you path is) 

如果你使用ubuntu,你可以使用update-rc.d

 update-rc.d nginx enable 2345 

或者如果你使用基于redhat的系统

 chkconfig nginx --level 2345 on