当前位置:网站首页>Apache服务器OpenSSL升级
Apache服务器OpenSSL升级
2022-06-30 21:54:00 【星哥玩云】
OpenSSL心血漏洞吵的风生水起的。起初,公司几台rds的小业务机被通知修补OpenSSL漏洞,这几台机器都是单独小业务,当时停掉,找了个简单的文档便将它升级OK(有的是nginx,有的是resin)。修补完成重启服务后OK。
公司的主业务还有一台总的入口机(LVS撑的2台),由于这台机器比较重要,13年有过一次修补OpenSSL的漏洞也出过问题,(老机器呀,有换环境的打算),所以这次比较担心。但是上周突然有客服反映客户浏览本地服务时浏览器警报业务有问题,致使不得不立马来解决这个问题(升级OpenSSL)。
--------------------------------------------------------------------------------
环境查看及检测
PS:Apache编译好的$homedir/build/config.nice文件里面记录了之前编译的参数。
"./configure" \
"--with-ldap" \
"--enable-mods-shared=all ssl ldap cache proxy authn_alias file_cache authnz_ldap charset_lite dav_lock cache_disk" \
"--with-included-apr" \
"--with-ssl=/usr/local/openssl/" (第一次这里出了问题)\
然后重新编译完之后使用网站检测,还是继续报存在OpenSSL漏洞。。(开始用的360。然后觉得被他坑了,然后又找了个网站。)
https://lastpass.com/heartbleed (由于这是事后补的文章,所以我拿了个朋友的网站来演示,他的同样是这样的问题。)
然后瞬间明白了点什么。
这里出现了2个问题
-with-ssl=/usr/local/openssl/是老的OpenSSL的路径。
当指定了新的路径的时候,Apache报错。(由于这是事后文章报错信息没记录。大概是这样的:缺少apr-util依赖的相关的ldap.so****大概意思是你编译apr-util的时候就没有把他依赖的ldap编译进去)
得了。不绕了,直接开始正确的流程走吧。
一、安装OpenSSL
升级步骤
0. 首先通过 #openssl version –a 查看系统中存在的OpenSSL版本号
1. 通过#wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz 获得源码包
2. 安装openssl
tar xf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./config -DOPENSSL_NO_HEARTBEATS shared zlib
make
make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFF
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
3 配置库文件搜索路径
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#ldconfig -v
4 查看openssl 版本号,验证安装正确性
#openssl version -a
可以看到是新装好的版本。
-DOPENSSL_NO_HEARTBEATS (禁止心跳信息)
二、编译安装apr apr-util
特别需要注意,我下边会直接yum安装ldap相关的组件,原因在于最后编译Apache会依赖apr-util里面的ldap库,所以编译apr-util的时候也需要指定。
yum install apr apr-devel apr-util apr-util-devel apr-util-ldap ( 这样做是为了解决apr-util依赖ladp的问题,因为我找不到缺少了具体哪个库)
tar xf apr-1.4.6.tar.bz2
cd apr-1.4.6
./configure --prefix=/usr/local/apr
make && make install
cd ..
tar xf apr-util-1.5.2.tar.bz2
cd apr-util-1.5.2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-ldap
make && make install
三、编译安装Apache
$ tar xf httpd-2.4.4.tar.bz2
$ cd httpd-2.4.4
$ ./configure --with-ldap --enable-mods-shared="all ssl ldap cache proxy authn_alias file_cache authnz_ldap charset_lite dav_lock cache_disk" --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl=/usr/local/ssl/ (需要注意ssl这个地方的路径)
$ make && make install
最后补充
操作前我没有压缩去备份Apache原先的文件(日志也打在里面)。
我将它mv过去,然后最后 在编译好的目录下删掉conf htdocs logs 三个目录,然后将备份的目录中的这三个目录mv过来。最便捷(当然你可以复制logs的目录结构过来也行)
--------------------------------------------------------------------------------
大概需要注意的就是ldap依赖的。
其中我在编译做nginx OpenSSL升级的时候,有一个也是重新编译,好像是环境因素(时间隔太久了),在编译的时候,直接指定了OpenSSL的源码文件,让nginx将需要的OpenSSL的一些依赖的库重新编译了一次。
建议升级线上环境的时候,在测试环境测试完,然后做成rpm包,然后直接线上install。如果本地有自己的yum环境,那更是极好的。
边栏推荐
- Study summary of dynamic routing between capsules
- Is there a shortage? No need to download the free online resources! 2022 favorites must have it!
- Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022
- 看阿里云 CIPU 的 10 大能力
- 盘点华为云GaussDB(for Redis)六大秒级能力
- 1-1 数据库的基本概念
- Deployment and use of Nacos
- vim 常用快捷键
- Excuse me, can I open an account for the company? Is it safe? All the answers you want are here
- Is Wu Enda's machine learning suitable for entry?
猜你喜欢

Look at the top 10 capabilities of alicloud cipu

全面认识痛风:症状、风险因素、发病机理及管理

Nacos部署及使用

Bloom filter

Go Web 编程入门: 一探优秀测试库 GoConvey

机器学习适合女生学吗?

Introduce an online platform for multi omics integration and network visual analysis

Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022

程序员女友给我做了一个疲劳驾驶检测

A comprehensive understanding of gout: symptoms, risk factors, pathogenesis and management
随机推荐
5g demand in smart medicine
1-15 nodemon
1-3 使用SQL管理数据库
Introduction and example of template method mode
Analysis of doctor Aifen's incident
PyTorch量化实践(1)
1-20 预检请求
Uniapp routing uni simple router
【MySQL入门】第一话 · 初入“数据库”大陆
【回溯】全排列 leetcode46
Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
vim 常用快捷键
模板方法模式介绍与示例
微服务链路风险分析
On several key issues of digital transformation
Some problems when SSH default port is not 22
[untitled] first time to participate in CSDN activities
USBCAN分析仪的配套CAN和CANFD综合测试软件LKMaster软件解决工程师CAN总线测试难题
The Jenkins download Plug-in can't be downloaded. Solution
Analysis of PostgreSQL storage structure