ドキュメントルート変更 XAMPP
開発するうえで、ドキュメントルートとなるディレクトリの階層を深くしたくない、開発データはXAMPPディレクトリから分けたいなどと思ったので今回はドキュメントルートを変更します。
※
C:/Program Files/xampp/ にインストールしたことを前提に書いてます。
「apache/conf/ httpd.conf」の変更
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # #DocumentRoot "C:/Program Files/xampp/htdocs" DocumentRoot "新ドキュメントルートパス"
「C:\Program Files\xampp\apache\conf\httpd.conf」を開きます。
187行目の「DocumentRoot」を変更します。

「アクセス権限がありません」と権限エラーになりました。
#<Directory "C:/Program Files/xampp/htdocs">
<Directory "新ドキュメントルートパス">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
略
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
217行目からのドキュメントルートの権限などを設定いる箇所があります。
ディレクトリの対象を新ドキュメントルートに変更します。
以上でドキュメントルートが変更できました。

しかし、このままでは「xampp Control Panel」でのAdminボタンがリンク切れ起こしてしまいます。コントロールパネルからのリンク切れの修正についてはまた調べて記事にしたいと思います。
タグ: XAMPP
2010 年 5 月 27 日 木曜日 【 カテゴリー: 開発環境構築 】
