CentOS 6.3に yum でApache 2.2.22をインストール

yumでインストール出来るApache(httpd)のバージョンを確認する

$ yum list | grep httpd
httpd.x86_64               2.2.15-15.el6.centos.1           @base   
httpd-tools.x86_64         2.2.15-15.el6.centos.1           @base   
httpd-devel.i686           2.2.15-15.el6.centos.1           base    
httpd-devel.x86_64         2.2.15-15.el6.centos.1           base    
httpd-manual.noarch        2.2.15-15.el6.centos.1           base

Apacheバージョンは、2.2.15-15

ApacheKiller(CVE-2011-3192)の対策は入っているのだろうか・・・

履歴を確認、httpd-devel-2.2.15-15.el6.centos.1.x86_64.rpm

対応は入っているみたい。

2011-09-08 - Joe Orton <jorton@redhat.com> - 2.2.15-13
- add security fix for CVE-2011-3192 (#733063, #736592)

ただ、他の脆弱性が気になるので、最新版のApache2.2.22をインストールすることにしました。
本当は、2.4系をインストールしたかったけど、yumで簡単にインストールできるようにはなってないみたいなので不採用。

EPELのリポジトリを追加

  • 最新版を確認してください。
$ sudo rpm -ihv http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
  • /etc/yum.repos.d/epel.repo の enabled=1 を enabled=0 に変更し、通常時は使わないようにする。
$ sudo sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/epel.repo

CentALTのリポジトリを追加

$ sudo vim /etc/yum.repos.d/centos.alt.ru.repo
  • 以下を記述して保存する。
[CentALT]
name=CentALT Packages for Enterprise Linux 6 - $basearch
baseurl=http://centos.alt.ru/repository/centos/6/$basearch/
enabled=0
gpgcheck=0

Apache(httpd)バージョン確認

$ yum list --enablerepo=CentALT | grep httpd | grep CentALT
httpd.x86_64                       2.2.22-1.el6        CentALT
httpd-devel.x86_64                 2.2.22-1.el6        CentALT
httpd-manual.x86_64                2.2.22-1.el6        CentALT
httpd-tools.x86_64                 2.2.22-1.el6        CentALT
lighttpd.x86_64                    1.4.31-1.el6        CentALT
lighttpd-fastcgi.x86_64            1.4.31-1.el6        CentALT
lighttpd-mod_geoip.x86_64          1.4.31-1.el6        CentALT
lighttpd-mod_mysql_vhost.x86_64    1.4.31-1.el6        CentALT

Apache2.2.22をインストール

$ sudo yum install -y httpd httpd-devel --enablerepo=CentALT

インストールされたバージョンを確認

$ httpd -version
Server version: Apache/2.2.22 (Unix)
Server built:   Jan 31 2012 12:28:21

Apache自動起動

$ sudo chkconfig httpd on

設定ファイルを配置するディレクトリを作成

$ sudo mkdir /etc/httpd/vhosts.d
$ sudo vim /etc/httpd/conf/httpd.conf
  • Include conf.d/*.conf の下に以下を追加
Include vhosts.d/*.conf

Apache再起動

$ sudo service httpd restart
  • 起動を確認する

確認後、noindex.htmlをリネーム

$ sudo mv /var/www/error/noindex.html /var/www/error/noindex.html.old