由于Cyrus SASL 依赖OpenSSL1.0.0,查询系统自带的sasl
[root@rhel4 ~]# openssl version
OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
[root@rhel4 ~]# rpm -qa |grep -i openssl
pyOpenSSL-0.6-1.p24.7.2.2
openssl-0.9.8e-12.el5_4.6
openssl-0.9.8e-12.el5_4.6
注意:如果需要zlib压缩模块的话,还需要先安装zlib,否则执行的时候会报错如下:
[root@rhel4 openssl-1.0.1c]#./config --prefix=/usr/local/ssl shared zlib-dynamic
make[2]: *** [c_zlib.o] Error 1
make[2]: Leaving directory`/root/openssl-1.0.1c/crypto/comp'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory`/root/openssl-1.0.1c/crypto'
make: *** [build_crypto] Error 1
这里不需要使用zlib,则命令如下:
[root@rhel4 openssl-1.0.1c]# ./config --prefix=/usr/local/sslshared no-zlib
[root@rhel4 openssl-1.0.1c]#make
[root@rhel4 openssl-1.0.1c]#make test
[root@rhel4 openssl-1.0.1c]#make install
升级符号链接:
[root@rhel4 local]# ll /usr/bin/openssl*
-rwxr-xr-x 1 root root 385920 Mar 12 2010 /usr/bin/openssl
[root@rhel4 ~]# mv /usr/bin/openssl /usr/bin/openssl.bak
[root@rhel4 ~]# ll /usr/local/ssl/bin/openssl
-rwxr-xr-x 1 root root 586788 Feb 26 08:51/usr/local/ssl/bin/openssl
[root@rhel4 ~]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
[root@rhel4 ~]# ll /usr/bin/openssl*
lrwxrwxrwx 1 root root 26 Feb 26 09:10 /usr/bin/openssl ->/usr/local/ssl/bin/openssl
-rwxr-xr-x 1 root root 385920 Mar 12 2010 /usr/bin/openssl.bak
[root@rhel4 ~]# openssl version
OpenSSL 1.0.1c 10 May 2012
更新运行环境链接:
ld.so.cache will need to be updated withthe location of the new OpenSSL shared libs: libcrypto.so.0.9.8 andlibssl.so.0.9.8
Sometimes it is sufficient to just symlinkor copy these two files to /lib, but we recommend you follow these instructionsinstead.
Edit /etc/ld.so.conf, add to paths...(修改效果如下图1,当然也可以直接在/etc/ld.so.conf.d文件夹下再创建一个.conf文件,把/usr/local/ssl/lib拷贝到里面,另外也可以在现有的.conf文件中添加这个路径,反正ld.so.conf中包含了这个文件夹下的所有.conf文件)
[root@rhel4 ~]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
[root@rhel4 ~]# echo /usr/local/ssl/lib >> /etc/ld.so.conf
[root@rhel4 ~]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/ssl/lib
[root@rhel4 ~]# ldconfig
更改root环境变量,在.bash_profile添加如下行:
[root@ebs ~]# echo $PATH
/usr/local/jdk1.6.0_31/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@ebs ~]# vi ~/.bash_profile
export PATH=/usr/local/ssl/bin:$PATH
[root@ebs ~]# source ~/.bash_profile
[root@ebs ~]# echo $PATH
/usr/local/ssl/bin:/usr/local/jdk1.6.0_31/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
重新登录,进行验证升级成功:
[root@ebs ~]# which openssl
/usr/local/ssl/bin/openssl
[root@ebs ~]# openssl version
OpenSSL 1.0.1c 10 May 2012
[root@ebs ~]# ldd /usr/local/ssl/bin/openssl
libssl.so.1.0.0 => /usr/local/ssl/lib/libssl.so.1.0.0(0x00002af259a26000)
libcrypto.so.1.0.0 => /usr/local/ssl/lib/libcrypto.so.1.0.0(0x00002af259c89000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d5b200000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d5aa00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d5a600000)