Windows 7 上の Apache エイリアス

Windows 7 上の Apache エイリアス

皆さん、こんにちは。私は Apache と Windows 7 で動作するエイリアスを作成しようとしています。そのため、次のような状況になっています。

<IfModule alias_module>
Alias /TamasMobile/ "C:/Users/IssamTP/Documents/NetBeansProjects/TamasMobile/"
</IfModule>
<Directory "C:/Users/IssamTP/Documents/NetBeansProjects/TamasMobile/">
Options Indexes FollowSymLinks
DirectoryIndex index.html index.php
AllowOverride None
Order deny,allow
Deny from all
</Directory>

ウェブサイトを読み込むと、次のエラーが発生します:

403 Forbidden
You don't have permission to access /TamasMobile/ on this server.

Apache エラー ログには次のように表示されます:

[Tue Sep 07 00:49:29 2010] [error] [client 127.0.0.1] client denied by server configuration: C:/Users/IssamTP/Documents/NetBeansProjects/TamasMobile/

はい、作業ディレクトリを ./htdocs/TamasMobile/ に変更するか、同様の操作を行うことができますが、個人的な興味から、これを修正する方法を知りたいと思います。

皆さん本当にありがとう。

答え1

確かに次の行:

Deny from all

問題の原因です。その行を削除して、機能するかどうかを確認してください。すべて拒否で何をしようとしていましたか? 通常、ルート ディレクトリには厳格なすべて拒否があり、すべてのエイリアスにはより緩やかなアクセスがあります。たとえば、次のようになります。

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "C:/Users/IssamTP/Documents/NetBeansProjects/TamasMobile/">
    Order allow,deny
    Allow from all
</Directory>

関連情報