Ubuntu升级apache版本

环境:

  • Ubuntu 16
  • Apache/2.4.18 (Ubuntu)

某天开始,云服务商就每星期一次云安全邮件,漏洞是 Apache HTTP Server特权提升漏洞 (CVE-2019-0211)
参考 https://httpd.apache.org/security/vulnerabilities_24.html

使用apt软件源安装

如果从官方文档看,是需要从源码编译安装的,但原先版本是通过apt安装,目前为止,ubuntu系统自带源和云服务商源还没更新,
这边通过增加第三方源方式 ppa:ondrej/apache2

2.4以上版本的apache增加了请求控制,需要在配置中增加 Require all granted ,避免更新后访问异常。该配置可在低版本中使用

旧版本apache 注意

<Directory
...
    Require all granted
...
</Directory>
cp -rf /etc/apache2/sites-available/ /tmp/apache2-available
cp -rf /etc/apache2/sites-enabled/ /tmp/apache2-enabled
ls -al /etc/apache2/sites-enabled/

apache2 -version
add-apt-repository ppa:ondrej/apache2
apt update && apt list --upgradable
apt-get install --only-upgrade apache2
apache2 -version
ls -al /etc/apache2/sites-enabled/

第一步中的 cp -rf 就是把配置备份,防止更新后配置丢失。
以上命令即可完成apache版本升级,注意中间有回车确认或者配置覆盖
依据个人情况区别对待,一般有覆盖提醒说明配置中存在个性化更改的,需要在版本更新后确认个性化配置还生效

猜你喜欢

转载自www.cnblogs.com/duoxuan/p/12552692.html