Apache
ダウンロード
http://httpd.apache.org/download.cgi
Windowsにインストールすると C:\Program Files\Apache Software Foundation\Apache2.2 以下にファイルが置かれる
httpd.confの設定

ドキュメントルートの設定
公開するディレクトリを指定する
\Apache\conf\httpd.conf の編集。 200行目あたりの DocumentRootを#でコメント可、htmlを置いているディレクトリのパスに書き直す。 # DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" DocumentRoot "C:/www/"
ポート番号の設定
初期設定でhttpのポートは80に設定されており、変更の必要はない
listen 80
.htaccessでの上書き許可
# AllowOverride None AllowOverride All
cgiの許可
\Apache\conf\httpd.conf の編集。 215行目あたりの Options に +ExecCGIを書き加える。 <Directory /> Options Indexes FollowSymLinks +MultiViews +ExecCGI Includes AllowOverride None Order deny,allow Deny from all Allow from all </Directory> # Optionsの項目内容 Indexes インデックスファイルが存在しない場合にファイル一覧を表示する Includes SSIを許可する FollowSymLinks シンボリンクリンクでのファイル表示を許可する ExecCGI cgiを許可する (ScriptAliasが作成されているディレクトリでは自動的に許可されている) MultiViews 指定ファイルが存在しない場合に拡張子違いのファイルを検索し、適切なファイルを表示する 450行目あたりのAddHandlerのコメントを外して、次のように書き直す。 AddHandler cgi-script .cgi .pl
.htaccessの上書き許可
AllowOverride を All に設定して、httpd.confの設定を上書き可能にする
<Directory />
AllowOverride All
Options FollowSymLinks +Indexes
Order deny,allow
Deny from none
</Directory>
.htaccessの非表示設定
設定ファイルに対して外部からの閲覧を拒否する
(初期設定)
.htではじまるすべてのファイルに影響
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
LoadModule
指定したファイルやライブラリを読み込み、使用モジュールのリストに追加する
正常に動作しているか確認
ブラウザで「http://localhost/」へアクセス