因为需要测试Nginx的spdy,需要升级openssl。可能会涉及后续的大规模升级计划,所以将openssl制作成rpm包, 其中包括了对hifn so的管理..
hifn so的管理就是:
将so copy到/usr/lib,在/usr/lib创建最新的so链接文件.
然后在通过/usr/lib的链接文件,引入到openssl的目录内.
以后so升级,就拷贝到/usr/lib,然后更新so链接文件就可以了..
OpenSSL的spec文件内容.
#sinaopenssl-1.0.1j.specs %define debug_package %{nil} %define openssldir /usr/local/openssl-%{version} Summary: RPM for openssl Name: sina-openssl Version: 1.0.1j Release: 1 Vendor: Sina/guoliang9 License: Share Group: Enterprise/Sina AutoReqProv: 0 URL: http://www.sina.com.cn/ Source: sina-openssl-1.0.1j.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) BuildArch: noarch %description 在这台设备上安装%{name}-%{version} %prep %setup -q %build %define CONFIG_FLAGS --prefix=%{openssldir} ./config %{CONFIG_FLAGS} shared LD_LIBRARY_PATH=`pwd` make LD_LIBRARY_PATH=`pwd` make rehash %install rm -rf $RPM_BUILD_ROOT make install INSTALL_PREFIX="$RPM_BUILD_ROOT" install -D libeng_dx.so.1.1.0 %{buildroot}/%{openssldir}/lib/engines/ %post test -f /usr/lib/libeng_dx.so.1.1.0 || cp -f %{openssldir}/lib/engines/libeng_dx.so.1.1.0 /usr/lib/libeng_dx.so.1.1.0 test -L /usr/lib/libeng_dx.so || ln -sf /usr/lib/libeng_dx.so.1.1.0 /usr/lib/libeng_dx.so ln -sf /usr/lib/libeng_dx.so %{openssldir}/lib/engines ldconfig %clean rm -rf $RPM_BUILD_ROOT %preun rm -f %{openssldir}/lib/engines/libeng_dx.so %postun ldconfig %files %defattr(-,root,root,0755) %{openssldir} %changelog
Nginx的启动文件主要变更内容为..
#!/bin/sh # chkconfig: - 85 15 # description: this sina nginx # processname: nginx # config: /usr/local/{nginx}/conf/nginx.conf # pidfile: /usr/local/{nginx}/logs/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 # define OpenSSL version path if [ -d "/usr/local/openssl-1.0.1j/lib" ];then OPENSSLDIR="/usr/local/openssl-1.0.1j/lib" elif [ -d "/usr/local/openssl-1.0.0m/lib" ];then OPENSSLDIR="/usr/local/openssl-1.0.0m/lib" fi if [ ! -z $OPENSSLDIR ];then nginx="/bin/env LD_LIBRARY_PATH=$OPENSSLDIR /usr/local/$CONFDIR/sbin/nginx" else nginx="/usr/local/$CONFDIR/sbin/nginx" fi 后续内容就基本都差不多了。巴拉巴拉。。。
剩下的OpenSSL升级操作只需要..
yum install sina-openssl -y && /etc/init.d/nginx restart
本文出自 “晓风残月” 博客,请务必保留此出处http://kinda22.blog.51cto.com/2969503/1586592
原文地址:http://kinda22.blog.51cto.com/2969503/1586592