编译安装nginx,并使用systemd管理nginx
#tar zxvf nginx-1.8.1.tar.gz
#cd nginx-1.8.1/
#make && make install
#cat /etc/systemd/system/nginx.service
[Unit]
Description=nginx server daemon
Documentation=man:nginx(8)
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx1.8.1/sbin/nginx
ExecReload=/usr/local/nginx1.8.1/sbin/nginx -s reload
ExecStop=/usr/local/nginx1.8.1/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
#systemctl daemon-reload
#systemctl start nginx.service
#systemctl enable nginx.service
#systemctl status nginx.service