Apache Web Serverでドキュメントルートを変更したにもかかわらず、Fobidden/Permission Deniedエラーが出て動作しないことがあります。この原因として、DocumentRootは変更したが、Directoryを変更し忘れている可能性があります。Directoryタグも合わせて変更する必要があります。
修正前
# 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 (x86)/Apache Software Foundation/Apache2.2/htdocs"
...
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs">
修正後
# 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:/Inetpub/WWWRoot"
...
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Inetpub/WWWRoot">
著者
かつて日本を代表したスーパーエンジニア (自称)
ハードウェア、電気設備、ガーデニング関係の記事を担当。
最終更新日: 2024-01-07
作成日: 2011-01-22