Ubuntu14.04:
卸載原有通過apt安裝的nginx:
apt remove nginx nginx-common
apt purge nginx nginx-common
apt remove nginx-full nginx-common
安裝需要的依賴:
apt install zlib1g-dev
apt install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential
獲取源碼進行編譯安裝:
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
tar zxvf openresty-1.13.6.2.tar.gz
cd openresty-1.13.6.2
./configure --with-luajit --with-http_ssl_module --with-http_realip_module
make -j 8
make install
坑點:
1、ubuntu下zlib支持包交zlib1g-dev
2、openresty-1.13.6.2之前的版本編譯出現storage size of ‘ctx’ isn’t known,問題是openssl的版本問題。openresty-1.13.6.2已經修復了這個問題,不需要修改openssl的版本。