#!/bin/bash. /etc/init.d/functionsrpm_openssh=openssl-1.1.1a.tar.gzrpm_apr=apr-1.4.5.tar.gzrpm_apr_utils=apr-util-1.3.12.tar.gzpcre_devel=pcre-8.10.ziphttp_devel=httpd-2.4.37src_path=/server...
#!/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
- 利用Docker 运行 python 简单程序 2022-10-16
- CentOS7安装GlusterFS集群的全过程 2022-10-10
- 阿里云ECS排查CPU数据分析 2022-10-06
- nginx中封禁ip和允许内网ip访问的实现示例 2022-09-23
- 教你在docker 中搭建 PHP8 + Apache 环境的过程 2022-10-06
- 解决:apache24 安装后闪退和配置端口映射和连接超时设置 2023-09-11
- CentOS_mini下安装docker 之 安装docker CE 2023-09-23
- 【转载】CentOS安装Tomcat 2023-09-24
- IIS搭建ftp服务器的详细教程 2022-11-15
- KVM虚拟化Linux Bridge环境部署的方法步骤 2023-07-11
