Apacheをインストールする


世界で最も利用されている Web サーバ Apache のインストール方法と設定を解説する。

  1. Downloading Apache - Japanized Apache Siteよりhttpd-2.0.47.tar.gzをダウンロードします。
    2006/2/5現在、2.0系は 2.0.55 が最新
    $ tar xvzf httpd-2.0.47.tar.gz
    

    configure オプションの表示は、./configure --help
    apacheは、WebDAVモジュールを組み込むことにします。(--enable-dav オプション)
    また、mod_encodingやバージョニング拡張の機能を組み込むときのために、DSO対応にします。
    (--enable-shared オプション)
    --prefix を省略すると、/usr/local/apache2 がインストール先になります。
    $ cd httpd-2.0.47
    $ ./configure --enable-shared=yes --enable-dav=yes
    $ make
    $ su
    # make install
    

    # /usr/local/apache2/bin/httpd -l
    で、組み込まれているモジュールを確認できます。

  2. httpd.confの設定が完了したら、
    configtestで設定内容に誤りが無いか確認します。
    httpd.confのPortが80になっているかも確認しておきます。
    # /usr/local/apache2/bin/apachectl configtest
    Syntax OK
    
    apachectlのconfigtestでSyntax OKが出たら設定に問題ありません。

  3. 自動起動の設定をします。
    起動スクリプトを作成します。
    /etc/rc.d/init.d/httpd2
    #!/bin/sh
    #
    # Startup script for the Apache Web Server
    #
    # chkconfig: 345 85 15
    # description: Apache is a World Wide Web server.  It is used to serve \
    #	       HTML files and CGI.
    # processname: httpd
    # pidfile: /var/run/httpd.pid
    # config: /usr/local/apache2/conf/httpd.conf
    
    
    # See how we were called.
    case "$1" in
      start)
    	/usr/local/apache2/bin/apachectl start
    	;;
      stop)
    	/usr/local/apache2/bin/apachectl stop
    	;;
      status)
    	/usr/local/apache2/bin/apachectl status
    	;;
      restart)
    	/usr/local/apache2/bin/apachectl restart
    	;;
      graceful)
    	/usr/local/apache2/bin/apachectl graceful
    	;;
      *)
    	echo "Usage: $0 {start|stop|restart|graceful|status}"
    	exit 1
    esac
    
    exit 0
    
    ファイル作成後はchmodで実行許可を与える。

  4. httpdのランレベルを設定します。
    # su -
    # chkconfig --add httpd2
    # chkconfig --list httpd2
    httpd2           0:off   1:off   2:off   3:on    4:on    5:on    6:off
    

  5. 早速、起動してみます。
    # /etc/rc.d/init.d/httpd2 start
    



  1. Apacheをインストールする
  2. WebDAVを使用する
  3. PHPをインストールする
  4. Apache 情報源




Apache ウェブサーバのインストール、設定、活用法


ウイルス対策ソフト メニュー

ESET Smart Security

シマンテック ノートン

ウイルスバスター

マカフィー

NOD32

ウイルスセキュリティZERO

Copyright(c) 1999-2017 ITNAVI.com サイト運営者情報