\u6ce8\u610f\u6587\u4ef6\u8def\u5f84<\/strong><\/p>\n\n\n\nvim \/lib\/systemd\/system\/nginx.service<\/p>\n\n\n\n
[Unit]<\/p>\n\n\n\n
Description=nginx<\/p>\n\n\n\n
After=network.target<\/p>\n\n\n\n
[Service]<\/p>\n\n\n\n
Type=forking<\/p>\n\n\n\n
ExecStart=\/itops\/nginx\/sbin\/nginx -c \/itops\/nginx\/conf\/nginx.conf<\/p>\n\n\n\n
ExecReload=\/itops\/nginx\/sbin\/nginx -s reload<\/p>\n\n\n\n
ExecStop=\/itops\/nginx\/sbin\/nginx -s quit<\/p>\n\n\n\n
PrivateTmp=true<\/p>\n\n\n\n
[Install]<\/p>\n\n\n\n
WantedBy=multi-user.target<\/p>\n\n\n\n
\u7136\u540e\u7ed9\u811a\u672c\u6267\u884c\u6743\u9650\uff0cchmod 755
\/lib\/systemd\/system\/nginx.service<\/p>\n\n\n\n
\u81ea\u542f systemctl enable nginx.service \u6216 chkconfig nginx on<\/p>\n\n\n\n
\u6587\u7b2c\u4e8c\u6b65\uff1a\u914d\u7f6e\u6587\u4ef6\u8def\u5f84<\/h3>\n\n\n\n
\u5728\u914d\u7f6e\u6587\u4ef6nginx.conf\u914d\u7f6e\u4ee5\u4e0b\u6587\u4ef6\u5b58\u653e\u8def\u5f84\uff0c\u56fe\u4e0b\u610f\u601d\u662f\u5728\/\u76ee\u5f55\u65b0\u589e\u4e00\u4e2aagent\u6587\u4ef6\u5939\uff0c\u4e4b\u540e\u9700\u8981\u628a\u6587\u4ef6\u653e\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e0b<\/p>\n\n\n\n