首页 >后端开发 >php教程 >ubuntu1404彻底删除nginx

ubuntu1404彻底删除nginx

WBOY
WBOY原创
2016-07-29 09:00:16985浏览

1.先执行一下命令:

1.1 删除nginx,–purge包括配置文件

<code>sudo apt-<span>get</span><span>--purge remove nginx</span></code>

1.2 自动移除全部不使用的软件包

<code><span>sudo</span> apt-get autoremove
</code>

1.3 罗列出与nginx相关的软件

<code>dpkg --<span>get</span>-selections|grep nginx</code>
<code>执行<span>1.3</span>的结果:
stephen@stephen<span>-OptiPlex</span><span>-</span><span>390</span>:~$ dpkg <span>--</span>get<span>-selections</span><span>|</span>grep nginx
nginx                       install
nginx<span>-common</span>                    install
nginx<span>-core</span>                  install
</code>

1.4 删除1.3查询出与nginx有关的软件

<code>sudo apt-<span>get</span><span>--purge remove nginx</span>
sudo apt-<span>get</span><span>--purge remove nginx-common</span>
sudo apt-<span>get</span><span>--purge remove nginx-core</span></code>

这样就可以完全卸载掉nginx包括配置文件

2.查看nginx正在运行的进程,如果有就kill掉

<code>ps -ef <span>|grep nginx</span></code>

看下nginx还有没有启动,一般执行完1后,nginx还是启动着的,如下:

<code><span>stephen</span>@stephen-<span>OptiPlex</span>-<span>390</span>:~$ ps -ef |grep nginx
<span>root</span><span>7875</span><span>2317</span><span>0</span><span>15</span>:<span>02</span> ?        <span>00</span>:<span>00</span>:<span>00</span> nginx: master process /usr/sbin/nginx
<span>www</span>-<span><span>data</span>  7876  7875  0 15:02 ?        00:00:00 nginx: worker process</span><span>www</span>-<span><span>data</span>  7877  7875  0 15:02 ?        00:00:00 nginx: worker process</span><span>www</span>-<span><span>data</span>  7878  7875  0 15:02 ?        00:00:00 nginx: worker process</span><span>www</span>-<span><span>data</span>  7879  7875  0 15:02 ?        00:00:00 nginx: worker process</span><span>stephen</span><span>8321</span><span>3510</span><span>0</span><span>15</span>:<span>20</span> pts/<span>0</span><span>00</span>:<span>00</span>:<span>00</span> grep <span>--color=auto nginx</span></code>

3.kill nginx进程

<code><span>sudo</span> kill  -<span>9</span><span>7875</span><span>7876</span><span>7877</span><span>7879</span></code>

4.全局查找与nginx相关的文件

<code><span>sudo</span>  find  /  -name  nginx*</code>

5.依依删除4列出的所有文件

<code><span>sudo</span> rm -rf file</code>

这样就彻底删除nginx了

6. 再次重装

<code><span>sudo</span> apt-get update
<span>sudo</span> apt-get install nginx</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了ubuntu1404彻底删除nginx,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn