工作中在虛擬機器ubuntu18.10一鍵安裝lnmp1.5失敗後,分開進行安裝nginx,mysql,php,報錯
如下: sudo service nginx restart
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
圖示:
試了很多辦法就不一一描述了,都以失敗告終,最後的我的解決辦法清除限載一鍵lnmp1.5,清除nginx殘餘,殺死nginx程序等,具體操作如下: 首先切換到lnmp一鍵安裝目錄下,執行 ./uninstall.sh,按任意鍵
一、linux/unbunt nginx 解除安裝重灌
1.刪除nginx,-purge包括配置檔案
sudo apt-get --purge remove nginx
2.移除全部不使用的軟體包
sudo apt-get autoremove
3.羅列出與nginx相關的軟體並刪除
dpkg --get-selections|grep nginx
sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-core
4.檢視nginx正在執行的程序,如果有就kill掉
ps -ef |grep nginx
sudo pkill -9 nginx
5.全域性查詢與nginx相關的檔案
sudo find / -name nginx*
6.刪除列出的所有檔案
sudo rm -rf file
7.重灌nginx
sudo apt-get update
sudo apt-get install nginx
8 nginx的其他內容
測試nginx配置是否正確
sudo nginx -t
nginx 重啟
sudo service nginx restart
最後在瀏覽器訪問 http://伺服器ip