在安装nginx时,执行配置命令报错,找不到openssl包,百度后修改配置文件
./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.
提示加--with-openssl ,加上参数后可以配置过去,但不能make成功
百度后修改配置文件
vi /nginx解压目录/auto/lib/openssl/conf 修改库的路径为lib64
ngx_feature_libs="-R/usr/local/lib64 -L/usr/local/lib64 -lssl -lcrypto" #修改路径
ngx_feature_libs="-L/usr/local/lib64 -lssl -lcrypto" #修改路径
修改后编译安装成功,但启动nginx还是报错,找不到libssl.so.3,
./nginx: error while loading shared libraries: libssl.so.3: cannot open shared obj
执行openssl version也报找不到包目录。
error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory
查看ssl包是存在的
[root@localhost sbin]# ll /usr/local/lib64/*ssl*
执行下面两个命令后
echo "/usr/local/lib64/" >> /etc/ld.so.conf
ldconfig
openssl version 执行成功
nginx 也启动成功