centos7 安装nginx遇到的坑

Restarting nginxd (via systemctl):  Warning: nginxd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for nginxd.service failed because a timeout was exceeded. See "systemctl status nginxd.service" and "journalctl -xe" for details.
[FAILED]

解决: 

#vim /lib/systemd/system/nginx.service

[Unit]
Description=nginx 
After=network.target 
   
[Service] 
Type=forking 
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx reload
ExecStop=/usr/local/nginx/sbin/nginx quit
PrivateTmp=true 
   
[Install] 
WantedBy=multi-user.target
#systemctl enable nginx.service

#pkill -9 nginx

#systemctl start nginx.service 

猜你喜欢

转载自www.cnblogs.com/liuyp99999/p/9382187.html