LoginSignup
28
37

More than 5 years have passed since last update.

apache 最新版をyum でインストールする

Posted at

apacheの最新版をyumでインストールしたい!という場合のメモです。ネットで調べるとCENTALTというレポジトリを利用するようですが、どーも本家のサイトがダウンしていることが多いので、こちらのミラーサイトからyumでインストールする手順を記載しております

既存のapacheをバージョンを確認

# /etc/init.d/httpd stop                                                                                
httpd を停止中:                                            [  OK  ]
# /sbin/chkconfig httpd off                                                                             

古いバージョンであることを確認し、削除

# yum remove httpd
読み込んだプラグイン:fastestmirror, security
削除処理の設定をしています
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> Package httpd.x86_64 0:2.2.15-39.el6.centos will be 削除
--> 依存性の処理をしています: httpd-mmn = 20051115 のパッケージ: 1:mod_ssl-2.2.15-39.el6.centos.x86_64
--> 依存性の処理をしています: httpd-mmn = 20051115 のパッケージ: php-5.3.3-40.el6_6.x86_64
--> 依存性の処理をしています: httpd のパッケージ: 1:mod_ssl-2.2.15-39.el6.centos.x86_64
--> 依存性の処理をしています: httpd = 2.2.15-39.el6.centos のパッケージ: 1:mod_ssl-2.2.15-39.el6.centos.x86_64
--> トランザクションの確認を実行しています。
---> Package mod_ssl.x86_64 1:2.2.15-39.el6.centos will be 削除
---> Package php.x86_64 0:5.3.3-40.el6_6 will be 削除
--> 依存性解決を終了しました。

依存性を解決しました

==========================================================================================================================
 パッケージ               アーキテクチャ          バージョン                              リポジトリー               容量
==========================================================================================================================
削除:
 httpd                    x86_64                  2.2.15-39.el6.centos                    @base                     2.9 M
依存性関連での削除をします。:
 mod_ssl                  x86_64                  1:2.2.15-39.el6.centos                  @base                     187 k
 php                      x86_64                  5.3.3-40.el6_6                          @updates                  3.5 M

トランザクションの要約
==========================================================================================================================
削除                 3 パッケージ

epelのダウンロード

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

CentALTリポジトリを追加

rpm -ivh http://mirror.sysadminguide.net/centalt/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm

CentALTが何故か繋がらないため、baseurl を以下のような記述に変更します

vi /etc/yum.repos.d/centalt.repo
------------------------------------------------------
[CentALT]
name=CentALT Packages for Enterprise Linux 6 - $basearch
baseurl=http://mirror.sysadminguide.net/centalt/repository/centos/6/$basearch/
enabled=0
gpgcheck=0

apache 最新版の確認

CentAltに最新版のapacheがあるか確認します(んーーー。。最新・・・か?

yum list --enablerepo=CentALT | grep httpd | grep CentALT
-----
httpd.x86_64                                2.2.27-1.el6                 CentALT
httpd-devel.x86_64                          2.2.27-1.el6                 CentALT
httpd-manual.x86_64                         2.2.27-1.el6                 CentALT
httpd-tools.x86_64                          2.2.27-1.el6                 CentALT
php-eaccelerator-httpd.x86_64               1:1.0-0.9.git42067ac.el6     CentALT
thttpd.x86_64                               2:2.25b-1.el6                CentALT

apache インストール

yum install httpd httpd-devel --enablerepo=CentALT
--------------------------------------------------------------------
===========================================================================
 Package              Arch       Version                 Repository   Size
===========================================================================
Installing:
 httpd                x86_64     2.2.27-1.el6            CentALT     887 k
 httpd-devel          x86_64     2.2.27-1.el6            CentALT     139 k
Installing for dependencies:
 apr                  x86_64     1.3.9-5.el6_2           base        123 k
 apr-devel            x86_64     1.3.9-5.el6_2           base        176 k
 apr-util             x86_64     1.3.9-3.el6_0.1         base         87 k
 apr-util-devel       x86_64     1.3.9-3.el6_0.1         base         69 k
 apr-util-ldap        x86_64     1.3.9-3.el6_0.1         base         15 k
 cyrus-sasl-devel     x86_64     2.1.23-15.el6_6.2       base        303 k
 db4-cxx              x86_64     4.7.25-20.el6_7         updates     588 k
 db4-devel            x86_64     4.7.25-20.el6_7         updates     6.6 M
 expat-devel          x86_64     2.0.1-11.el6_2          base        120 k
 httpd-tools          x86_64     2.2.27-1.el6            CentALT      62 k
 mailcap              noarch     2.1.31-2.el6            base         27 k
 openldap-devel       x86_64     2.4.40-6.el6_7          updates     1.1 M

Transaction Summary
===========================================================================
Install      14 Package(s)

## mod_ssl インストール

yum install -y mod_ssl --enablerepo=CentALT
```

apache 起動

なんかワーニングが出ますが、とりあえずここでは、起動するか見たいだけなので無視っておきましょう
ちなみにこのワーニングは、/etc/http/conf/httpd.conf 内のServerNameの部分だけだと思いますので
直しておけば次回起動時は、ワーニングはでないと思います

/etc/init.d/httpd start
--------------------------------------------------------------------
Starting httpd: httpd: apr_sockaddr_info_get() failed for us-cdn01
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

こんな画面がでるはず・・

apache.jpg

httpd.conf のバックアップ

cd /etc/httpd/conf ; cp -a httpd.conf httpd.conf.`date +%Y%m%d%H%M`
28
37
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
37