安装卸载nginx

http://www.nginx.cn/install

ubuntu和debain下的apt方式安装软件很方便,特别是对于新手安装和卸载nginx。

由于nginx不能动态添加模块,所以会经常安装和卸载、升级。

apt安装nginx方法
sudo apt-add-repository ppa:nginx/development
sudo apt-get update
sudo apt-get install nginx

apt卸载nginx方法
卸载方法1.
# 删除nginx,保留配置文件
sudo apt-get remove nginx
#删除配置文件
rm -rf /etc/nginx

卸载方法2.
#删除nginx连带配置文件
sudo apt-get purge nginx # Removes everything.

#卸载不再需要的nginx依赖程序
sudo apt-get autoremove

原文地址:https://www.cnblogs.com/spectrelb/p/6836549.html