apache - 在 Mac OS X10.8 上访问 localhost 时出现 403 Forbidden 错误

标签 apache permissions osx-mountain-lion

我已按照本教程在 Mac OS X 10.8 ( http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion ) 上设置 Apache、MySql 和 PHP

当我转到“Localhost”时,出现以下错误:

Forbidden

You don't have permission to access / on this server.

当我转到“Localhost/~benthompson”时,它工作正常。

当我完成教程的一半时,“Localhost”确实起作用了,后来它停止了它的工作。

大概是权限问题,但在哪里?

最佳答案

要解决该问题,请查看此链接 http://www.coolestguidesontheplanet.com/downtown/how-set-virtual-hosts-apache-mac-osx-109-mavericks-and-osx-108-mountain-lion阅读“丢失本地主机”部分。

在 httpd.conf 文件中启用 vhosts 后,就会发生该错误。
通过取消注释这一行:

Include /private/etc/apache2/extra/httpd-vhosts.conf

在 httpd-vhosts.conf 中添加此项将解决您的问题。请记住在此之前添加新的虚拟主机:D
<VirtualHost *:80> 
   ServerName localhost
   DocumentRoot /Library/WebServer/Documents/
</VirtualHost>

我希望这能解决你的问题!

关于apache - 在 Mac OS X10.8 上访问 localhost 时出现 403 Forbidden 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18750184/

相关文章:

php - 我无法运行 xampp - MySQL 意外关闭

apache - tomcat 或 apache 自动编码重定向 url

linux - WordPress unzip_file() 导致 mkdir_failed(权限)

python-2.7 - 使用 Homebrew 和 PIP 让 Fabric 在 Mountain Lion 上工作

java - Windows 7/8 和 OS X 上的 Emacs SmartCompile for Java

apache - 如何在 Nginx 中使用 .htaccess 文件?

apache - 使用 nginx 作为反向代理运行 Apache Zeppelin

.net - 我可以在 Vista 上监听端口(使用 HttpListener 或其他 .NET 代码)而不需要管理员权限吗?

permissions - Liferay - 如何通过检查用户权限来隐藏/显示按钮

ruby-on-rails - 安装 rails-4.0.0 时出错