以Centos为例:1、6.0以前的版本创建/etc/init.d/nginx启动脚本/etc/init.d/nginx start即可启动chkconfig nginx on设置开机自启动2、7.0需要创建nginx.service放到/usr/lib/systemd/systemsystemctl start nginxsystemctl enable nginx