這裡介紹一下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應該就不會報沒有依賴的問題了。