一、一般电脑升级openssl
[root@vmware lib]# openssl version -a
1、下载需要的openssl
[root@vmware lib]# wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
2、解压
[root@vmware lib]# tar zxvf openssl-1.0.1g.tar.gz
3、编译安装
[root@vmware openssl-1.0.1g]# ./config shared zlib && make && make install
4、替换旧版本
[root@vmware openssl-1.0.1g]# mv /usr/bin/openssl /usr/bin/openssl.old [root@vmware openssl-1.0.1g]# mv /usr/include/openssl /usr/include/openssl.old [root@vmware openssl-1.0.1g]# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl [root@vmware openssl-1.0.1g]# ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl [root@vmware openssl-1.0.1g]#
5、配置文件搜索路径
[root@vmware openssl-1.0.1g]# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf [root@vmware openssl-1.0.1g]# ldconfig
6、监测版本
[root@vmware openssl-1.0.1g]# openssl version -a
二、监测点升级脚本
#!/bin/bash ####################openssl############################ cd /usr/local/src wget -c http://123.59.139.215:8002/openssl-1.0.2m.tar.gz tar -xzvf openssl-1.0.2m.tar.gz cd openssl-1.0.2m ./config --prefix=/data/app/openssl1.0.2m/ shared zlib && make && make install && touch ../openssl.done || die "failed install openssl." mv /usr/bin/openssl /usr/bin/openssl.old mv /usr/include/openssl /usr/include/openssl.old ln -s /data/app/openssl1.0.2m/bin/openssl /usr/bin/openssl ln -s /data/app/openssl1.0.2m/include/openssl /usr/include/openssl ####################curl############################ cd /usr/local/src wget -c http://123.59.139.215:8002/curl-7.50.3.tar.bz2 tar xf curl-7.50.3.tar.bz2 cd curl-7.50.3 ./configure --enable-shared --with-ssl=/data/app/openssl1.0.2m --prefix=/data/app/curl7.50.3 && make && make install && touch ../curl.done || die "failed install curl" rm -rf /usr/bin/curl && ln -s /data/app/curl7.50.3/bin/curl /usr/bin/curl rm -rf /usr/local/bin/curl && ln -s /data/app/curl7.50.3/bin/curl /usr/local/bin/curl rm -rf /usr/lib64/libssl.so.1.0.0 rm -rf /usr/lib64/libcrypto.so.1.0.0 ln -s /data/app/openssl1.0.2m/lib/libssl.so.1.0.0 /usr/lib64/ ln -s /data/app/openssl1.0.2m/lib/libcrypto.so.1.0.0 /usr/lib64/ #####################httpd################### cd /usr/local/src wget -c http://123.59.139.215:8002/httpd-2.2.12.tar.gz tar xzf httpd-2.2.12.tar.gz cd httpd-2.2.12 ./configure --prefix=/data/app/apache2 --disable-authn-file --disable-authn-default --disable-authz-groupfile --disable-authz-user --disable-authz-default --disable-auth-basic --disable-include --enable-so --with-mpm=prefork && make && make install && touch ../httpd.done || die "failed install apache2." #######################php################### cd /usr/local/src wget -c http://123.59.139.215:8002/php-5.4.45.tar.bz2 tar xf php-5.4.45.tar.bz2 cd php-5.4.45 ./configure --prefix=/data/app/php5.4.45 --with-apxs2=/data/app/apache2/bin/apxs --enable-mbstring --with-curl=/data/app/curl7.50.3 --with-openssl=/data/app/openssl1.0.2m --with-zlib --enable-sockets --enable-ftp && make && make install && touch ../php5.done || die "failed install php5." mv /usr/bin/php /usr/bin/php.bak ln -s /data/app/php5.4.45/bin/php /usr/bin/php
注意:只编译安装openssl和curl命令即可,然后重启httpd,不用编译安装httpd和nginx