这里介绍一下ubuntu/debian系统的安装方法。首先说说比较熟悉的例子, 比如查找系统是否安装了zlib, 命令如下
dpkg -l | grep zlib
如果不用一键安装包, 自己手动安装nginx的话, 通常会报类似这样的错误:
./configure: error: the HTTP rewrite module requires the PCRE library.
接下来, 系统会提出建议:
You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option.
意思就是让你用参数的方式绕过(舍弃http重写模块)或者指定一个pcre的手动安装地址。不过这些建议都不符合实际应用场景。
为了防止反复的报错, 使用以下三个命令安装依赖:
apt-get install openssl libssl-dev apt-get install libpcre3 libpcre3-dev apt-get install zlib1g-dev
再去nginx/tengine的安装目录下运行./configure应该就不会报没有依赖的问题了。