原因:nginx無法啟動了,配置出現問題,因此卸載刪除配置後重裝
nginx重裝後啟動成功
1.先執行壹下命令:
1.1 刪除nginx,–purge包括配置文件
sudo apt-get --purge remove nginx
1.2 自動移除全部不使用的軟件包
sudo apt-get autoremove
1.3 羅列出與nginx相關的軟件
dpkg --get-selections|grep nginx
執行1.3的結果:
dpkg --get-selections|grep nginx
nginx install
nginx-common install
nginx-full install
1.4 刪除1.3查詢出與nginx有關的軟件
sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-full
這樣就可以完全卸載掉nginx包括配置文件
2.查看nginx正在運行的進程,如果有就kill掉
ps -ef |grep nginx
1.看下nginx還有沒有啟動,壹般執行完1後,nginx還是啟動著的,如下:
ps -ef |grep nginx
3.kill nginx進程
sudo kill -9 進程ID
4.全局查找與nginx相關的文件
sudo find / -name nginx*
5.依依刪除4列出的所有文件
sudo rm -rf file
這樣就徹底刪除nginx了