標籤:檔案 ica this ide rri log family rect ati
2015年01月22日 17:27:31閱讀數:3488
用MAMP搭建本機伺服器的時候,設定好ip和連接埠等屬性之後,瀏覽器訪問,報 403錯誤:
Forbidden
You don‘t have permission to access / on this server.
google之後,stackoverflow已有類似的問題:http://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server
主要有以下方法是:
將 /Application/MAMP /conf/ apache/httpd.conf 中的如下部分
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
set the options to : Options Indexes FollowSymLinks Includes ExecCGI
改成:
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
也有人提出是存取權限的問題,就是進程的擁有者沒有訪問Document root的許可權,原話如下:
Also, one should check the folder‘s permissions so that the Apache process‘ owner has permissions to read/execute the specified path for the virtual host. On Windows this could rarely be a problem but on Linux it can be a more frequent cause of 403.
看到這我才想到原來我將Document root 設在了案頭。而我直接存取Document root,就報錯了。如果訪問目錄下的某個檔案就沒問題。
MAMP "403 Forbidden You don't have permission to access / on this server."