瀏覽器回傳「403 Forbidden:You don't have permission to access / on this server」,目錄 NTFS 權限已給 Everyone 完全控制,卻仍無法存取。問題核心在 Apache 配置而非檔案系統權限。
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Satisfy all
</Directory>
Deny from all 封鎖所有根目錄下的存取。直接改為 Allow from all 雖能通過,但會暴露整個檔案系統,極度危險。
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Directory 路徑改為實際網站根目錄(DocumentRoot)Order allow,deny + Allow from all:先評估允許規則,預設允許所有Options Indexes FollowSymLinks:允許目錄列表與符號連結httpd.conf,尋找 <Directory /> 區塊,確認 Deny from all 存在DocumentRoot 對應的 <Directory> 區塊(或新增)Order allow,deny 與 Allow from allsystemctl restart httpd 或 apachectl restartIndexes,防止目錄遍歷洩露檔案結構AllowOverride None 禁止 .htaccess 覆蓋,集中管控Require ip 192.168.1.0/24 限制存取來源