mac openresty 源碼安裝 坑

下載openresty源碼安裝

下載頁面http://openresty.org/cn/download.html
下載上一個版本的穩定版 https://openresty.org/download/openresty-1.11.2.5.tar.gz

cd /var/local/software
tar -xvf openresty-1.11.2.5.tar.gz
cd openresty-1.11.2.5
./configure

竟然報錯了

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.

ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx \...

看着是找不到openssl 的路徑,那把路徑帶過去試試

sudo ./configure -j2 --with-openssl=/usr/local/Cellar/openssl/1.0.2q/
cd /usr/local/Cellar/openssl/1.0.2q \
&& if [ -f Makefile ]; then /Library/Developer/CommandLineTools/usr/bin/make clean; fi \
&& ./config --prefix=/usr/local/Cellar/openssl/1.0.2q/.openssl no-shared  \
&& /Library/Developer/CommandLineTools/usr/bin/make \
&& /Library/Developer/CommandLineTools/usr/bin/make install_sw LIBDIR=lib
/bin/sh: ./config: No such file or directory
make[2]: *** [/usr/local/Cellar/openssl/1.0.2q/.openssl/include/openssl/ssl.h] Error 127
make[1]: *** [build] Error 2
make: *** [all] Error 2

就這個錯誤折騰好長時間,後來發現openssl的路徑是需要源碼路徑
那下載源碼指定路徑試試。
https://www.openssl.org/source/
下載解壓

tar -xvf openssl-1.0.2q.tar.gz

安裝成功

sudo ./configure -j2 --with-openssl=/var/local/software/openssl-1.0.2q
sudo make
sudo make install

一路安裝成功

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章