Red hat 6.5重新安装Apache httpd到版本2.4.43

  • A+

因服务器安全扫描检测漏洞报告显示目前Apache服务器版本已到生命周期尽头且存在拒绝服务漏洞,建议更新到2.3.3版或更高版本。
下面是具体的服务器HTTPD漏洞处理过程,采用重新安装新的版本2.4.43。

一.查看系统信息

  1. [root@web02 ~]# cat /etc/redhat-release  
  2. Red Hat Enterprise Linux Server release 6.5 (Santiago)  
  3.   
  4. [root@web02 ~]# httpd -v  
  5. Server version: Apache/2.2.15 (Unix)  
  6. Server built:   Aug  2 2013 08:02:15  
  7. [root@web02 ~]  

二.下载最新版本并进行安装

1.下载最新版tar压缩包httpd-2.4.43.tar.gz
  1. [root@web02 /]#wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.43.tar.gz  
  2.   
  3. [root@web02 /]# tar zxvf httpd-2.4.23.tar.gz  
  4. [root@web02 ~]# cd httpd-2.4.43  
  5. [root@web02 httpd-2.4.43]# pwd  
  6. /root/httpd-2.4.43  
  7. [root@web02 httpd-2.4.43]  
2.检查环境及错误处理
  1. [root@web02 httpd-2.4.43]# ./configure --prefix=/usr/local/httpd-2.4.43  
  2. checking for chosen layout... Apache  
  3. checking for working mkdir -p... yes  
  4. checking for grep that handles long lines and -e... /bin/grep  
  5. checking for egrep... /bin/grep -E  
  6. checking build system type... x86_64-pc-linux-gnu  
  7. checking host system type... x86_64-pc-linux-gnu  
  8. checking target system type... x86_64-pc-linux-gnu  
  9. configure:   
  10. configure: Configuring Apache Portable Runtime library...  
  11. configure:   
  12. checking for APR... no  
  13. configure: error: APR not found.  Please read the documentation.  
  14. [root@web02 httpd-2.4.43]  

出现上面错误提示,没有找到apr包。
下载apr对应软件包,下载以下2个包

  1. https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz  
  2. https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz  

将apr及apr-util的包解压到httpd解压之后的目录中,放到srclib目录下

  1. [root@web02 srclib]# pwd  
  2. /root/httpd-2.4.43/srclib  
  3.   
  4. [root@web02 srclib]# ls  
  5. apr  apr-1.7.0.tar.gz  apr-util  apr-util-1.6.1.tar.gz  Makefile  Makefile.in  
  6. [root@web02 srclib]  

然后重新检查httpd配置

  1. [root@web02 httpd-2.4.43]# ./configure --prefix=/usr/local/httpd-2.4.43  

提示,缺少pcre开发包

直接yum安装

  1. root@web02 httpd-2.4.43]#yum install pcre-devel  

3.编译安装

再次检查无问题后,进行编译安装

  1. [root@web02 httpd-2.4.43]#make && make install  

4.关闭原有httpd服务,启动新服务

  1. [root@web02 httpd-2.4.43]service httpd stop  

启动后查看版本,升级成功

  1. [root@web02 bin]# ./apachectl   
  2. AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.150.74. Set the 'ServerName' directive globally to suppress this message  
  3. [root@web02 bin]  
  4.   
  5. [root@web02 /]# /usr/local/httpd-2.4.43/bin/apachectl  -v  
  6. Server version: Apache/2.4.43 (Unix)  
  7. Server built:   Aug  5 2020 15:25:29  
  8. [root@web02 /]  
moonrong
  • 版权声明:本站原创文章,于2020年9月21日13:50:08,由 发表,共 2324 字。
  • 版权声明: 本文由于2020年9月21日13:50:08 发表在 好派笔记,共 2324 字。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: