标题: Linux下的openssl安装 [打印本页]

作者: 51黑tt    时间: 2016-3-5 18:12
标题: Linux下的openssl安装
我从网上搜索到了一篇安装openssl的英文文章,地址在 http://www.devside.net/web/server/linux/openssl 我按照上面说的安装了zlib,openssl。步骤简介如下(怕以后忘了)   
先安装zlib,见linux下安装zlib
安装openssl
Building a Web Server, for Linux
下载地址
Our ConfigurationBuild InstructionsConfigure.../openssl-0.9.8c]# ./config --prefix=/usr/local/ --openssldir=/usr/local/openssl -g3 shared zlib-dynamic enable-camellia

display guess on system made by './config'...
.../openssl-0.9.8c]# ./config -t 正式安装,Build and Install*测试是否安装成功,#openssl version 是否是新安装的版本

SymlinkForm symlink from '/usr/local/ssl-0.9.8c' to '/usr/local/ssl'
Update the Run-time Linkerld.so.cache will need to be updated with the location of the new OpenSSL shared libs: libcrypto.so.0.9.8 and libssl.so.0.9.8
Sometimes it is sufficient to just symlink or copy these two files to /lib, but we recommend you follow these instructions instead.
Edit /etc/ld.so.conf, add to paths...
/usr/local/ssl/lib Update the run-time linker...
...]# ldconfig Update the PATHEdit /root/.bash_profile, add to PATH variable...
/usr/local/ssl/bin Re-login.
[sanity check] OpenSSLVerify that binary 'openssl' is linking against the correct ssl libraries...
...]# ldd /usr/local/openssl/bin/openssl ...]# which openssl /usr/local/ssl/bin/openssl...]# openssl version OpenSSL 0.9.8c 05 Sep 2006If another path, or an older version is shown, your system contains a previously installed OpenSSL that is first [relative to the newer openssl] in the path.
Repeate the steps in section 'Update the PATH', except place the specified location at the start of the PATH variable.
Note that the older openssl, on most systems, is located under /usr/bin
The location of 'openssl' can be found with...
...]# which openssl
     但是我最后没有得到想要的结果,系统原来的openssl还是没能卸载掉,我该怎么做那?我继续搜索资料,哈,幸运的我找了,在一个国内论坛上是这么说的
      cd /usr/local/ssl/lib
      ln -s libcrypto.so.0.9.7 libcrypto.so.2
      ln -s libssl.so.0.9.7 libssl.so.2

      //最后要刷新系统的动态连接库配置
      echo /usr/local/ssl/lib >> /etc/ld.so.conf
      ldconfig -v
        这下子我豁然开朗,原来依赖的那2个文件是个软链接啊,我把它修改为我现在真正的openssl库文件不是就行了吗?于是一顿忙碌后,我终于执行了 rpm -e -nodeps ,然后重新启动系统,一路运行下去,全是绿灯。一时间感觉自己好幸福啊





欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1