在centos7系统下编译安装nginx+openssl之后启动nginx一直报错
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
查看openssl版本的时候会提示一下报错:
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
查看openssl链接库
[root@base ~]# ldd /usr/local/bin/openssl
linux-vdso.so.1 => (0x00007fff9f1e0000)
libssl.so.1.1 => not found
libcrypto.so.1.1 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa61bfa0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa61bd84000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa61b9b6000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa61c1a4000)
解决方法: 我们只需要将我们安装的openssl路径在/usr/lib64/路径下做个链接就好,具体操作方法如下:
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
这个时候再使用openssl version查看sopenssl版本就不会出现这个错误了!