
嗯,大家好。我正在嘗試讓別名在 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>