当前位置:网站首页>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环境,那更是极好的。
边栏推荐
- 1-14 express managed static resources
- FreeRTOS record (IX. an example of a bare metal project transferring to FreeRTOS)
- 1-16 路由的概念
- Is the stock account opened in qiniu safe? How to apply for a low commission stock account?
- 微服務鏈路風險分析
- Ml & DL: introduction to hyperparametric optimization in machine learning and deep learning, evaluation index, over fitting phenomenon, and detailed introduction to commonly used parameter adjustment
- 【回溯】全排列 II leetcode47
- WinDbg debugging tool introduction
- Bloom filter
- Summary of interesting websites
猜你喜欢

SQL server extracts pure numbers from strings

JD and Tencent renewed the three-year strategic cooperation agreement; The starting salary rose to 260000 yuan, and Samsung sk of South Korea scrambled for a raise to retain semiconductor talents; Fir

Anaconda下安装Jupyter notebook

介绍一款|用于多组学整合和网络可视化分析的在线平台

布隆过滤器

Look at the top 10 capabilities of alicloud cipu

Domestic database disorder
Notes [introduction to JUC package and future]

PyTorch量化实践(1)

Niubi | the tools I have treasured for many years have made me free to fish with pay
随机推荐
Anti leakage family photo in attack and defense drill
Best wishes for Lao Wu's party
Bloom filter
从PG15 XID64再次跳票说起
Study summary of dynamic routing between capsules
本地浏览器打开远程服务器上的Jupyter Notebook/Lab以及常见问题&设置
Introduce an online platform for multi omics integration and network visual analysis
Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
1-11 create online file service
Introduction and example of template method mode
1-11 创建线上文件服务
5G 在智慧医疗中的需求
vncserver: Failed command ‘/etc/X11/Xvnc-session‘: 256!
Stinky tofu made by Grandma
Niubi | the tools I have treasured for many years have made me free to fish with pay
Neurotransmetteurs excitateurs - glutamate et santé cérébrale
1-1 数据库的基本概念
Analyse des risques liés aux liaisons de microservices
1-10 respond to client content according to different URLs
Five years after graduation, I wondered if I would still be so anxious if I hadn't taken the test