mac apache 設置摘要

在mac下配置完apache和php環境後,經過localhost訪問頁面,出現403Forbidden。頁面提示php

Forbiddenapache

You don’t have permission to access / on this server. 
1:解決辦法是修改/etc/apache/httpd.conf的配置 
2:若是你只要配置虛擬主機,能夠在虛擬主機裏面寫這個配置app

若是apache版本是2.2的話,應該這麼寫ide

<Directory "/Users/apple/Sites/">
  Options Indexes MultiViews
  AllowOverride All
  # OSX 10.9 / Apache 2.2
  Order from deny, allow
</Directory>

若是apache版本是2.4的話,應該這麼寫ui

<Directory "/Users/apple/Sites/">
  Options Indexes MultiViews
  AllowOverride All
  # OSX 10.10 / Apache 2.4
  Require all granted
</Directory>
相關文章
相關標籤/搜索