Need help with “multi-stores” in Magento?
To start off, create the new website in Magento admin under “System>Manage Stores. Create a Website, a Store and a Store View. This is fairly straightforward and can be found easily on the Magento website as well as other sites. The difficult part follows below. If you don’t understand the following steps, you may want to contact someone to do the setup for you, especially if you’re not familiar with SSH.
Your “virtual store” or additional store in Magento will need an index.php file. This file will include all the information that your additional store in Magento will need to function. Basically, this index file will point the web browser to the necessary Magento core files. Modify the Magento index file by doing the following:
Find the line that reads:
/**
* Error reporting
*/
error_reporting(E_ALL | E_STRICT);
/**
* Compilation includes configuration file
*/
$compilerConfig = ‘includes/config.php’;
if (file_exists($compilerConfig)) {
include($compilerConfig);
}
$mageFilename = ‘app/Mage.php’;
The vhost.conf file in the new website looks like this:
<Directory /var/www/vhosts/domain2.com/httpdocs> php_admin_flag engine on php_admin_value open_basedir “/var/www/vhosts/maindomain.com/httpdocs:/var/www/vhosts/domain2.com/httpdocs:/tmp” </Directory>
You will also need a vhost_ssl.conf file in your conf directory. It is the same as the above.
You will need symlinks from the domain2 site to the maindomain for the following directories:
app
js
media
skin
var
The symlink code looks like this:
ln -s /var/www/vhosts/maindomain.com/httpdocs/app/ /var/www/vhosts/domain2.com/httpdocs/
To update the server, you will need to run this command:
