无业游民 403 禁止 [英] Vagrant 403 Forbidden

查看:26
本文介绍了无业游民 403 禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功运行 Vagrant 大约一个星期了.昨晚我运行了 vagrant reload,现在我无法再访问我的网站.

I've been running Vagrant successfully for about a week. Last night I ran vagrant reload and now I can no longer access my sites.

我的文件位于/vagrant/Sites.起初我的欢迎页面"位于/vagrant/Sites 呈现在

My files live at /vagrant/Sites. At first my "welcome page" which lives at /vagrant/Sites rendered at

http://localhost:4567/ 

我所有的项目都是站点下的文件夹.例如,/vagrant/Sites/test 不会呈现 index.html.我得到以下

All my projects are folders under Sites. For example, /vagrant/Sites/test won't render index.html. I get the following

禁止

您无权访问此服务器上的/.Apache/2.4.6 (Ubuntu) 服务器在 localhost 端口 4567

You don't have permission to access / on this server. Apache/2.4.6 (Ubuntu) Server at localhost Port 4567

虚拟主机看起来像:

<VirtualHost *:80>
  DocumentRoot "/vagrant/Sites/test"
  ServerName test
  <Directory "/vagrant/Sites/test">
    AllowOverride All
  </Directory>
</VirtualHost>

虚拟主机归 root 所有.我的项目文件归 vagrant 和 chmod'ed 0777 所有.

The vhosts are owned by root. My project files are owned by vagrant and chmod'ed 0777.

在没有成功之后,我做了一个完整的 vagrant 销毁,然后是 vagrant up,然后本地主机欢迎页面也停止渲染,出现禁止错误.

After no success, I did a full vagrant destroy followed by vagrant up and then the localhost host welcome page stopped rendering as well with the forbidden error.

推荐答案

我的预感是这根本不是一个流浪问题,而仅仅是 Apache 配置故障.我可以考虑检查一些事情.

My hunch is that this is not a vagrant issue at all but solely an Apache configuration glitch. There are a few things I can think to check.

显然,首先要确认运行apache的用户对DocumentRoot文件夹具有读取和执行权限.

First, obviously, is to confirm that the user that apache is running under has read and execute permissions for the DocumentRoot folder.

既然你提到了 Apache 2.4,从2.2.确保您的 Allow from all 语句现在变为 Require all allowed.(如果您仍在使用 2.2,您需要确保他们说的是 Allow from all 而不是 Deny from all.)在任何一种情况下,您都可以在每个 单独,或在主 httpd.conf 文件的 块中设置默认值.

Since you mentioned Apache 2.4, there have been changes in the configs from 2.2. Make sure your Allow from all statements now read Require all granted. (If you were still on 2.2, you'd want to make sure they said Allow from all instead of Deny from all.) In either case, you can set this in each <VirtualHost> individually, or set a default in your <Directory /> block of the main httpd.conf file.

变得更加模糊,你可以检查 selinux,尽管我很确定这是'默认情况下不存在于 Ubuntu 中.(例如在 CentOS 中.)

Getting more obscure, you could check for selinux, although I'm pretty sure this isn't present in Ubuntu by default. (It is in CentOS, for example.)

这篇关于无业游民 403 禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆