分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

Centos7.4升级openssl和apache

发布时间:2023-09-06 02:26责任编辑:沈小雨关键词: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

Centos7.4升级openssl和apache

原文地址:http://blog.51cto.com/12936242/2331586

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved