已經安裝了openssl,但是執行 ./configure時還是一直報:./configure: error: SSL modules require the OpenSSL library.


錯誤現象:

./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.

我以為是openssl沒安裝成功,再次yum install  openssl,但是發現明明已經是有openssl存在的了。。。

看錯誤提示:

or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
很開心,按上面的指示,應該是要指定openssl的位置,於是which openssl找到openssl的安裝位置, ./configure時增加參數,--with-openssl=/usr/local/bin/openssl,(這一步是錯誤的!!!)

./configure是通過了,但是,在執行gmake時就出現了新問題
gmake[2]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
gmake[2]: Leaving directory `/root/openresty-1.11.2.2/build/nginx-1.11.2'
gmake[1]: *** [build] Error 2
gmake[1]: Leaving directory `/root/openresty-1.11.2.2/build/nginx-1.11.2'
gmake: *** [all] Error 2
但是openssl是通過yum install安裝的,沒有存到它的源碼包(還是說我沒找到?)

只能再到官網下載一個,https://www.openssl.org/source/openssl-1.1.1f.tar.gz

找不到你需要的版本沒關系,找到一個版本相近的包,復制其下載鏈接,將后面的openssl版本替換成你需要的即可

(可以通過openssl vesion查看已經安裝了的openssl的版本信息)

最后解壓openssl源碼包到一個位置
最終的 ./configure的參數形式為

./configure --user=mysql --group=mysql --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/opt/openssl-1.1.1f  --add-module=/opt/nginx-1.14.2/src/echo-nginx-module
 
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM