简体   繁体   English

Laravel缓存将多个子域上的多个Laravel应用程序视为同一应用程序?

[英]Multiple Laravel applications on multiple subdomains treated as same app by Laravel cache?

I've created 2 applications, deployed them to my server, created Apache VirtualHosts for them and I encountered really strange problem. 我创建了2个应用程序,将它们部署到我的服务器上,为它们创建了Apache VirtualHosts,我遇到了一个非常奇怪的问题。 Lets say that applications are hosted on sub1.maindomain.com and sub2.maindomain.com. 可以说,应用程序托管在sub1.maindomain.com和sub2.maindomain.com上。 When I restart Apache and go to sub1.maindomain.com everything works fine but after that when I visit sub2.maindomain.com I'm getting html from the previous application. 当我重新启动Apache并转到sub1.maindomain.com时,一切正常,但是此后,当我访问sub2.maindomain.com时,我从先前的应用程序中获取了html。 If I restart the server once again and visit sub2.maindomain.com first i have exactly the same problem with the first application. 如果我再次重新启动服务器并首先访问sub2.maindomain.com,则第一个应用程序将出现完全相同的问题。 I've tried migrating to Nginx from Apache hoping that I've messed up some configuration but nothing changed. 我曾尝试从Apache迁移到Nginx,希望我弄乱了一些配置,但没有任何改变。 It looks like some problem with Laravel caching, everything else works fine, problem only occurs when I have two (or more) Laravel applications as subdomains, I also have other subdomain which is just raw html and it works just fine. 看来Laravel缓存存在一些问题,其他一切工作正常,只有当我有两个(或多个)Laravel应用程序作为子域时,才会出现问题,我还有另一个子域,它只是原始html,并且工作得很好。

This is my virtual host configuration for sub1.maindomain.com 这是我的sub1.maindomain.com虚拟主机配置

<VirtualHost *:80>
    ServerName sub1.maindomain.com
    ServerAlias www.sub1.maindomain.com 
    ServerAdmin www@sub1.maindomain.com
    DocumentRoot /var/www/sub1.maindomain.com/public
    DirectoryIndex index.php

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/sub1.maindomain.com/public>
        DirectoryIndex index.php
        AllowOverride ALL
    </directory>
</VirtualHost>

Configuration for sub2.maindomain.com is analogical. sub2.maindomain.com的配置是类似的。 I've created both applications using laravel new {name} command, just like they recommend in documentation. 我已经使用laravel new {name}命令创建了这两个应用程序,就像它们在文档中建议的一样。

尝试这个:

apt-get remove php5-xcache

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

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