Two applications on the same server and the connections to BD are crossed

2

I have two applications on a single server, APP1 and APP2, each one with its own database, from one moment to another I enter APP2 and I see the information of the APP1 Database, they have different app_key, I put a different driver cache, change it to a session name by cookie, I do not know why it starts taking the connection of the other.

Files requested [ link

APP_ENV=production
APP_KEY=base64:pE+ZHzpoaj0/F/mFXiVGUQUw8B/gUEQ0uVXfff
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db1
DB_USERNAME=udb1
DB_PASSWORD=clavedb1

BROADCAST_DRIVER=log
CACHE_DRIVER=database
SESSION_DRIVER=cookie
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET= 

-

APP_ENV=production
APP_KEY=base64:LxzLj5z0pvrDRavViw9NtmoYuasdlkfñasjkdfla
APP_DEBUG=false
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=db2
DB_USERNAME=udb2
DB_PASSWORD=clave2

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=cookie
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_KEY=
PUSHER_SECRET=
# Virtual Hosts
#

<VirtualHost *:8071>
    ServerName localhost
    DocumentRoot E:/app1/public
    <Directory  "E:/app1">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
    </Directory>
</VirtualHost>


<VirtualHost *:8072>
    ServerName app2
    DocumentRoot E:/app2/public
    <Directory  "E:/app2">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All

    </Directory>
</VirtualHost>
    
asked by Alex Diaz 04.09.2017 в 16:29
source

1 answer

1

Summary

Change the APP_URL parameter of your .env file to reflect the actual URL of each application.

Explanation

Several Laravel commands and tools such as Artisan, the jobs, CLI, as well as several routing helpers and in general everything that has to do with routes such as Facades, Service Providers, among others, use the value of the parameter APP_URL to generate values that are reused in many "points" of the application, hence the importance of defining the specific and real URL of each app.

    
answered by 05.09.2017 / 03:05
source