Skip to content

鼓励作者:欢迎打赏犒劳

一文讲通 Nginx

前端的 Nginx 知识梳理

https://mp.weixin.qq.com/s/dte9oRimIWlZp0pd-ZF-WQ

下面这以 ubuntu 为例,卸载安装 nginx

卸载

bash
# 移除 nginx
$ apt-get --purge remove nginx

# 查询 nginx 依赖的包,会列出来
$ dpkg --get-selections|grep nginx

# 移除上面列出的包,例如 nginx-common
$ apt-get --purge remove nginx-common

# 也可以执行 autoremove ,会自动删除不需要的包
$ apt-get autoremove

# 查询 nginx 相关的文件,删掉就可以了
$ sudo find / -name nginx*

安装

bash
安装依赖库

# gcc g++
apt-get install build-essential
apt-get install libtool

# pcre
sudo apt-get install libpcre3 libpcre3-dev

# zlib
apt-get install zlib1g-dev

# ssl
apt-get install openssl
apt-get install libssl-dev

安装 nginx

到 nginx download 上找到最新的nginx 版本

参考资料