• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

Centos7.4升级openssl和apache

Apache技术 wx591f7149f1707 48次浏览 已收录 0个评论

#!/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


VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明Centos7.4升级openssl和apache
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址