在部署LNMP的时候遇到Nginx启动失败的2个问题

在部署LNMP的时候遇到Nginx启动失败的2个问题

报错如下:
 
1,/usr/local/nginx/sbin/nginx: error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory
 
意思是导入共享库错误,libssl.so.6无法打开,或者是没有这个文件或者文件夹
 
用命令查看:
 
#ldd $(which /usr/local/nginx/sbin/nginx)
 


    linux-vdso.so.1 =>  (0x00007fff98d03000)
 

 libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f21404ab000)
 
 libpcre.so.0 => /lib64/libpcre.so.0 (0x00007f214027f000) 
 
        libssl.so.6 => no found
 
 libcrypto.so.6 =>  no found
 
 libdl.so.2 => /lib64/libdl.so.2 (0x00007f213facf000)
 
 libz.so.1 => /lib64/libz.so.1 (0x00007f213f8b8000)
 
 libc.so.6 => /lib64/libc.so.6 (0x00007f213f525000)
 
 libfreebl3.so => /lib64/libfreebl3.so (0x00007f213f2c3000)
 
 libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f213f07e000)
 
 libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f213ed98000)
 
 libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f213eb94000)
 
 libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f213e967000)
 
 libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f213e74d000)
 
 /lib64/ld-linux-x86-64.so.2 (0x00007f21406ed000)
 
 libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f213e541000)
 
 libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f213e33e000)
 
 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f213e121000)
 
 libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f213df01000)
 
去/lib64/下面查找,果然没有这两个文件,我的系统是CentOS6.3_x86_64,我用yum网络安装libssl,没有这个包,在网上找了,有网友说要yum install libssl.so.6,网络安装了openssl098e.i686包,安装完了我在/usr/lib/下找到了libcrypto.so.6和libssl.so.6,依然无法启动,我做了软连接到/lib64下面,启动的时候报了第二个错误:
 
2,nginx: error while loading shared libraries: libssl.so.6: wrong ELF class: ELFCLASS32
 
我看到了错误才发现yum安装的是32位的包,只有在网上找64位的安装包,有网友提供了64位openssl098e-0.9.8e下载地址:wget ftp://ftp.pbone.net/mirror/www.startcom.org/AS-6.0.0/os/x86_64/Packages/openssl098e-0.9.8e-17.SEL6.x86_64.rpm。在安装rpm包的时候提示已经安装或者需要更新的,可以删除rpm包再重新安装即可。安装完了执行:
 
#ldd $(which /usr/local/nginx/sbin/nginx)就发现已经找到那两个共享库,在/usr/lib64/下面,然后启动成功。
 
解决问题

相关推荐