Mac下配置Apache时遇到的 Forbidden You don't have permission to access /HelloMac.htm on this server. 看了论坛里说的,按着改了http.conf 配置文件还是不对,而且 setenforce 0 命令不能用,这是怎么回事呢?求大神指导啊,急!!!!!!
看下你的httpd.conf文件中的DocumentRoot与Directory是否修改了默认值, 我也遇到同样的问题, 将这两个路径修改为了默认值之后, 访问localhost就提示"It works!"(成功)了.
默认路径:
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Library/WebServer/Documents/"
<Directory "/Library/WebServer/Documents/">
不应该吧,如下配置不对吗
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#DocumentRoot "/Library/WebServer/Documents"
DocumentRoot "/Users/LiuZhen/Sites"
——————————————————————
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
——————————————————————
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#<Directory "/Library/WebServer/Documents">
<Directory "/Users/LiuZhen/Sites">
——————————————————————————————————