问题描述
我一直在运行放浪成功地为一个星期左右。昨天晚上,我跑到漂泊不定重装,现在我不能再访问我的网站。
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.
- 版本的VirtualBox 4.2.16
- 流浪版本1.2.7
- 我Vagrantfile和bootstrap.sh:
- 运行在Mac
我的文件住在/游民/站点。起初,我的欢迎页面,它住在/流浪者/ AT
My files live at /vagrant/Sites. At first my "welcome page" which lives at /vagrant/Sites rendered at
http://localhost:4567/
我所有的项目正在站点文件夹。例如,/游民/网站/测试不会呈现的index.html。我得到以下
All my projects are folders under Sites. For example, /vagrant/Sites/test won't render index.html. I get the following
禁止
您没有权限访问/在此服务器上。
在本地主机端口4567的Apache / 2.4.6(Ubuntu的)服务器
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。我的项目文件由流浪者拥有和chmod'ed 0777。
The vhosts are owned by root. My project files are owned by vagrant and chmod'ed 0777.
没有成功后,我做了全面的流浪汉灭其次是无业游民了,然后本地主机的主机欢迎页面停止使用被禁止的错误渲染为好。
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,在configs了变化。确保你的从
允许。 (如果你仍然在2.2,你会希望确保他们说所有
语句现在读要求所有批准所有允许
而不是所有
单独,或设置你的℃的默认值;目录/&GT;>)在这两种情况下,你可以在每个
&LT设置此
主的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.
获得更多晦涩,你可以检查,虽然我pretty肯定这不是在Ubuntu present默认。 (这是在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禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!