Last-modified: 2011-12-26 (月) 01:24:42
Apache/アップデート(CentOS)

概要

ソースからインストールしたApacheをアップデートします。
ここでは、2.2.14から2.2.15へのマイナーアップデートを行います。
Apacheのインストールに関しては、以下のページを参照ください。
ソースから導入

手順

  1. ソースをダウンロードします。
    Everything is expanded.Everything is shortened.
      1
      2
    
    -
    !
    
    # バージョン2.2.15のソースを取得
    wget http://ftp.kddilabs.jp/infosystems/apache/httpd/httpd-2.2.15.tar.gz
  2. 展開します。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    tar zxvf httpd-2.2.15.tar.gz
  3. 展開先へ移動します。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    cd httpd-2.2.15
  4. 以前のApacheからconfig.niceをコピーします。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    cp <Apacheルート>/build/config.nice ./
  5. prefixを指定していたりする場合は、適宜config.niceを修正します。
    Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
    
    -
    |
    |
    !
     
     
     
     
     
     
    
    #! /bin/sh
    #
    # Created by configure
     
    "./configure" \
    "--prefix=<新しいApacheルート>" \
    "--with-mpm=worker" \
    "--enable-modules=most" \
    "--enable-mods-shared=all proxy proxy_balancer proxy_http cache disk_cache mem_cache" \
    "$@"
  6. makefileを作成します。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    ./config.nice
  7. ビルド、インストールします。
    Everything is expanded.Everything is shortened.
      1
      2
    
     
     
    
    make
    make install
  8. 以前の環境から設定ファイルをコピーし、適宜変更します。
  9. 追加モジュールがあればインストールします。
  10. 以前のApacheを停止します。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    /etc/init.d/httpd stop
  11. 自動起動設定を行います。chkconfigついての詳細は以下をご覧ください。
    LinuxTips/chkconfigにデーモンを追加したい
    Everything is expanded.Everything is shortened.
      1
    
     
    
    cp <新しいApacheルート>/bin/apachectl /etc/init.d/httpd
  12. [/etc/init.d/httpd]を開きます。chkconfig用の設定を追加します。
    Everything is expanded.Everything is shortened.
      1
      2
      3
      4
      5
    
    -
    |
    |
    |
    |
    
    #!/bin/sh
    #
    # chkconfig: 3 92 10
    # description: HTTP Server
    #
    
  13. 動作確認を行います。
    Everything is expanded.Everything is shortened.
      1
    
     
    
    /etc/init.d/httpd start
  14. ブラウザでアクセスできることを確認して終了です。

検証時の環境