我已经创建了2个应用程序,将它们部署到我的服务器,为它们创建了Apache VirtualHosts,我遇到了非常奇怪的问题。假设应用程序托管在 sub1.maindomain.com 和 sub2.maindomain.com 上。当我重新启动Apache并转到 sub1.maindomain.com 一切正常时,但是在那之后,当我访问 sub2.maindomain.com 时,我从以前的应用程序中获取html。如果我再次重新启动服务器并首先访问 sub2.maindomain.com,则第一个应用程序会遇到完全相同的问题。我尝试从Apache迁移到Nginx,希望我搞砸了一些配置,但没有任何变化。看起来 Laravel 缓存存在一些问题,其他一切正常,只有当我有两个(或更多)Laravel应用程序作为子域时才出现问题,我还有其他子域,它只是原始 html,它工作得很好。
这是我的虚拟主机配置 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>
sub2.maindomain.com 的配置是类比的。我已经使用 laravel new {name}
命令创建了这两个应用程序,就像他们在文档中推荐的那样。
试试这个:
apt-get remove php5-xcache