I'm trying to setup Multi website in AWS server. I found several solution for Multi website implementation.
In my case, There are two different servers(assume 0.0.0.1 and 0.0.0.2) where magento has installed on both the servers. I need to unlink the server configuration for 0.0.0.1 Magento and make 0.0.0.2 as default website and configure 0.0.0.1 as multi website in 0.0.0.2. I have done the multi website, store and storeview configuration in 0.0.0.2.
How do I update the server configuration for 0.0.0.1? Should I update its virtual host or /etc/nginx/nginx.conf or /etc/nginx/sites-available/magento or any other files to point to 0.0.0.2.
If this is resolved then I should be able to proceed with next steps in order to complete the multi website implementation.
We use nginx as web server. Using AWS server for development purpose.
-
I created multi website for AWS public ec2 domain and for its IP address. You can refer here. magento.stackexchange.com/questions/193679/…TS Guhan– TS Guhan2022年08月05日 12:27:52 +00:00Commented Aug 5, 2022 at 12:27
1 Answer 1
you need to replace this code to magento index.php
<?php
try {
require __DIR__ . '/../app/bootstrap.php';
} catch (\Exception $e) {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
<h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
Autoload error</h3>
</div>
<p>{$e->getMessage()}</p>
</div>
HTML;
exit(1);
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website_code'; //Webite code as same in admin panel
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);
-
Want to know that how the main server receive the request from 0.0.0.1. And the solution which you provided to be added in 0.0.0.2 Magento right?TS Guhan– TS Guhan2022年07月25日 12:36:00 +00:00Commented Jul 25, 2022 at 12:36
-
are you using single magento for multiple websites right ?Sanjay Shiyal– Sanjay Shiyal2022年07月26日 06:32:59 +00:00Commented Jul 26, 2022 at 6:32
-
Yes like I said, each ip has installed with Magento. I want to use 2nd server as Main website and 1st ip for multi website. Also, want to know that how do I unlink Magento from 1st server and point to 2nd server. And use them(IP) for multi website.TS Guhan– TS Guhan2022年07月26日 07:08:28 +00:00Commented Jul 26, 2022 at 7:08