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 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM