Apache: You don't have permission to access / on this server,apachepermission
三. 常見問題常見解決方案
當在瀏覽器中查看配置成功與否出現問題時,可優先到Apache官方網站的FAQ 上或用搜尋引擎搜尋你的問題。
我這裡就最常見403問題:
Forbidden
You don't have permission to access / on this server.
提供幾種常見的解決方案:
1.按上面的配置正確,特別是:
Order allow,deny
Allow from all
2. 確保youRoot檔案夾下有index.html檔案(或名為index而尾碼為其他形式(如.jsp .php等)的檔案) ,因為Apache預設以index.html為網站首頁,如果沒有這個檔案就會出現上面的403錯誤。
註:如果你想以其他形式的檔案(如:index.jsp或index.php等)作為出現的網頁,可將Apache的設定檔中的:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
改為(如你想用index.jsp):
<IfModule dir_module>
DirectoryIndex index.html index.jsp
</IfModule>
如果需要瀏覽該檔案夾下的內容,可以在</Directory>前添加:
Options Indexes
就可以了。
3. 針對linux使用者,windows或其他使用者一般沒這種情況。linux系統中一般會內建apache,在修改了設定檔後,最好到安裝Apache的目錄下重啟Apache。
linux apache Forbidden You don't have permission to access / on this server
You don't have permission to access / on this server.
你沒有許可權訪問 /目錄
/etc/httpd/httpd.conf檔案配置
<Directory />
AllowOverride None
Order allow,deny
#allow from all --------------》這行被注釋 這行是意思是 允許所有訪問
</Directory>
root主目錄預設是(按照你的)
/home//lamp/apache243/htdocs
apache 的配置問題You don't have permission to access / on this server
indexes 參數是指沒有預設文件(通常為index.php index.html 這些)時列出檔案清單。沒有就不給列出,給出你看到的提示。
在httpd.conf 中可以指定預設文件。