In Ecommerce Applications, Hosting Guides

Creating a Magento multistore within Plesk (VPS/Dedicated)

Stefan Posted by

Requirements

  • Root shell (ssh) access
  • Experience using shell-based text editors (not covered) or moving files with the shell (not covered)
  • Preconfigured domains for hosting within your Hosting Control Panel (see here)
  • One domain (your ‘parent’ domain) must have Magento installed

     

Step 1: Configuring Magento

You can use this guide for an explanation of how multiple stores work and can be configured within the Magento admin panel. You should create your multiple websites/stores first here as you will need these settings when you are configuring the passthrough index.php in your webspace.


 

Step 2: Configuring Plesk

To enable a multistore setup within Plesk you specifically need to relax OpenBaseDir restrictions to allow different domains on the server to talk to each other. This can only be done with the use of custom configuration files within your Plesk domain configuration, and you can only write custom configuration files as root.

Once you have become the root user you should navigate to the following directory of your first ‘child’ store:

If you check the contents of this directory you will find a file named httpd.include, this is the configuration file for the domain and should not be touched as Plesk will frequently rebuild and rewrite this file.

We are going to create two files, both with identical content, the first file covers http requests, the second https (encrypted) requests.

The first file to be created is vhost.conf, and to create it using vim you would type:

The following data (adjusted for your particular configuration) should be inserted into the text editor (to start typing in Vim simply press ‘a’, then everything you type will pushed to the screen). You should type this data manually rather than pasting as all lines and line breaks should remain intact, and this will not happen if the data is pasted.  Please note that there are only three lines.

<Directory /var/www/vhosts/CHILD_DOMAIN_NAME/httpdocs>
php_admin_value open_basedir “/var/www/vhosts/CHILD_DOMAIN_NAME/httpdocs:/var/www/vhosts/PARENT_DOMAIN_NAME/httpdocs:/tmp”
</Directory>

Once you have entered this data you can save and exit from Vim with the following command sequence : ESC : w q RETURN (Escape Key, Colon, w, q and then return)

You should then repeat the above process for the SSL configuration file:

After the two files have been created its necessary to alert Plesk to the presence of these files, you can do this by running the following command:

If you receive any error after running this command you should delete the two files created, then rerun the command. If you still receive errors you should contact support immediately as its possible that your web server will no longer be running.

Assuming you received no errors you should continue.

Step 3: Adding a passthrough index.php to the child domain

The following file (index.php) needs to be reconfigured to your needs and added to the web root of the child domain:

Stefan

Author Stefan

More posts by Stefan

Talk with one of our hosting experts today


Or call 0800 033 7074