##how can Set up Magento2 backend on a separate node?
I want to install magento in 3 servers,
Anyone achieved that?
Created internal issue MAGETWO-60159 to track.
Any updates to this?
yes, here a solution
Here my proposal
Our goal will be to achieve this one
We'll set as database server Server3
array (
'table_prefix' => 'mg_',
'connection' =>
array (
'default' =>
array (
'host' => '192.168.207.130,
'dbname' => 'mage',
'username' => 'myUser',
'password' => 'myPassword',
'active' => '1',
),
),
),
'session' =>
array (
'save' => 'db',
),
"Stores->Configuration->General->Web->Url Options->Auto-redirect to Base URL" to "No"
"Stores->Configuration->Advanced->Admin->Admin Base Url->Use Custom Admin URL" to "Yes"
"Stores->Configuration->Advanced->Admin->Admin Base Url->Custom Admin URL" to "https://192.168.207.129/magetest/"
aptitude install nfs-kernel-server nfs-common
nano /etc/exports
/var/www/magetest/pub/media 192.168.207.129/32(rw,insecure,nohide,sync,anonuid=48,anongid=48)
service nfs-kernel-server restart
aptitude install nfs-client nfs-common
rm -r /var/www/magetest/pub/media/*
mount 192.168.207.128:/var/www/magetest/pub/media /var/www/magetest/pub/media
rm -r /var/www/magetest/var/cache/*
rm -r /var/www/magetest/var/page-cache/*
rm -r /var/www/magetest/var/generation/*
php /var/www/magetest/bin/magento cache:clean
http://192.168.207.128/magetest
https://192.168.207.129/magetest/admin/
@jorbope If you'll submit this to us in a PR, I will use your name as a contributor similar to this page: http://devdocs.magento.com/guides/v2.1/test/integration/integration_test_execution_phpstorm.html (Upper right corner)
I'd suggest you add a new file here: https://github.com/magento/devdocs/tree/develop/guides/v2.0/config-guide
Don't' worry too much about formatting, I'll fix that.
OK
Just a few comments:
Yes, you are right.
Another addition - instruction on how to pass admin traffic to the admin node should be added. It could be redis, aws elb or smth else + probably separate subdomain
@samm-git Can you clarify/amplify? Thanks
Sure. If we are adding > 1 node we should also load balance traffic between them. If we want to make admin node - we should route admin traffic (and only to it) based on subdomain or path
Hi All,
I'm facing the issue while configuring Magento backend on another server.
Example:
server1: 192.168.207.142 : front: http://192.168.207.142/magetest
server2: 192.168.207.143 : backend: https://192.168.207.143/magetest/admin/
server3: 192.168.207.144 : database
I have tried these steps mentioned in this article:
https://github.com/magento/devdocs/issues/802#issuecomment-275545778
After did the changes admin is redirected to 404 page.
Does anyone have a solution for this issue?
Thanks in advance.
Regards,
-Vimal
@jorbope Not working. Still getting infinite redirections from front-end to back-end. Using Redis session storage and EFS for media folder sharing.
Most helpful comment
yes, here a solution
First of all, We have to install magento in Server1 and configure it as you wish.
Here my proposal
Our goal will be to achieve this one
Then, In server1 we have to modify the file "/var/www/magetest/app/etc/env.php"
We'll set as database server Server3
And set this config to save sessions in the database, you can use Redis or other options for that, but this time we'll use the database.
Now we have to duplicate magetest from server1 to server2
In server1 Set this config at backend:
"Stores->Configuration->General->Web->Url Options->Auto-redirect to Base URL" to "No"
"Stores->Configuration->Advanced->Admin->Admin Base Url->Use Custom Admin URL" to "Yes"
"Stores->Configuration->Advanced->Admin->Admin Base Url->Custom Admin URL" to "https://192.168.207.129/magetest/"
In server1 we have to install "nfs-kernel-server" to share the directory "/var/www/magetest/pub/media/" with server2:
aptitude install nfs-kernel-server nfs-commonNow modify the file "/etc/exports", to share the media directory "/var/www/magetest/pub/media/":
nano /etc/exports/var/www/magetest/pub/media 192.168.207.129/32(rw,insecure,nohide,sync,anonuid=48,anongid=48)
service nfs-kernel-server restartGo to server2 to install and configure nfs-client
aptitude install nfs-client nfs-commonDrop the content of /var/www/magetest/pub/media/
rm -r /var/www/magetest/pub/media/*Mount the new directory using nfs-client
mount 192.168.207.128:/var/www/magetest/pub/media /var/www/magetest/pub/mediaImportant: You'll have to configure the file "/etc/fstab" to maintain the configuration as permanent
In both servers drop the content of these directories:
rm -r /var/www/magetest/var/cache/*rm -r /var/www/magetest/var/page-cache/*rm -r /var/www/magetest/var/generation/*And finally, execute this command in both servers
php /var/www/magetest/bin/magento cache:cleanNow everything should be working, frontend, backend and database in separate nodes
http://192.168.207.128/magetest
https://192.168.207.129/magetest/admin/