简体   繁体   English

Ubuntu(和apache2)升级后,本地laravel网络应用无法正常运行

[英]Local laravel web apps are not working properly after Ubuntu (and apache2) upgrade

After upgrading to Ubuntu 14.04 from 13.10, a new version of apache2 (2.4.7) was installed too. 从13.10升级到Ubuntu 14.04后,还安装了新版本的apache2(2.4.7)。 I moved all my local web apps from var/www to var/www/html which is the new default apache2 document root on Ubuntu 14.04. 我将所有本地Web应用程序从var/www移至var/www/html ,这是Ubuntu 14.04上新的默认apache2文档根。

My web apps are developed with Laravel and run on different vhosts like so: example1.dev , example2.dev . 我的Web应用程序是使用Laravel开发的,并且可以在不同的虚拟主机上运行,​​例如: example1.devexample2.dev So I also changed the DocumentRoot directive in their configuration files with the correct path. 因此,我还使用正确的路径更改了其配置文件中的DocumentRoot指令。

I can access the home page with no problems but any other route returns a 404 error. 我可以毫无问题地访问主页,但是任何其他路由都会返回404错误。 What do I need to change to fix this? 我需要更改以解决此问题?

ps: During upgrade, the apache2.conf file was completely overwritten. ps:升级期间, apache2.conf文件被完全覆盖。

After updating your DocRoot you generally need to update this section also in your vhost files 更新DocRoot之后,通常还需要在vhost文件中更新此部分

<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>

(Just an example) (只是一个例子)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM