403错误Apache的一个项目laravel,升级到Ubuntu 13.10后 [英] 403 error on Apache for a laravel project, after upgrade to Ubuntu 13.10
问题描述
我升级到Ubuntu 13.10。在更新后运行Apache的第一时有丢失/损坏文件,所以我干脆重新安装了Apache。我备份的虚拟主机文件。
I upgraded to Ubuntu 13.10. At first when running apache after the update, there were missing/broken files, so I simply re-installed apache. I backed up the vhost file.
当试图从浏览器访问我的Laravel的项目,它得到一个403错误。我已经改变了根文件夹多次的权限,但它仍然是禁止的。我不相信这是一个laravel问题,因为我已经固定它在13.04,而我使用的是相同的文件。
When trying to access my Laravel project from the browser, it get a 403 error. I have changed the permissions of the root folder multiple times, but it is still forbidden. I do not believe this is a laravel problem, as I already fixed it on 13.04, and I am using the same files.
下面是我的000-default.conf文件位于/启用站点和/站点可用。我的apache2.conf文件是不变的,因为安装。
Here is my 000-default.conf file, located in /sites-enabled and /sites-available. My apache2.conf file is unchanged since install.
<VirtualHost *:80>
DocumentRoot /home/brennan/development/MasonACM/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/brennan/development/MasonACM/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
这也应该是重要的是要注意的是我的.htaccess文件不丢失,而且由于网站工作的13.04一直没有改变。
It should also be important to note that my .htaccess file is not missing, and hasn't been changed since the site was working on 13.04.
更新:
我有Apache的主机设置现在的工作,但现在的浏览器显示的index.php的实际code,Apache不使用PHP由于某种原因的意思。我只是检查已安装PHP,那么,为什么不是在Apache承认它?
I have apache's host settings working now, but now the browser is displaying the actual code of index.php, meaning apache isn't using php for some reason. I just checked that php was installed, so why wouldn't apache recognize it?
推荐答案
Apache2的可能也已经升级到版本 2.4
,有几件事情要注意。
Apache2 may have also been upgraded to version 2.4
, and there are a few things to note.
第一,你的Apache 2.4.x的+现在呢?通过运行检查:
First, do you have Apache 2.4.x+ now? Check by running:
$ apache2 -v
如果是这样,您的虚拟主机需要一些调整:
If so, your vhost needs some adjustment:
一些选项
参数需要+/-语法。 在这里阅读更多。一些指令混合+/-时(读取previous链接查看更多)这可能是特别重要的。
Some Options
parameters needs the +/- syntax. Read more here. This might be especially important when mixing +/- on some directives (read the previous link to see more).
修改
Options Indexes FollowSymLinks MultiViews
到
Options +Indexes +FollowSymLinks +MultiViews
二:允许/拒绝
现在阿帕奇通过做访问控制 mod_authz_host
修改
Order allow,deny
Allow from all
到
Require all granted
一些更多的信息在这里升级来自Apache 2.2至2.4 。
这篇关于403错误Apache的一个项目laravel,升级到Ubuntu 13.10后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!