SUSE nginx编译配置SSL时提示找不到SSL库(已装OPENSSL)

一:查看服务器版本

smp-upload-01:~ # lsb_release -a
LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
Distributor ID: SUSE LINUX
Description:    SUSE Linux Enterprise Server 11 (x86_64)
Release:        11
Codename:       n/a

二:编译nginx

#./configure --with-http_ssl_modul

--------------------------------------------------------------

checking for OpenSSL library ... not found
checking for OpenSSL library in /usr/local/ ... not found
checking for OpenSSL library in /usr/pkg/ ... not found
checking for OpenSSL library in /opt/local/ ... not found


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

checking for OpenSSL library in /usr/local/ ... not found
checking for OpenSSL library in /usr/pkg/ ... not found
checking for OpenSSL library in /opt/local/ ... not found
提示找不到SSL库

上面红色字体的部分就是问题的原因所在,nginx会去红色字体的几个目录下找openssl库,而默认安装的路径是/usr/local/ssl

三:解决方案

把/usr/local/ssl/lib/目录下的文件拷贝一份到以上红色路径的lib目录下即可,如cp /usr/local/ssl/lib/* /usr/local/lib/

之后再编译nginx或者openresty就正常了。

附:或者可以使用./configure --with-openssl=your_openssl_source_dir编译。
 

猜你喜欢

转载自blog.csdn.net/a1010256340/article/details/89642734