<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Splebly &#187; Magento</title>
	<atom:link href="http://www.splebly.com/tag/magento/feed" rel="self" type="application/rss+xml" />
	<link>http://www.splebly.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 03 Feb 2010 02:34:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting Up A Magento Staging Area</title>
		<link>http://www.splebly.com/setting-up-a-magento-staging-area</link>
		<comments>http://www.splebly.com/setting-up-a-magento-staging-area#comments</comments>
		<pubDate>Thu, 15 Jan 2009 19:33:39 +0000</pubDate>
		<dc:creator>Carrie-Anne</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">tag:google.com,2005:reader/item/23503016524b0074</guid>
		<description><![CDATA[The best way to test out a new Magento release without potentially destroying your production store is to setup a staging area.
A staging area is a duplicate of your primary store that you can use to see if the upgrade process will go smoothly, and als...]]></description>
			<content:encoded><![CDATA[<p>The best way to test out a new Magento release without potentially destroying your production store is to setup a staging area.</p>
<p>A staging area is a duplicate of your primary store that you can use to see if the upgrade process will go smoothly, and also allow you to use both the frontend and backend of your site to see if everything is running properly.</p>
<p><span></span></p>
<p>This article is written with our clients in mind, but the principles will apply no matter where you are hosted or what control panel you’re using.</p>
<h3>Jump To Section</h3>
<ul>
<li><a href="http://www.crucialwebhost.com/blog#create-staging-subdomain">Create Staging Subdomain</a></li>
<li><a href="http://www.crucialwebhost.com/blog#create-staging-database">Create  Staging Database</a></li>
<li><a href="http://www.crucialwebhost.com/blog#copy-production-store">Copy Production Store</a></li>
<li><a href="http://www.crucialwebhost.com/blog#update-configuration">Update Configuration</a></li>
<li><a href="http://www.crucialwebhost.com/blog#upgrade-staging-store">Upgrade Staging Store</a></li>
<li><a href="http://www.crucialwebhost.com/blog#cleanup-and-permissions">Cleanup &amp; Permissions</a></li>
<li><a href="http://www.crucialwebhost.com/blog#professional-upgrade-service">Professional Upgrade Service</a></li>
</ul>
<h2><a name="create-staging-subdomain"></a>Create Staging Subdomain</h2>
<p>The first thing we want to do is setup a subdomain for our staging store:</p>
<ol>
<li>
<p>Login to cPanel for your domain, and click on the <strong>Subdomains</strong> icon.</p>
</li>
<li>
<p>For both the <strong>Subdomain</strong> and <strong>Document Root</strong>, we’ll enter <strong><em>staging</em></strong>.</p>
</li>
<li>
<p>Click on the <strong>Create</strong> button.</p>
</li>
</ol>
<h2><a name="create-staging-database"></a>Create Staging Database</h2>
<p>While we’re still in cPanel, let’s setup a blank database for our staging store:</p>
<ol>
<li>
<p>Go back to the main screen for cPanel, and click on the <strong>MySQL Database Wizard</strong> icon.</p>
</li>
<li>
<p>For the <strong>New Database</strong>, we’ll enter <em><strong>staging</strong></em>.</p>
</li>
<li>
<p>Click on the <strong>Next Step</strong> button.</p>
</li>
<li>
<p>For the <strong>Username</strong>, we’ll enter <em><strong>staging</strong></em>, and for the <strong>Password</strong>, enter whatever you’d like here.</p>
</li>
<li>
<p>Click on the <strong>Next Step</strong> button.</p>
</li>
<li>
<p>Click on the box next to <strong>ALL PRIVILEGES</strong>.</p>
</li>
<li>
<p>Click on the <strong>Next Step</strong> button.</p>
</li>
</ol>
<h2><a name="copy-production-store"></a>Copy Production Store</h2>
<p>Now that our subdomain and database has been setup, we ned to copy our production store over to the subdomain directory.</p>
<ol>
<li>
<p>Login to SSH for your domain, and change to the <strong>staging</strong> folder:</p>
<ul>
<li><code>cd staging/</code></li>
</ul>
</li>
<li>
<p>Copy all of the data from the directory where Magento is installed, which is usually in the <strong>public_html</strong> directory, to the <strong>staging</strong> directory:</p>
<ul>
<li><code>cp -R ../public_html/* ../public_html/.htaccess .</code></li>
</ul>
</li>
</ol>
<p>For the next step, you’ll need to know the database information for the production store. If you don’t remember this, open up the following file:</p>
<ul>
<li><code>app/etc/local.xml</code></li>
</ul>
<p>Lines <strong>43-46</strong> will contain your hostname, username, password, and database name.</p>
<p>Next, we need to copy the data from the production database over to our staging database. We’ll be doing this from SSH as well. </p>
<ul>
<li><code>mysqldump -u PRODUCTION_DBUSER –p PRODUCTION_DBNAME &gt; data.sql</code></li>
</ul>
<p>You’ll be prompted to enter the <strong>password</strong> for the user that has privileges to the <strong>production</strong> database, so type that in and hit the <strong>Enter</strong> key.</p>
<p>This can take a couple seconds to a couple minutes depending on the size of your database, so just wait until it finishes.</p>
<p>Once it finishes, we need to import this data to our <strong>staging</strong> database:</p>
<ul>
<li><code>mysql -u STAGING_DBUSER –p STAGING_DBNAME &lt; data.sql</code></li>
</ul>
<p>Just like before, you’ll be prompted to enter a <strong>password</strong>, but this time it will be for the user who has privileges for the<strong> staging</strong> database.</p>
<h2><a name="update-configuration"></a>Update Configuration</h2>
<p>Using your favorite text editor, open up the following file from the <strong>staging</strong> directory:</p>
<ul>
<li><code>app/etc/local.xml</code></li>
</ul>
<p>Replace the values for <strong>lines 44-46</strong> with the database details for our <strong>staging</strong> database.</p>
<p>Now we need to do is update the <strong>Unsecure</strong> and <strong>Secure</strong> URL for our <strong>staging</strong> store:</p>
<ol>
<li>
<p>Login to cPanel for your domain, and click on the <strong>phpMyAdmin</strong> icon.</p>
</li>
<li>
<p>From the sidebar on the left, click on the <strong>_staging</strong> link.</p>
</li>
<li>
<p>Click on the <strong>SQL</strong> tab, and in the text area, run the following command:</p>
<ul>
<li><code>SELECT * FROM `core_config_data` WHERE `path` LIKE &#39;%base_url%&#39;;</code></li>
</ul>
</li>
<li>
<p>Click the <strong>Check All</strong> link and then click on the <strong>pencil icon</strong>.</p>
</li>
<li>
<p>Update the <strong>value</strong> fields with the URL for your staging site.</p>
</li>
<li>Click on the <strong>Go</strong> button at the very bottom to save your changes.</li>
</ol>
<h2><a name="upgrade-staging-store"></a>Upgrade Staging Store</h2>
<div>
<h3>WARNING</h3>
<p>Please read <a href="http://www.magentocommerce.com/wiki/groups/227/downloader_upgrades_wrong_store/">this article</a> in our <a href="http://www.magentocommerce.com/group/view/227/crucial-web-hosting/">Magento Group</a> <strong>before</strong> you upgrade your store! There are numerous posts on the Magento forum about users who have tried to upgrade a copied store and inadvertently upgraded the <strong>wrong</strong> store.</p>
</div>
<p>Now that our staging store is setup, we can upgrade it to make sure everything goes smoothly. These commands will be done via SSH in the <strong>staging</strong> directory.</p>
<p>A little cleanup first:</p>
<ul>
<li><code>rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*</code></li>
</ul>
<p>Set the permissions on the <strong>pear</strong> file so we can run it:</p>
<ul>
<li><code>chmod 550 pear</code></li>
</ul>
<p>Initialize the PEAR channel just in case:</p>
<ul>
<li><code>./pear mage-setup .</code></li>
</ul>
<p>And then we can upgrade:</p>
<ul>
<li><code>./pear upgrade-all</code></li>
</ul>
<p>If it tells you that there’s <strong>Nothing to upgrade</strong>, you’ll need to do this instead:</p>
<ul>
<li><code>./pear install magento-core/Mage_All_Latest</code></li>
</ul>
<h2><a name="cleanup-and-permissions"></a>Cleanup &amp; Permissions</h2>
<p>Lastly, we need to clear out any temporary and cached data. These commands will be done via SSH in the <strong>staging</strong> directory.</p>
<ul>
<li><code>rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*</code></li>
<li><code>rm -rf var/cache/ var/session/ var/report/ media/tmp/</code></li>
</ul>
<p>And then reset our file and directory permissions:</p>
<ul>
<li><code>find . -type f -exec chmod 644 {} \;</code></li>
<li><code>find . -type d -exec chmod 755 {} \;</code></li>
<li><code>chmod o+w var var/.htaccess app/etc</code></li>
<li><code>chmod 550 pear</code></li>
<li><code>chmod -R o+w media</code></li>
</ul>
<p>You can now open up your staging site in your browser to see if the upgrade process worked or not.</p>
<h2><a name="after-you-upgrade"></a>After You Upgrade</h2>
<p>After you upgrade your store, don’t assume everything is working correctly because your site is coming up without errors. Use this time wisely to go through your entire site, including the backend:</p>
<ul>
<li>If your  navigation has dropdown items, make sure they work</li>
<li>Search for a product to see if anything comes up in the results</li>
<li>Make sure you can add a product to your cart and purchase it</li>
<li>Check if your layered navigation is intact</li>
<li>Create or edit an existing product, making sure you can save it</li>
</ul>
<p>If you do come across any errors, check the <a href="http://www.magentocommerce.com/boards/">community forum</a> to see if others are experiencing the same issue.</p>
<p>If you can’t find anything, create a new thread to see if anyone can assist you.</p>
<p>It’s also a good idea to search the <a href="http://www.magentocommerce.com/bug-tracking/">bug tracker</a>. You can even help by submitting a new bug if you don’t find anything.</p>
<h2><a name="professional-upgrade-service"></a>Professional Upgrade Service</h2>
<p>Need help upgrading your store? Crucial offers a <a href="http://www.crucialwebhost.com/blog/professional-magento-upgrade-service/">professional upgrade service</a> to our clients.</p>
<p>To learn more about this service, please <a href="http://www.crucialwebhost.com/account/">login to the account center</a> and submit a ticket to the <strong>Magento</strong> department.</p>
<div>
<a href="http://feeds.feedburner.com/~f/cwh?a=FX1tXvt9"><img src="http://feeds.feedburner.com/~f/cwh?d=41" border="0"></a> <a href="http://feeds.feedburner.com/~f/cwh?a=DPaW5Mxr"><img src="http://feeds.feedburner.com/~f/cwh?i=DPaW5Mxr" border="0"></a> <a href="http://feeds.feedburner.com/~f/cwh?a=b1YeBWgY"><img src="http://feeds.feedburner.com/~f/cwh?i=b1YeBWgY" border="0"></a> <a href="http://feeds.feedburner.com/~f/cwh?a=CreH40o3"><img src="http://feeds.feedburner.com/~f/cwh?d=50" border="0"></a>
</div>
<p><img src="http://feeds.feedburner.com/~r/cwh/~4/cP3yIajcv04" height="1" width="1"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.splebly.com/setting-up-a-magento-staging-area/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Setup Multiple Magento Stores</title>
		<link>http://www.splebly.com/how-to-setup-multiple-magento-stores</link>
		<comments>http://www.splebly.com/how-to-setup-multiple-magento-stores#comments</comments>
		<pubDate>Sun, 28 Dec 2008 16:30:02 +0000</pubDate>
		<dc:creator>Carrie-Anne</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">tag:google.com,2005:reader/item/249a18228c54037b</guid>
		<description><![CDATA[There are numerous ways to setup multiple Magento stores that all share the same codebase and backend, but what method you use depends on your needs.
This article is written with cPanel in mind, though the methodologies listed below apply no matter wha...]]></description>
			<content:encoded><![CDATA[<p>There are numerous ways to setup multiple Magento stores that all share the same codebase and backend, but what method you use depends on your needs.</p>
<p>This article is written with cPanel in mind, though the methodologies listed below apply no matter what control panel you’re using.</p>
<p>		<span></span></p>
<h3>Jump To Section</h3>
<ol>
<li><a href="http://www.crucialwebhost.com/blog#url-structure">URL Structure</a></li>
<li><a href="http://www.crucialwebhost.com/blog#shared-hosting-caveat">Shared Hosting Caveat</a></li>
<li><a href="http://www.crucialwebhost.com/blog#adding-another-store-in-magento">Adding Another Store In Magento</a></li>
<li><a href="http://www.crucialwebhost.com/blog#parked-domain-method">Parked Domain Method</a></li>
<li><a href="http://www.crucialwebhost.com/blog#addon-domain-method">Addon Domain Method</a></li>
<li><a href="http://www.crucialwebhost.com/blog#subdomain-method">Subdomain Method</a></li>
<li><a href="http://www.crucialwebhost.com/blog#subdirectory-method">Subdirectory Method</a></li>
<li><a href="http://www.crucialwebhost.com/blog#managing-multiple-stores">Managing Multiple Stores</a></li>
<li><a href="http://www.crucialwebhost.com/blog#secure-checkout-for-each-store">Secure Checkout For Each Domain</a></li>
</ol>
<h2><a name="url-structure"></a>URL Structure</h2>
<p>The actual URL structure of your stores is a matter of personal preference. You can, for example, have two entirely different stores running on the same domain that share the same instance of Magento:</p>
<ul>
<li><strong>mall.com/shoes</strong></li>
<li><strong>mall.com/shirts</strong></li>
</ul>
<p>These stores could also be setup on their own domain and still share the same instance of Magento:</p>
<ul>
<li><strong>shoes.com</strong></li>
<li><strong>shirts.com</strong></li>
</ul>
<p>Another example would be a mall type setup, where your primary domain is the portal to access various stores:</p>
<ul>
<li><strong>mall.com</strong></li>
<li><strong>shoes.mall.com</strong></li>
<li><strong>shirts.mall.com</strong></li>
</ul>
<p>Regardless of the URL structure, the method for setting this up will pretty much be the same, and the result is what we’re really after, which is to have <strong>one codebase</strong> for all of your stores, and <strong>one backend</strong> to manage all of these stores from.</p>
<h2><a name="shared-hosting-caveat"></a>Shared Hosting Caveat</h2>
<p>If you want each store to have it’s own SSL certificate and don’t want to share a single checkout, e.g. you don’t want visitors leaving <strong>domainA.com</strong> to checkout on <strong>domainB.com</strong>, then you will <strong>not be able to do this</strong> in a shared hosting environment.</p>
<p>The reason why you cannot do this is simple. In order for a website to have an SSL certificate, it requires a dedicated IP address.</p>
<p>There’s <strong>no way to allow</strong> an addon or parked domain in cPanel to have its own IP address. Instead, it <strong>shares</strong> the IP address of the primary domain.</p>
<p>You probably think you could sign up for <strong>two</strong> shared hosting accounts, so each one has its own dedicated IP address, but that won’t work either.</p>
<p>Since it’s shared hosting, there are security measures in place to prevent one user from reading the files of another user.</p>
<p>So for shared hosting clients, you’re limited to the following scenarios:</p>
<ol>
<li>
<p>All of your stores <strong>do not have</strong> a secure checkout, which is fine if you’re using PayPal, Google Checkout, or a similar third-party service that handles the processing of card data on their website. For example, visitors to any of your stores are redirected to a third-party website for card processing.</p>
</li>
<li>
<p>All of your stores <strong>share</strong> a secure checkout point. For example, you own three domains: <strong>mall.com</strong>, <strong>shoes.com</strong>, and <strong>shirts.com</strong> You use <strong>mall.com</strong> as your primary domain and have an SSL certificate associated with it. The other two domains would be either <strong>addon</strong> or <strong>parked</strong> domains, and visitors to those sites would be redirected to <strong>mall.com</strong> to checkout.</p>
</li>
<li>All of your stores are setup as <strong>subdomains</strong>, and you’ve purchased a <strong>wildcard</strong> SSL certificate, which is roughly <strong>$1000/year</strong> and is for legally registered businesses.</li>
</ol>
<p>If you <strong>do need</strong> an SSL certificate for all of your domains, you will need to be in a dedicated hosting environment, such as our <a href="http://www.crucialwebhost.com/containers/dedicated/">Dedicated Container</a>, which comes with 5 IP addresses. In this type of environment, all five domains will be able to access the same set of files.</p>
<h2><a name="adding-another-store-in-magento"></a>Adding Another Store In Magento</h2>
<p>The first thing we need to do is setup our second store in Magento.</p>
<div>
<p>If you don’t know how to install Magento, <a href="http://www.magentocommerce.com/wiki/groups/227/installing_magento_via_shell_ssh/">read our tutorial</a> or login to the <a href="http://www.crucialwebhost.com/account/">account center</a> and submit a ticket to the Magento department.</p>
</div>
<p>We’re going to do a hypothetical here for the naming conventions, and assume we own <strong>shirts.com</strong>. Adjust the values accordingly for your own store.</p>
<ol>
<li>
<p>Login to the Magento admin.</p>
</li>
<li>
<p>Go to the <strong>Catalog</strong> tab, and select <strong>Manage Categories</strong>.</p>
</li>
<li>
<p>Click on the <strong>Add Root Category</strong> button on the left.</p>
</li>
<li>
<p>On the right, for the <strong>Name</strong>, we’ll enter <strong><em>Shoes.com</em></strong>. Set the dropdown to <strong><em>Yes</em></strong> for both <strong>Is Active</strong> and <strong>Is Anchor</strong>.</p>
</li>
<li>
<p>Click the <strong>Save Category</strong> button.</p>
</li>
<li>
<p>Go to the <strong>System</strong> tab and select <strong>Manage Stores</strong>.</p>
</li>
<li>
<p>Click on the <strong>Create Website</strong> button.</p>
</li>
<li>
<p>For the <strong>Name</strong>, we’ll enter <strong><em>Shoes.com</em></strong>, and for the <strong>Code</strong>, we’ll enter <strong><em>shoes</em></strong>. We’ll use this value later, so don’t forget this!</p>
</li>
<li>
<p>Click the <strong>Save Website</strong> button.</p>
</li>
<li>
<p>Click on the <strong>Create Store</strong> button.</p>
</li>
<li>
<p>For the <strong>Website</strong>, select <em><strong>Shoes.com</strong></em> from the dropdown. For the <strong>Name</strong>, we’ll enter <strong><em>Main Store</em></strong>. For the <strong>Root Category</strong>, select the <em><strong>Shoes.com</strong></em> from the dropdown.</p>
</li>
<li>
<p>Click on the <strong>Save Store</strong> button.</p>
</li>
<li>
<p>Click on the <strong>Create Store View</strong> button.</p>
</li>
<li>
<p>For the <strong>Store</strong>, select <strong><em>Main Store</em></strong> from the dropdown, making sure it’s for the <strong><em>Shoes.com</em></strong> website.	For	the <strong>Name</strong>, we’ll enter <strong><em>English</em></strong>. For the <strong>Code</strong>, we’ll enter <strong><em>shoes_en</em></strong>. For the <strong>Status</strong>, select <strong><em>Enabled</em></strong> from the dropdown.</p>
</li>
<li>
<p>Click the <strong>Save Store View</strong> button.</p>
</li>
<li>
<p>Go to the <strong>System</strong> tab and select <strong>Configuration</strong>.</p>
</li>
<li>
<p>For the <strong>Current Configuration Scope</strong> (located on the top left), change the dropdown menu from<em><strong> Default Config</strong></em> to <em><strong>Shoes.com</strong></em>.</p>
</li>
<li>
<p>Select <strong>Web</strong> from the sidebar on the left under the <strong>General</strong> heading.</p>
</li>
<li>
<p>For both the <strong>Unsecure</strong> and <strong>Secure</strong> sections, uncheck the <strong>Use default</strong> box next to the <strong>Base URL</strong> item, and enter the URL for your store, e.g.<em><strong> http://www.shoes.com/</strong></em>. Don’t forget the trailing slash!</p>
</li>
<li>
<p> Click the <strong>Save Config</strong> button.</p>
</li>
</ol>
<p>Now that we have our second store setup, you’ll need to choose one of the following methods for actually setting up the store on the server-side so visitors can access it.</p>
<p>If the URL structure you’ve chosen will have different domains for each store, the parked domain method is the fastest and easiest method.</p>
<h2><a name="parked-domain-method"></a>Parked Domain Method</h2>
<p>For this method, we’ll pretend we own <strong>shirts.com</strong> and <strong>shoes.com</strong>. The <strong>shirts.com</strong> domain is our primary domain, and Magento is already installed on it. Here’s how we would set this up for the <strong>shoes.com</strong> domain:</p>
<ol>
<li>
<p>Login to cPanel for your domain and click on the <strong>Parked Domains</strong> icon.</p>
</li>
<li>
<p>In the input field, enter the domain name that you’ll be setting up as a second store, e.g. <strong><em>shoes.com</em></strong>.</p>
</li>
<li>
<p>Click on the <strong>Add Domain</strong> button.</p>
</li>
<li>
<p>Open up the <strong>index.php</strong> file for Magento and replace the last line of code:</p>
<ul>
<li><code>Mage::run();</code></li>
</ul>
<p>…with the following code:</p>
<ul>
<li><code>switch($_SERVER[&#39;HTTP_HOST&#39;]) {</code></li>
<li><code>case &#39;shoes.com&#39;:</code></li>
<li><code>case &#39;www.shoes.com&#39;:</code></li>
<li><code>Mage::run(&#39;shoes&#39;, &#39;website&#39;);</code></li>
<li><code>break;</code></li>
<li><code>default:</code></li>
<li><code>Mage::run();</code></li>
<li><code>break;</code></li>
<li><code>}</code></li>
</ul>
<p>If you have more than two stores, you will need to add additional cases to the above code block, e.g.:</p>
<ul>
<li><code>switch($_SERVER[&#39;HTTP_HOST&#39;]) {</code></li>
<li><code><br />
</code></li>
<li><code>// Shoes.com</code></li>
<li><code>case &#39;shoes.com&#39;:</code></li>
<li><code>case &#39;www.shoes.com&#39;:</code></li>
<li><code>Mage::run(&#39;shoes&#39;, &#39;website&#39;);</code></li>
<li><code>break;</code></li>
<li><code><br />
</code></li>
<li><code>// Hats.com</code></li>
<li><code>case &#39;hats.com&#39;:</code></li>
<li><code>case &#39;www.hats.com&#39;:</code></li>
<li><code>Mage::run(&#39;hats&#39;, &#39;website&#39;);</code></li>
<li><code>break;</code></li>
<li><code><br />
</code></li>
<li><code>// Shirts.com (default store)</code></li>
<li><code>default:</code></li>
<li><code>Mage::run();</code></li>
<li><code>break;</code></li>
<li><code>}</code></li>
</ul>
</li>
</ol>
<h2><a name="addon-domain-method"></a>Addon Domain Method</h2>
<p>This is the same scenario as above, except it takes a little longer to setup. This method might be more useful to you if, for example, you wanted to have a blog on one domain, but not on the other. You couldn’t do that with a parked domain. Here’s how we would set this up for the <strong>shoes.com</strong> domain:</p>
<ol>
<li>
<p>Login to cPanel for your domain, and click on the <strong>Addon Domains</strong> icon.</p>
</li>
<li>
<p>For the <strong>New Domain Name</strong>, we’ll enter <strong><em>shoes.com</em></strong>. cPanel will automatically fill in the next two fields, so remove <em><strong>public_html/</strong></em> from the <strong>Document Root</strong> field, leaving us with just <em><strong>shoes.com</strong>.</em>This step isn’t required, but for organizational purposes, it makes more sense.</p>
</li>
<li>
<p>Set a password for this domain and click on the <strong>Add Domain</strong> button.</p>
</li>
<li>
<p>Login to your site via SSH, and go to the directory that we previously set in the <strong>Document Root</strong> field above when adding our domain. In our case, we would do the following:</p>
<ul>
<li><code>cd shoes.com/</code></li>
</ul>
</li>
<li>
<p>Copy the <strong>index.php</strong> and <strong>.htaccess</strong> file from the directory where Magento is installed, which would be in our root web directory:</p>
<ul>
<li><code>cp ../public_html/index.php ../public_html/.htaccess .</code></li>
</ul>
</li>
<li>
<p>Open up the <strong>index.php</strong> file that we just copied over and replace the following line of code:</p>
<ul>
<li><code>$mageFilename = &#39;app/Mage.php&#39;;</code></li>
</ul>
<p>…with the following:</p>
<ul>
<li><code>$mageFilename = &#39;../public_html/app/Mage.php&#39;;</code></li>
</ul>
</li>
<li>
<p>With the <strong>index.php</strong> file still open, replace the following line of code:</p>
<ul>
<li><code>Mage::run();</code></li>
</ul>
<p>…with the following:</p>
<ul>
<li><code>Mage::run(&#39;shoes&#39;, &#39;website&#39;);</code></li>
</ul>
</li>
<li>
<p>Lastly, we need to create symbolic links to point to a few directories:</p>
<ul>
<li><code>ln -s ../public_html/app/ ./app</code></li>
<li><code>ln -s ../public_html/js/ ./js</code></li>
<li><code>ln -s ../public_html/media/ ./media</code></li>
<li><code>ln -s ../public_html/skin/ ./skin</code></li>
<li><code>ln -s ../public_html/var/ ./var</code></li>
</ul>
</li>
</ol>
<h2><a name="subdomain-method"></a>Subdomain Method</h2>
<p>For this method, we’ll pretend we own <strong>mall.com</strong>, and it’s setup as a portal that links to the various shops within the mall. Magento will be installed on the <strong>mall.com</strong> domain, and all of the shops will be in subdomains, e.g.:</p>
<ul>
<li><strong>shoes.mall.com</strong></li>
<li><strong>shirts.mall.com</strong></li>
</ul>
<p>Here’s how we would set this up for the <strong>shoes</strong> subdomain:</p>
<ol>
<li>
<p>Login to cPanel for your domain, and click on the <strong>Subdomains</strong> icon.</p>
</li>
<li>
<p>For the <strong>Subdomain</strong>, we’ll enter <em><strong>shoes</strong></em>. cPanel will automatically fill in the next field, so remove <em><strong>public_html/</strong></em> from the <strong>Document Root</strong> field, leaving us with just <em><strong>shoes</strong>.</em>This step isn’t required, but for organizational purposes, it makes more sense.</p>
</li>
<li>
<p>Click the <strong>Create</strong> button.</p>
</li>
<li>
<p>Login to your site via SSH, and go to the directory that we previously set in the <strong>Document Root</strong> field above when creating our subdomain. In our case, we would do the following:</p>
<ul>
<li><code>cd shoes/</code></li>
</ul>
</li>
<li>
<p>Copy the <strong>index.php</strong> and <strong>.htaccess</strong> file from the directory where Magento is installed, which would be in our root web directory:</p>
<ul>
<li><code>cp ../public_html/index.php ../public_html/.htaccess .</code></li>
</ul>
</li>
<li>
<p>Open up the <strong>index.php</strong> file that we just copied over and replace the following line of code:</p>
<ul>
<li><code>$mageFilename = &#39;app/Mage.php&#39;;</code></li>
</ul>
<p>…with the following:</p>
<ul>
<li><code>$mageFilename = &#39;../public_html/app/Mage.php&#39;;</code></li>
</ul>
</li>
<li>
<p>With the <strong>index.php</strong> file still open, replace the following line of code:</p>
<ul>
<li><code>Mage::run();</code></li>
</ul>
<p>…with the following:</p>
<ul>
<li><code>Mage::run(&#39;shoes&#39;, &#39;website&#39;);</code></li>
</ul>
</li>
<li>
<p>Lastly, we need to create symbolic links to point to a few directories:</p>
<ul>
<li><code>ln -s ../public_html/app/ ./app</code></li>
<li><code>ln -s ../public_html/js/ ./js</code></li>
<li><code>ln -s ../public_html/media/ ./media</code></li>
<li><code>ln -s ../public_html/skin/ ./skin</code></li>
<li><code>ln -s ../public_html/var/ ./var</code></li>
</ul>
</li>
</ol>
<h2><a name="subdirectory-method"></a>Subdirectory Method</h2>
<p>This is the same scenario as above, except all of the shops will be in subdirectories, e.g.:</p>
<ul>
<li><strong>mall.com/shoes</strong></li>
<li><strong>mall.com/shirts</strong></li>
</ul>
<p>Here’s how we would set this up for the <strong>shoes</strong> subdirectory:</p>
<ol>
<li>
<p>Login to your site via SSH, and create a subdirectory where your second store will be:</p>
<ul>
<li><code>cd public_html</code></li>
<li><code>mkdir shoes/</code></li>
<li><code>cd shoes/</code></li>
</ul>
</li>
<li>
<p>Copy the <strong>index.php</strong> and <strong>.htaccess</strong> file from the directory where Magento is installed, which would be in our root web directory:</p>
<ul>
<li><code>cp ../public_html/index.php ../public_html/.htaccess .</code></li>
</ul>
</li>
<li>
<p>Open up the <strong>index.php</strong> file that we just copied over and replace the following line of code:</p>
<ul>
<li><code>$mageFilename = &#39;app/Mage.php&#39;;</code></li>
</ul>
<p>…with the following:</p>
<ul>
<li><code>$mageFilename = &#39;../public_html/app/Mage.php&#39;;</code></li>
</ul>
</li>
<li>
<p>With the <strong>index.php</strong> file still open, replace the following line of code:</p>
<ul>
<li><code>Mage::run();</code></li>
</ul>
<p>…with the following:</p>
<ul>
<li><code>Mage::run(&#39;shoes&#39;, &#39;website&#39;);</code></li>
</ul>
</li>
</ol>
<h2><a name="managing-multiple-stores"></a>Managing Multiple Stores</h2>
<p>It’s very important to remember that now that you have multiple stores to manage from one admin panel, that you make sure you’re changing the configuration for the appropriate store.</p>
<p>In the <strong>System</strong> → <strong>Configuration</strong> section, if you leave the dropdown menu for <strong>Current Configuration Scope</strong> set to<em><strong> Default Config</strong></em>, it will globally change the values for <strong>all</strong> of your stores, assuming you haven’t removed the checkmark next to <strong>Use default</strong> throughout the configuration sections.</p>
<p>You can change the configuration values <strong>globally</strong>, for each <strong>website</strong>, and for individual <strong>store views</strong>.</p>
<h2><a name="secure-checkout-for-each-store"></a>Secure Checkout For Each Store</h2>
<p>For those of you in dedicated hosting environments, you can follow either the addon or parked domain method from above, and edit the <strong>httpd.conf</strong> file to give the addon or parked domain a dedicated IP address.</p>
<p>However, this is <strong>not advised</strong>. Your changes will most likely be overwritten with a control panel upgrade, Apache or PHP rebuild, or even simple maintenance.</p>
<p>Your best bet would be to setup each store as a separate account, which can be done in WHM if you have access to it, or in the case of our <a href="http://www.crucialwebhost.com/containers/dedicated/">Dedicated Container</a>, something we will be able to set up for you.</p>
<p>Once you have all of your domains setup as individual accounts, you would follow <strong>steps 5-8</strong> for the addon domain method, except you’re going to use <strong>absolute</strong> paths instead of <strong>relative</strong> paths, e.g.:</p>
<ul>
<li><code>$mageFilename = &#39;/home/username/public_html/app/Mage.php&#39;;</code></li>
</ul>
<p>…and for symbolic links:</p>
<ul>
<li><code>ln -s /home/username/public_html/app/ ./app</code></li>
<li><code>ln -s /home/username/public_html/js/ ./js</code></li>
<li><code>ln -s /home/username/public_html/media/ ./media</code></li>
<li><code>ln -s /home/username/public_html/skin/ ./skin</code></li>
<li><code>ln -s /home/username/public_html/var/ ./var</code></li>
</ul>
<p>Lastly, in order for the above to work, you will need <strong>suEXEC disabled</strong>. This won’t be a problem in a dedicated hosting environment, since you don’t have to worry about other people being able to access your files.</p>
<p>This is just one of the <strong>many</strong> advantages of running your online business in a more secure and flexible hosting environment like this. If you’re on our <a href="http://www.crucialwebhost.com/containers/dedicated/">Dedicated Container</a>, this is something we’ll have to disable for you.</p>
<p>Once you’ve done the above, all of your stores will have their own secure checkout and IP address, but will still share the same codebase and backend for management purposes.</p>
<div>
<a href="http://feeds2.feedburner.com/~f/cwh?a=Np0ybCV0"><img src="http://feeds2.feedburner.com/~f/cwh?d=41" border="0"></a> <a href="http://feeds2.feedburner.com/~f/cwh?a=VP3J4T6U"><img src="http://feeds2.feedburner.com/~f/cwh?i=VP3J4T6U" border="0"></a> <a href="http://feeds2.feedburner.com/~f/cwh?a=wWmPQc2Y"><img src="http://feeds2.feedburner.com/~f/cwh?i=wWmPQc2Y" border="0"></a> <a href="http://feeds2.feedburner.com/~f/cwh?a=NdGZ0zeu"><img src="http://feeds2.feedburner.com/~f/cwh?d=50" border="0"></a>
</div>
<p><img src="http://feeds2.feedburner.com/~r/cwh/~4/5TQs-dnGAGA" height="1" width="1"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.splebly.com/how-to-setup-multiple-magento-stores/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
