Learn how to set up multiple websites in Apache in Magento admin in a few steps,
The following step helps you to set up multiple websites in Apache. Listed are:
Build your Amazon-like multi-vendor marketplace website @ $249/- now!!!
How to set up multiple websites in Apache in the Magento admin?
To create websites, stores, and store views in the Magento admin,
- Log in to the Magento admin as an official user to create websites, store and store views.
- Tap on stores >setting> all stores.
- On the store option, select Main Website Store.
- In the Name field, type the name to identify.
- In the code field, enter a unique code.
- In the status field, select disable
- In sort order, type an elective numerical sort order
- Click on save store view.
To create a cache virtual host IN Magento
- Open a virtual host configuration file in the text editor. Root privileges
- For example, open /etc/httpd/conf/httpd.conf
- Locate the section starting with<VirtualHost *80>.
- Create the following virtual host after any offered virtual host.
<VirtualHost *:80> ServerName mylocalsite.com DocumentRoot /var/www/html/magento2/pub/ </VirtualHost> <VirtualHost *:80> ServerName french.mylocalsite.com DocumentRoot /var/www/html/magento2/pub/ SetEnv MAGE_RUN_CODE "french" SetEnv MAGE_RUN_TYPE "website" </VirtualHost> <VirtualHost *:80> ServerName german.mylocalsite.com DocumentRoot /var/www/html/magento2/pub/ SetEnv MAGE_RUN_CODE "german" SetEnv MAGE_RUN_TYPE "website" </VirtualHost>
- Save your changes to httpd.conf and exit the text editor
- To restart apache:
- Centos: service httpd restart
- Ubuntu: service apache 2 restart
To verify your sites
- Open the operating system host file
- Add the static root in the format:
- <ip address>French.mylocalsite.com
- <ip address>german.mylocalsite.com
- Go to one of the following browsers
http://french.mylocalsite.com/frenchstoreview http://german.mylocalsite.com/germanstoreview
The above-mentioned step shows you how to set up multiple websites in Apache in Magento 2 admin.
Want to develop an online store with Magento? Click here and start today!!!
Leave a Reply