51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

CentOS 7 nginx配置开机启动

vi /lib/systemd/system/nginx.service

[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/usr/sbin/nginx -s quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl enable nginx.service

systemctl disable nginx.service

systemctl start nginx.service

systemctl restart nginx.service

systemctl stop nginx.service

systemctl status nginx.service

systemctl list-units --type=service
赞(1)
未经允许不得转载:工具盒子 » CentOS 7 nginx配置开机启动