Centos7.4升级openssl和apache

#!/bin/bash
. /etc/init.d/functions
rpm_openssh="openssl-1.1.1a.tar.gz"
rpm_apr="apr-1.4.5.tar.gz"
rpm_apr_utils="apr-util-1.3.12.tar.gz"
pcre_devel="pcre-8.10.zip"
http_devel="httpd-2.4.37"
src_path=/server/tools
dst_path=/usr/local/src/

openssl(){
cp -arp ${src_path}/$rpm_openssh $dst_path
cd $dst_path && {
tar xf $rpm_openssh
cd openssl-1.1.1a && ./config shared zlib && make && make install
}
if [ $? -eq 0 ]
then
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig -v
sleep 2
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
else
exit 2
fi
if [ "/usr/local/bin/openssl version|awk '{print $2}'" == "1.1.1a" ]
then
action "openssl ok" /bin/true
else
action "openssl ok" /bin/false
fi
}
apr_install(){
cd $src_path
tar xf $rpm_apr && {
cd apr-1.4.5 && ./configure --prefix=/usr/local/apr && make && make install
sleep 1
}
}
apr_utils_install(){
cd $src_path
tar xf $rpm_apr_utils && {
cd apr-util-1.3.12 && ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config --enable-utf8 && make && make install
sleep 1
}
}
pcre_install(){
cd $src_path
unzip -o $pcre_devel && {
cd pcre-8.10 && ./configure --prefix=/usr/local/pcre && make && make install
sleep 1
}
}

apache_install(){
cd ${src_path}/$http_devel && {
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre && make && make install
}
sleep 1
systemctl stop httpd
for i in rpm -qa|grep httpd;do rpm -e $i --nodeps;sleep 1;done
sleep 2
if [ "/usr/local/apache2/bin/apachectl -v|sed -n 1p|awk -F "[ /]" '{print $4}'" == "2.4.37" ]
then
action "apache2 is well" /bin/true
else
action "apache2 is well" /bin/false
fi
}

install_openssl(){
if [ rpm -qa|grep zlib-devel|wc -l -ge 1 ]
then
action "zlib-devel is exist" /bin/true
openssl
else
action "zlib-devel is exist" /bin/false
fi
}
#install_openssl
apr_install
apr_utils_install
pcre_install
apache_install

转载于:https://blog.51cto.com/12936242/2331586

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值