当前位置: 首页 > 工具软件 > mod_ssl > 使用案例 >

[转] apache +ssl Cannot load modules/mod_ssl.so into server

林弘文
2023-12-01
httpd: Syntax error on line 150 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_ssl.so into server: libssl.so.1.1: cannot open shared object file: No such file or directory


resolve :

[root@yjwang local]# cd openssl/
[root@yjwang openssl]# ls
bin  include  lib  share  ssl
[root@yjwang openssl]# cd bin/
[root@yjwang bin]# ldd openssl
        linux-vdso.so.1 =>  (0x00007fff0c1fe000)
        libssl.so.1.1 => not found  
        libcrypto.so.1.1 => not found
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003600800000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003600c00000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003600400000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003600000000)

[root@yjwang bin]# cd /usr/local/openssl/
[root@yjwang openssl]# ls
bin  include  lib  share  ssl
[root@yjwang openssl]# cd lib/
[root@yjwang lib]# ls
engines-1.1  libcrypto.a  libcrypto.so  libcrypto.so.1.1  libssl.a  libssl.so  libssl.so.1.1  pkgconfig
[root@yjwang lib]# pwd
/usr/local/openssl/lib
[root@yjwang lib]# export LD_LIBRARY_PATH="/usr/local/openssl/lib/:$LD_LIBRARY_PATH"
[root@yjwang lib]# ldd openssl
ldd: ./openssl: No such file or directory
[root@yjwang lib]# cd ..
[root@yjwang openssl]# cd bin/
[root@yjwang bin]# ldd openssl
        linux-vdso.so.1 =>  (0x00007fff49c60000)
        libssl.so.1.1 => /usr/local/openssl/lib/libssl.so.1.1 (0x00007f5e52eac000)
        libcrypto.so.1.1 => /usr/local/openssl/lib/libcrypto.so.1.1 (0x00007f5e529d0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003600800000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003600c00000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003600400000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003600000000)
[root@yjwang bin]# cd ..
[root@yjwang openssl]# cd ..
[root@yjwang local]# cd apache2/
[root@yjwang apache2]# ls
asp  bin  build  cgi-bin  conf  error  htdocs  icons  include  logs  man  manual  modules
[root@yjwang apache2]# cd bin/
[root@yjwang bin]# ./apachectl start
[root@yjwang bin]# netstat -anp | grep :443
tcp6       0      0 :::443                  :::*                    LISTEN      6973/httpd
[root@yjwang bin]# netstat -anp | grep eens192.351
[root@yjwang bin]# netstat -anp | grep ens192.351
[root@yjwang bin]# netstat -anp | grep ^Cs192.351
[root@yjwang bin]# ip addr | grep ens192.351
14: ens192.351@ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    inet 121.116.10.29/24 brd 121.116.10.255 scope global ens192.351
    inet 10.99.91.235/24 scope global ens192.351
    inet 223.1.1.100/24 scope global ens192.351
    inet 121.116.10.30/24 brd 121.116.10.255 scope global secondary ens192.351
    inet 223.1.1.101/24 scope global secondary ens192.351
[root@yjwang bin]# curl https://127.0.0.1/ -k -v
* About to connect() to 127.0.0.1 port 443 (#0)
*   Trying 127.0.0.1...
* Adding handle: conn: 0x1611730
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1611730) send_pipe: 1, recv_pipe: 0
* Connected to 127.0.0.1 (127.0.0.1) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=www.host.com,OU=a10,O=a10,L=bj,ST=bj,C=cn
*       start date: Apr 28 06:49:30 2018 GMT
*       expire date: Apr 28 06:49:30 2019 GMT
*       common name: www.host.com
*       issuer: CN=www.host.com,OU=a10,O=a10,L=bj,ST=bj,C=cn
> GET / HTTP/1.1
> User-Agent: curl/7.32.0
> Host: 127.0.0.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 28 Apr 2018 08:50:53 GMT
* Server Apache/2.4.33 (Unix) OpenSSL/1.1.1-pre5 is not blacklisted
< Server: Apache/2.4.33 (Unix) OpenSSL/1.1.1-pre5
< Last-Modified: Mon, 17 Oct 2016 11:58:30 GMT
< ETag: "26-53f0e4b652c6e"
< Accept-Ranges: bytes
< Content-Length: 38
< Content-Type: text/html
<
-------------
index.html
------------
* Connection #0 to host 127.0.0.1 left intact
[root@yjwang bin]#

http://wiredrevolution.com/system-administration/how-to-correctly-use-ld_library_path

 类似资料: