I am working for a company, and we are looking to expand to another domain that we own. We have a couple in house servers for testing that mimic the live server. We have at any given time up to ten "play" sites on a box, including the live server (although we don't use the live server for any play sites unless we are getting outside help.)

The conditions are:

  • Each play site has its own virtualhost entry in the httpd.conf file
  • Each play site has its own directory in /var/www
    • ie. play1 is in /var/www/play1, where as play2 is in /var/www/play2
  • All play sites have their own IP address (whether on the internal net or internet, doesn't matter)
  • We are able to assign as many IP's as needed to a single box
  • We do not use wildcard entries in our virtualhost entries
  • We want separate themes for each domain/store, while sharing the customer database between sites/stores.

In our attempts to do this on our own, we are able to get the Magento install to use both IP addresses we assign to it, but when we try to differentiate, Magento doesn't do anything regarding the theme, catalog, or anything. It just shows us the same site on both IP addresses, even after defining the Base URL for each store.

I am under the impression that some core files regarding the themes were modified when the original webmaster created the site. I can provided copies of files upon request.

  • What version of Magento are you running? This should be right out of the box Magento functionality. Have you contacted your system administrator? This seems to point to more of a system issue. Never edit core code.
    – kab8609
    Commented Dec 23, 2013 at 15:49
  • Magento, and the person who originally created the site no longer works with the company... i'm am the third person to truly get his hands dirty in the code of the company website. and to have this issue on 4 servers seems a little odd to me. On my personal server at home, running a core copy of Magento (not a live site copy) i can get it to work, but I am working within the parameters given to me by my boss... Commented Dec 23, 2013 at 15:54
  • Seeing how you are the third person working on this site, I would recommend seeing if you can reformat one of the servers. However if that is not an option, I would try to confirm if the virtualhosts are working properly (and post them here if possible). When you say "each site has its own directory", did you just copy and paste all the code to each directory or are they symbolic links? Using multi-stores with Magento only needs one directory.
    – kab8609
    Commented Dec 23, 2013 at 16:03
  • No matter how much i would like to start from scratch, i cannot do that unfortunately. and each test/play site has it's own database and directory. this way we can have multiple projects working at the same time. Commented Dec 23, 2013 at 16:11
  • Oh, then I wouldn't call this a multi-store setup then. Magento does multi-store completely differently then what you are trying to do. This would simply be "multi single store instances on the same box".
    – kab8609
    Commented Dec 23, 2013 at 16:16

1 Answer 1


You can have a single magento installation and 2 vhosts that define the environment variable to differentiate website :

SetEnv MAGE_RUN_CODE "base" # put here your website or store code
SetEnv MAGE_RUN_TYPE "website" # put here 'website' or 'store'

source : http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/navigation/multiple-website-setup

  • This works partly, I get a 404 page that has no style now on the second ip address Commented Dec 23, 2013 at 16:01
  • ok, so now you have 2 website, but one redirect to a 404 page... Define a specific 404 page for the second website to be sure it use the mage_run_* codes, a check that this website have a defined homepage (this is in the backoffice, system>config web tab, default pages)
    – dagfr
    Commented Dec 23, 2013 at 16:04
  • That is correct. Commented Dec 23, 2013 at 16:04
  • Sorry I clicked Enter by mistake, I updated my comment
    – dagfr
    Commented Dec 23, 2013 at 16:06
  • I will try that in a few minutes, waiting on a index update to complete. Commented Dec 23, 2013 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.