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错误.我已经多次更改根文件夹的权限,但它仍然是禁止的.我不相信这是一个拉威尔的问题,因为我已经在13.04修复了它,我使用相同的文件.

这是我的默认设置.conf文件,位于/sites enabled和/sites available中.我的apache2.conf文件自安装后保持不变.

<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网站运行以来,该文件一直没有更改.

UPDATE:

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 may have also been upgraded to version 2.4, and there are a few things to note.

First, do you have Apache 2.4.x+ now? Check by running:

$ apache2 -v

If so, your vhost needs some adjustment:

First: +/- on Options:

大约Options个参数需要+/-语法.Read more here.在某些指令上混合+/-时,这一点可能特别重要(阅读上一链接了解更多信息).

Change:

Options Indexes FollowSymLinks MultiViews

致:

Options +Indexes +FollowSymLinks +MultiViews

Second: Allow/Deny

Apache now does access control via mod_authz_host

Change:

Order allow,deny
Allow from all

致:

Require all granted

这里有更多关于upgrading from Apache 2.2 to 2.4的信息.

Laravel相关问答推荐

拉威尔望远镜没有显示请求细节

模型文件名更改数据库中的表名

Laravel 从 5.1 升级到 5.2.0 错误

Laravel 如何处理来自浏览器的 PUT 请求?

在 laravel 查询构建器中使用多个 where 子句

Laravel 4:读取由 javascript 设置的 cookie

用 laravel 表单确认删除?

Laravel 5 文件下载:stream() 或 download()

如何在 laravel blade中进行一次性推送

如何卸载 Laravel?

如何在 Laravel Eloquent 中 Select 某些字段?

导航栏品牌中的 Laravel 动态页面标题

Laravel Eloquent 在子查询中有两个WHERE NOT IN

在 Laravel 5 中找不到类App\Http\Controllers\Artisan

如何清理 Laravel Bootstrap 缓存配置文件?

将 Laravel 集合排序为 ID 数组

在 laravel 中安装 vue 3.0

如何在 Laravel 中动态更改 .env 文件中的变量?

将图像保存在公共文件夹中,而不是存储 laravel 5

如何在没有日志(log)、没有信息的情况下调试 Laravel 错误 500