徹底刪除nginx
1.先執行一下命令:
sudo apt-get --purge remove nginx
sudo apt-get autoremove
dpkg --get-selections|grep nginx
羅列出與nginx相關的軟體, nginx-common deinstall 然後
sudo apt-get --purge remove nginx-common
這樣就可以完全解除安裝掉nginx包括配置檔案
2.ps -ef |grep nginx 看下nginx還有沒有啟動,一般執行完1後,nginx還是啟動著的,如下:
[email protected]:/$ ps -ef |grep nginx
root 4061 2418 0 Mar11 ? 00:00:00 nginx: master processsbin/nginx
nobody 4062 4061 0 Mar11 ? 00:00:00 nginx: worker process
bkxmgx 15487 4229 0 01:13 pts/0 00:00:00 grep --color=auto nginx
3.kill nginx程序
sudo kill -9 4061 4062
4.sudo find / -name nginx*
/usr/local/src/nginx-1.7.9
/usr/local/src/nginx-1.7.9/objs/src/core/nginx.o
/usr/local/src/nginx-1.7.9/objs/nginx.8
/usr/local/src/nginx-1.7.9/objs/nginx
/usr/local/src/nginx-1.7.9/src/http/modules/perl/nginx.xs
/usr/local/src/nginx-1.7.9/src/http/modules/perl/nginx.pm
/usr/local/src/nginx-1.7.9/src/core/nginx.c
/usr/local/src/nginx-1.7.9/src/core/nginx.h
/usr/local/src/nginx-1.7.9/man/nginx.8
/usr/local/src/nginx-1.7.9/conf/nginx.conf
/usr/local/src/nginx-1.7.9/contrib/vim/syntax/nginx.vim
/usr/local/src/nginx-1.7.9/contrib/vim/ftdetect/nginx.vim
/usr/local/src/nginx-1.7.9/contrib/vim/indent/nginx.vim
/usr/local/nginx
/usr/local/nginx/logs/nginx.pid
/usr/local/nginx/conf/nginx.conf.default
/usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx
/home/bkxmgx/nginx.conf
/home/bkxmgx/nginx-1.7.9.tar.gz
/home/bkxmgx/桌面/nginx.conf
/home/bkxmgx/桌面/nginx~
/home/bkxmgx/桌面/nginx
5.依依刪除4列出的所有檔案
sudo rm -r /usr/local/src/nginx-1.7.9
sudo rm -r /usr/local/nginx
sudo rm -r /usr/local/nginx/logs/nginx.pid
sudo rm -r /usr/local/nginx/conf/nginx.conf.default
sudo rm -r /usr/local/nginx/conf/nginx.conf
sudo rm -r /usr/local/nginx/sbin/nginx
sudo rm -r /home/bkxmgx/nginx.conf
sudo rm -r /home/bkxmgx/桌面/nginx.conf
sudo rm -r /home/bkxmgx/桌面/nginx~
sudo rm -r /home/bkxmgx/桌面/nginx
這樣就徹底刪除nginx了