ページ更新: 2005-05-29 (日) (6453日前)
関連: 2005-05-29 作成中。PHP(ってかPukiWiki)やPython(ってかtrac)のインストールの前段として。 目次 [編集]情報源 #Welcome! - The Apache HTTP Server Project Apache 2.0.54 #Windows XP Professional SP1 [編集]インストール #The Apache HTTP Server ProjectのDownload!から 'Win32 Binary (MSI Installer): apache_2.0.54-win32-x86-no_ssl.msi'をダウンロードし、実行。 [編集]Welcome to the Installation Wizrd for Apache HTTP Server 2.0.54 #License Agreement #Read This First #Server Information #
Setup Type #
Custom Setup #
Ready to Install the Program #Installing Apache HTTP Server 2.0.54 #Installation WIzrd Completed #インストール内容の確認 #[編集]ファイル #スタートメニュー #システムトレイ (Monitor Apache Servers) #サービス #インストール完了時に、特に問題がなければ、Apache2サービスが起動している。(=開始、と表示されている) サービスの実体: "C:\Program Files\Apache Group\Apache2\bin\Apache.exe" -k runservice[編集] ネットワーク #C:\> netstat -a Active Connections Proto Local Address Foreign Address State : (略) TCP winhost:http winhost.localnet.discypus.jp:0 LISTENING : (略) C:\> netstat -an Active Connections Proto Local Address Foreign Address State : (略) TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
C:\Program Files\Apache Group\Apache2\conf\error.log [Sun May 29 10:02:09 2005] [notice] Apache/2.0.54 (Win32) configured -- resuming normal operations [Sun May 29 10:02:09 2005] [notice] Server built: Apr 16 2005 14:25:31 [Sun May 29 10:02:09 2005] [notice] Parent: Created child process 860 [Sun May 29 10:02:10 2005] [notice] Child 860: Child process is running [Sun May 29 10:02:10 2005] [notice] Child 860: Acquired the start mutex. [Sun May 29 10:02:10 2005] [notice] Child 860: Starting 250 worker threads.
サービスの開始/終了 #スタートメニューやシステムトレイのアイコンから操作できる。 コマンドラインからだと、サービス名を指定して、以下のようにする。 終了 C:\> net stop apache2 Apache2 サービスを停止中です. Apache2 サービスは正常に停止されました。 開始 C:\> net start apache2 Apache2 サービスを開始します. Apache2 サービスは正常に開始されました。[編集] 設定変更 #httpd.confを修正し、スタート→Apache HTTP Server 2.0.54→Configure Apache Server→Test Configurationを実行して、 問題なければ、Apacheを起動(あるいは再起動)。
Apache2を再起動(restart)、あるいは停止→起動する場合の注意。 初回にサービスで実行しているので、スタート→Apache HTTP Server 2.0.54→Control Apache Serverの 'Restart'や'Start'や'Stop'は使わずに、'Monitor Apache Servers'を使うこと。 (逆に、サービスではなく通常のプロセスとして実行するなら、'Restart'や'Start'や'Stop'を使う。このとき、直前に サービスとして起動したことがあるなら、*.log は消去する必要があるかも知れない) [編集]変更例:access.logの書式変更 #access.logの書式をデフォルトの'common'から、より情報の多い'combined'に変更する。 デフォルトの書式の定義: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common デフォルトのaccess.logの設定: CustomLog logs/access.log common : (略) #CustomLog logs/access.log combined access.logの書式を'combined'に切り替える。commonの行をコメントアウト(#)、combinedの行のコメントを外す: #CustomLog logs/access.log common : (略) CustomLog logs/access.log combined Test Configurationを実行。問題なし: Syntax OK Apache2を再起動(restart)、あるいは停止→起動する。 http://localhostに対してブラウザ(ここではFirefox 1.0.4)でアクセスすると、 access.logにcombined形式で、次のログが生成される。 127.0.0.1 - - [29/May/2005:12:26:25 +0900] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4" 127.0.0.1 - - [29/May/2005:12:26:25 +0900] "GET /apache_pb.gif HTTP/1.1" 304 - "http://localhost/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4" 127.0.0.1 - - [29/May/2005:12:26:26 +0900] "GET /favicon.ico HTTP/1.1" 404 283 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4" |