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 

 

posted @ 2018-07-28 15:38  liuyp99999  阅读(1865)  评论(0编辑  收藏  举报