Apache的本地主机403错误与约塞米蒂 [英] Apache localhost 403 error with Yosemite
问题描述
我刚刚安装了Mac OS X的优胜美地清新。我配置Apache和chmodded用户/用户/网站为755。当我打本地主机,我收到一个403 紫禁城您没有权限访问/在此服务器上
。发生与任何其他网站我添加到我的hosts文件同样的事情。
I've just installed Mac OS X Yosemite fresh. I configured Apache and chmodded "users/user/Sites" to 755. When I hit localhost I receive a 403 Forbidden "You don't have permission to access / on this server"
. The same thing occurs with any other sites I add to my hosts file.
我试着以下配置从<帮助用户目录href=\"http://stackoverflow.com/questions/24583859/apache-localhost-username-not-working\">this后的 。在这个 加拿大家园线程的 知道这些家伙是Apache的问题,但没有提供很多建议。
I tried configuring user directories following help from this post. The guys on this MacRumors thread know there is an Apache issue, but didn't offer a lot of suggestions.
我的目录权限看起来像这样
My directory permissions look like this
drwxr-xr-x 29 root wheel 1054 Aug 11 07:30 /
drwxr-xr-x 6 root admin 204 Aug 11 07:29 /Users/
drwxr-xr-x+ 26 zachshallbetter staff 884 Aug 11 11:57 /Users/zachshallbetter/
0: group:everyone deny delete
drwxr-xr-x 5 zachshallbetter staff 170 Aug 11 10:16 /Users/zachshallbetter/Sites
任何人都可以提出任何建议或帮助?这里是链接到我的<一个href=\"https://gist.github.com/zachshallbetter/80f8a68383886aa4bc92\">hosts和 的httpd.conf 文件和的 错误日志的 ,以供参考。
推荐答案
您不想打开你的硬盘驱动器的全部到Web服务器的过程。事实上,行的httpd.conf
的215-217说:
You do NOT want to open up the entirety of your hard drive to the web server process. In fact, lines 215-217 of httpd.conf
say:
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
阿帕奇2.4(OSX 10.10优胜美地)有来自Apache 2.2(OSX 10.9)为目录结构不同在指令模块mod_authz_core 。
编辑: 如果你从一开始就设置Apache,请遵循的此指令集设置Apache和PHP在OSX 10.10优胜美地。的
If you are setting up Apache from the START, please follow this instruction set to setup apache and php on OSX 10.10 Yosemite.
假设你有 mod_userdir.so
已启用,你的问题是你的用户.conf文件(的/ etc / apache2的/用户/用户名之内。 CONF
),编辑(或添加)以下。
Assuming you have mod_userdir.so
enabled already, your problem is within your user .conf file (/etc/apache2/users/username.conf
), edit (or add) the following.
Apache 2.2的:
Apache 2.2:
<Directory "/Users/jnovack/Sites/">
Options Indexes MultiViews
AllowOverride All
# OSX 10.9 / Apache 2.2
Order from deny, allow
</Directory>
阿帕奇2.4
<Directory "/Users/jnovack/Sites/">
Options Indexes MultiViews
AllowOverride All
# OSX 10.10 / Apache 2.4
Require all granted
</Directory>
这篇关于Apache的本地主机403错误与约塞米蒂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!