从 13.10 升级到 Ubuntu 14.04 后,也安装了新版本的 apache2 (2.4.7)。我将所有本地 Web 应用程序从 var/www
移出至var/www/html
这是 Ubuntu 14.04 上新的默认 apache2 文档根目录。
我的网络应用程序是用 Laravel 开发的,可以在不同的虚拟主机上运行,如下所示:example1.dev
, example2.dev
.所以我也改了DocumentRoot
指令在他们的配置文件中具有正确的路径。
我可以毫无问题地访问主页,但任何其他路由都会返回 404 错误。我需要改变什么来解决这个问题?
ps:升级过程中,apache2.conf
文件被完全覆盖。
最佳答案
更新您的 DocRoot 后,您通常还需要在您的虚拟主机文件中更新此部分
<Directory "var/www/html/example.dev/public">
Options +MultiViews
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
(只是一个例子)
关于apache - Ubuntu(和 apache2)升级后本地 laravel Web 应用程序无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23398536/