0
votes

I wish I had never seen this article: http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup

I have Apache 2.2 installed on my XP machine and until a while ago I had a Magento site that I could test the development of a custom module on. I decided that I wanted to have multiple websites and multiple stores so that I could test that my modules configuration variables set at the different scopes (global, website, and store) were working as expected.

So I followed the instructions in the above Magento article. I created a website and gave it a name of “paulsplace.com”. I created a couple of Stores under that website. I then went to System/Configuration/General/Web and, with the scope set to paulsplace.com, I set the unsecured and secured URLs to http://paulsplace.com/ and https://paulsplace.com/ and hit Save Config - what a mistake!!

I got a 404 error. And now I can’t get to my magento front end or back end.

I tried a couple of things: I added these lines to my hosts lookup file:

127.0.0.1    paulsplace.com
127.0.0.1    www.paulsplace.com

I then uncommented this line in my httpd,conf file: Include conf/extra/httpd-hosts.conf

and added the following to the conf/extra/httpd-hosts.conf file:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/Applications/Apache Software Foundation/Apache2.2/htdocs"
    ServerName paulsplace.com
    ErrorLog "logs/paulsplace.com-error.log"
    CustomLog "logs/paulsplace.com-access.log" common
</VirtualHost>

and restarted Apache.

If I browse to “http://www.paulsplace.com” I now get a page that just says “It works!”. Same for “http://paulsplace.com” and “http://www.paulsplace.com/magento/index.php”.

I tried a few more things - I added this line to httpd.conf: AccessFileName htaccess (I did this because Windows Explorer didn’t let me create a file starting with a dot; I could do it from the command prompt, but I believe what I have done should be ok).

I changed AllowOverride to All from None:

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>
<Directory "C:/Applications/Apache Software Foundation/Apache2.2/htdocs">
    AllowOverride All
</Directory>

and in C:\Applications\Apache Software Foundation\Apache2.2\htdocs\htaccess (a file that I created), I entered:

SetEnvIf Host www\.paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host www\.paulsplace\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^paulsplace\.com MAGE_RUN_CODE=pws1
SetEnvIf Host ^paulsplace\.com MAGE_RUN_TYPE=website

(pws was the value I used for the “Code” when creating my store).

Please tell me how I can put this right. I feel like I’m taking one step forward and three backward at the moment. Any help really would be greatly appreciated.

2
You should post some details about the paths related. From what you posted it reads like you have your Magento installed in the htdocs directory. - Lee Saferite

2 Answers

2
votes
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "Change this to point at your magento install"
    ServerName paulsplace.com
    ErrorLog "logs/paulsplace.com-error.log"
    CustomLog "logs/paulsplace.com-access.log" common
    SetEnv MAGE_RUN_TYPE website
    SetEnv MAGE_RUN_CODE pws1
</VirtualHost>
1
votes

If changing anything in System Configuration borks your system, you can always clear out the bad values in the database directly, and clear your Magento cache. Do a

select * from core_config_data where value LIKE '%paulsplace.com%'

This will give you the two rows that were added when you clicked save. Remove the rows. Next, clear out all the files in

var/cache/*

to clear your cache. Then restore your Apache config to what it was before you started monkeying around. This should restore your site back to its previous state, and you can continue to experiment with things.