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