源码编译安装过 nginx
后修改配置文件与 path
环境变量都比较麻烦。
索性使用 apt-get
包管理器安装。
由于nginx不能动态添加模块,所以会经常安装和卸载、升级。
apt-get 安装nginx方法
sudo apt-add-repository ppa:nginx/development
sudo apt-get update
sudo apt-get install nginx
apt-get 卸载nginx方法
卸载方法
删除nginx,保留配置文件
sudo apt-get remove nginx
删除配置文件
rm -rf /etc/nginx
删除nginx连带配置文件
sudo apt-get purge nginx # Removes everything.
卸载不再需要的nginx依赖程序
sudo apt-get autoremove