Home > Softwares, Webmasters Resources > Magento Installation Guide for Dreamhost

Magento Installation Guide for Dreamhost

I’ve been watching the Magento e-commerce project for about the last month and a half – since Ben sent me a link to it. It’s an open-source e-commerce package, that primarily aims to pickup and improve where OSCommerce, Joomla + VirtueMart, and ZenCart have left off – streamlining a CMS (Content Management Sytem) and E-commerce shopping cart. This also means built-in SEO (Search Engine Optimization), Google Checkout integration, varied customer groups, and much more…. straight out of the box. The problem appears to be that there are a lot of people on the Magento forums who are running into problems, and don’t have a clue on how to get it running under their Dreamhost hosting account. Unfortunately it also looks like the previous article(s) for Magento+Dreamhost installs have disappeared, or are outdated. And that’s where this article comes in…

If you just so happen to be one of those whining idiots, or clueless n00bs, then you’re in luck! I’ll take you through a step-by-step process of installing Magento on your Dreamhost account. But please be forewarned: This requires some “advanced” techniques, so if you don’t know what Putty/SSH or a command-line are, then STFU and GTFO, n00b. Just kidding. Hopefully I can explain those things too, and increase your knowledge. In fact, it may even get you laid! But probably not.

   1. Step 1 – Dreamhost: Create domain
      Obviously we need a domain to work with here. I’ll be using ‘magento.webinade.com’ as my test domain. Be sure to set it up to use PHP5, that’s a Magento Requirement.

Step 2 – Dreamhost: Give User Shell Access
We need to have shell access in order to connect to the command line and configure magento. In the Dreamhost Control Panel, go to Users > Manage Users and then click Edit next to the user you chose for your domain. It should take you to a screen like this, where you can set the Account Type to Shell Account. Step 3 – Dreamhost: Create MySQL Database
We need a MySQL database setup for Magento prior to the install. Magento stores data and configuration settings in MySQL. In Dreamhost go to Goodies > Manage MySQL. Then scroll to the bottom to set up a new database. If this is your first database, you’ll also want to set up a hostname – typically something like mysql.yourdomain.com will work. Step 4 – SSH in to Server
And now the fun begins. Let’s start by SSH’ing into Dreamhost. If you don’t know how to do this, go download Putty if you’re on a Windows machine. Open it up. Type in the domain you’re hosting magento on (magento.webinade.com in my case), make sure the Port is set for 22, and connection type is SSH. You will then be prompted for a username and password. Type them in (don’t be alarmed if you don’t see anything when typing your password). If you are successful, putty will return something along the lines of ‘[server_name]$’ like in the picture below. You’re now logged into the command line of your Dreamhost linux server. Step 5 – Download Magento from Linux Command Line
Now that we’re logged in, we need to download Magento. To do so, type the following command:
wget

I’ve been watching the Magento e-commerce project for about the last month and a half – since Ben sent me a link to it. It’s an open-source e-commerce package, that primarily aims to pickup and improve where OSCommerce, Joomla + VirtueMart, and ZenCart have left off – streamlining a CMS (Content Management Sytem) and E-commerce shopping cart. This also means built-in SEO (Search Engine Optimization), Google Checkout integration, varied customer groups, and much more…. straight out of the box. The problem appears to be that there are a lot of people on the Magento forums who are running into problems, and don’t have a clue on how to get it running under their Dreamhost hosting account. Unfortunately it also looks like the previous article(s) for Magento+Dreamhost installs have disappeared, or are outdated. And that’s where this article comes in…

If you just so happen to be one of those whining idiots, or clueless n00bs, then you’re in luck! I’ll take you through a step-by-step process of installing Magento on your Dreamhost account. But please be forewarned: This requires some “advanced” techniques, so if you don’t know what Putty/SSH or a command-line are, then STFU and GTFO, n00b. Just kidding. Hopefully I can explain those things too, and increase your knowledge. In fact, it may even get you laid! But probably not.

   1. Step 1 – Dreamhost: Create domain
      Obviously we need a domain to work with here. I’ll be using ‘magento.webinade.com’ as my test domain. Be sure to set it up to use PHP5, that’s a Magento Requirement.

Step 2 – Dreamhost: Give User Shell Access
We need to have shell access in order to connect to the command line and configure magento. In the Dreamhost Control Panel, go to Users > Manage Users and then click Edit next to the user you chose for your domain. It should take you to a screen like this, where you can set the Account Type to Shell Account. Step 3 – Dreamhost: Create MySQL Database
We need a MySQL database setup for Magento prior to the install. Magento stores data and configuration settings in MySQL. In Dreamhost go to Goodies > Manage MySQL. Then scroll to the bottom to set up a new database. If this is your first database, you’ll also want to set up a hostname – typically something like mysql.yourdomain.com will work. Step 4 – SSH in to Server
And now the fun begins. Let’s start by SSH’ing into Dreamhost. If you don’t know how to do this, go download Putty if you’re on a Windows machine. Open it up. Type in the domain you’re hosting magento on (magento.webinade.com in my case), make sure the Port is set for 22, and connection type is SSH. You will then be prompted for a username and password. Type them in (don’t be alarmed if you don’t see anything when typing your password). If you are successful, putty will return something along the lines of ‘[server_name]$’ like in the picture below. You’re now logged into the command line of your Dreamhost linux server. Step 5 – Download Magento from Linux Command Line
Now that we’re logged in, we need to download Magento. To do so, type the following command:
wget http://www.magentocommerce.com/downloads/assets/0.8.16100/magento-0.8.16100.zip

That should download the 0.8.16100 beta version of Magento to your home directory, and should look like this:
Step 6 – Unzip Magento & Move it to the Live Domain
Run the following command to unzip Magento. You’ll get several hundred lines, telling you which files it is extracting where. It should extract everything into a folder called magento.
unzip magento-0.8.16100.zip

Run this command to move the contents of the magento folder into your live site:
mv magento/* magento.webinade.com/
mv magento/.htaccess magento.webinade.com/.htaccessObviously replace magento.webinade.com with the folder your domain is in. You will not receive output from the above two mv commands, unless there is an error. It will simply return you to the command line. The commands and output should look similar to this:
Step 7 – Magento Install
Now that we’ve got the files extracted, and hopefully in the right folder, let’s load up the website. It should show a page like this:

To continue, agree to the license. The next page is localization information – defaults are good for most, but feel free to change these. The third page is for downloading updates to Magento. This is important, and this is where some problems often arise. You can ignore the first two section, SVN Installation & Package Management Through The Web. The third part of that page is what’s important. Open up putty again and type the following command, changing the name of the folder of course to match yours:
cd magento.webinade.com/
./pear mage-setup

That should produce some output similar to this:

Good! Now, the next line:
./pear install mage-core/Mage_Pear_Helpers mage-core/Lib_ZF mage-core/Lib_Varien

This should produce similar output:

Unfortunately, we can’t run the third line just quite yet. We need to change the PHP variable in the ./pear file. Right now it just makes a call to “php” on the system – which by default on Dreamhost is PHP4. Let’s modify the file with Midnight Commander – a file manager similar to that of the old Windows 95/98 or XTree Gold. We need to change it to reference PHP5. Run this:
mc

You’ll then need to navigate (with your arrow keys!) down to the pear file, and hit F4 to edit it. Scroll down to line 62 (again, with the arrow keys!). Line’s 61-63 will look like this:
else
PHP=php
fi

Change them to this:
else
PHP=/usr/local/php5/bin/php
fi

Hit F2 to save, agree. Then hit F10 to quit. All of the above should look like this:

Now we can run the third command:
./pear install mage-core/Mage_All mage-core/Interface_Install_Default

It should look like this now:
#

Unfortunately, that may update/overwrite the ./pear file we just modified. You’ll know if it does, when you try to run the next command:
./pear install mage-core/Interface_Frontend_Default mage-core/Interface_Adminhtml_Default

And you get an error saying “Permission Denied” or “No valid packages found.”
#

Step 8 – Rinse & Repeat (Fix Permissions on ./pear and Update Again)

If you get one of the above two errors (which you should), you’ll need to do two things. First, you need to change the file permissions on the ./pear file, like so:
chmod 755 ./pear

Second, you need to modify ./pear again to fix the PHP version it is referencing (like above). Run this:
mc

You’ll then need to navigate down to the pear file, and hit F4 to edit it. Scroll down to line 62 (again, with the arrow keys!). Line’s 61-63 will look like this:
else
PHP=php
fi

Change them to this:
else
PHP=/usr/local/php5/bin/php
fi

It’s not so bad. Just really annoying. I’m hoping the Magento guys will update the scripts in newer versions to run a check on the ./pear file, and hopefully carry over any modifications done to it. Or maybe make some of these configurations more “user friendly” or st00pid n00bs.

Now that that is done, we can run the last command and continue:
./pear install mage-core/Interface_Frontend_Default mage-core/Interface_Adminhtml_Default

Victory! Hopefully it looks like this for you:
Step 9 – Finish Magento Install
Now that is all done, we can continue on with the Magento install. Click the “Continue After Manual Download” button in your browser (You’ve still got your browser open, right?). Some of you may or may not receive an error here. I didn’t on my first install of Magento, but I did on my webinade test install. If you do, it may say and look like this:
Path "/home/.donald/magento/magento.webinade.com/app/etc" must be writable
Path "/home/.donald/magento/magento.webinade.com/var" must be writable
Path "/home/.donald/magento/magento.webinade.com/media" must be writable
Image:

Don’t worry! These are easy fixes. Run these commands at the command-line (in Putty):
chmod 777 ./app/etc/
chmod 777 ./var
chmod 777 ./media

Now click the “Continue” button in the browser and the errors should be gone. You’re now presented with a Configuration page, with all kinds of great MySQL settings and textboxes. Fill them in to match whatever you created you MySQL database with earlier. You’ll also want to check the box that says “Use Web Server (Apache) Rewrites” – this is good for SEO. You can check the Box for SSL URLs, but only if you have an SSL certificate installed and configured for your Dreamhost account. My page looks like this:

   9.

      Click Continue, and the next page will present you with form fields to setup your Administrator account as well as create an Encryption Key. Follow the instructions, fill in the boxes, and click Continue.
  10. Step 10 – All Done!
      You’re now done setting up Magento. Sit back, relax, crack open a cold beer (or bottle of wine), and let the gorgeous chicks flock to you. Maybe not?I suggest you login to the backend and start playing around. There is a lot of configuration that needs to happen before your store will go live, including customizing your own store design. There is a lot of great documentation available on Magento’s site, as well as a well populated forum, with several knowledgeable developers and supporters.

Please Note: Magento is in BETA! This means that you will more than likely run into problems, small or big. I don’t suggest running a live site on Magento until it reaches a stable release – hopefully by the end of March. Be sure to follow the forums.

And please don’t go whining on the forums, and posting ridiculous threads like “It’s broken! OMGz!!!!!!11!1” or “Magento doesn’t work! MY LIFE IS OVER! KILL ME NOW!” It doesn’t solve the problem. Others can’t help you, and you look like an idiot. Have some respect for the developers and supporters, and post knowledgeable threads, detailing what specifically doesn’t work. And please, please, please search the forums before posting. Odds are, someone else has had the same problem.

Feel free to post any questions or comments below. I’m always open to discussion and support. I’ll be playing with Magento over the next week, and hopefully will have a positive, thorough review.

That should download the 0.8.16100 beta version of Magento to your home directory, and should look like this:
Step 6 – Unzip Magento & Move it to the Live Domain
Run the following command to unzip Magento. You’ll get several hundred lines, telling you which files it is extracting where. It should extract everything into a folder called magento.
unzip magento-0.8.16100.zip

Run this command to move the contents of the magento folder into your live site:
mv magento/* magento.webinade.com/
mv magento/.htaccess magento.webinade.com/.htaccessObviously replace magento.webinade.com with the folder your domain is in. You will not receive output from the above two mv commands, unless there is an error. It will simply return you to the command line. The commands and output should look similar to this:
Step 7 – Magento Install
Now that we’ve got the files extracted, and hopefully in the right folder, let’s load up the website. It should show a page like this:

To continue, agree to the license. The next page is localization information – defaults are good for most, but feel free to change these. The third page is for downloading updates to Magento. This is important, and this is where some problems often arise. You can ignore the first two section, SVN Installation & Package Management Through The Web. The third part of that page is what’s important. Open up putty again and type the following command, changing the name of the folder of course to match yours:
cd magento.webinade.com/
./pear mage-setup

That should produce some output similar to this:

Good! Now, the next line:
./pear install mage-core/Mage_Pear_Helpers mage-core/Lib_ZF mage-core/Lib_Varien

This should produce similar output:

Unfortunately, we can’t run the third line just quite yet. We need to change the PHP variable in the ./pear file. Right now it just makes a call to “php” on the system – which by default on Dreamhost is PHP4. Let’s modify the file with Midnight Commander – a file manager similar to that of the old Windows 95/98 or XTree Gold. We need to change it to reference PHP5. Run this:
mc

You’ll then need to navigate (with your arrow keys!) down to the pear file, and hit F4 to edit it. Scroll down to line 62 (again, with the arrow keys!). Line’s 61-63 will look like this:
else
PHP=php
fi

Change them to this:
else
PHP=/usr/local/php5/bin/php
fi

Hit F2 to save, agree. Then hit F10 to quit. All of the above should look like this:

Now we can run the third command:
./pear install mage-core/Mage_All mage-core/Interface_Install_Default

It should look like this now:
#

Unfortunately, that may update/overwrite the ./pear file we just modified. You’ll know if it does, when you try to run the next command:
./pear install mage-core/Interface_Frontend_Default mage-core/Interface_Adminhtml_Default

And you get an error saying “Permission Denied” or “No valid packages found.”
#

Step 8 – Rinse & Repeat (Fix Permissions on ./pear and Update Again)

If you get one of the above two errors (which you should), you’ll need to do two things. First, you need to change the file permissions on the ./pear file, like so:
chmod 755 ./pear

Second, you need to modify ./pear again to fix the PHP version it is referencing (like above). Run this:
mc

You’ll then need to navigate down to the pear file, and hit F4 to edit it. Scroll down to line 62 (again, with the arrow keys!). Line’s 61-63 will look like this:
else
PHP=php
fi

Change them to this:
else
PHP=/usr/local/php5/bin/php
fi

It’s not so bad. Just really annoying. I’m hoping the Magento guys will update the scripts in newer versions to run a check on the ./pear file, and hopefully carry over any modifications done to it. Or maybe make some of these configurations more “user friendly” or st00pid n00bs.

Now that that is done, we can run the last command and continue:
./pear install mage-core/Interface_Frontend_Default mage-core/Interface_Adminhtml_Default

Victory! Hopefully it looks like this for you:
Step 9 – Finish Magento Install
Now that is all done, we can continue on with the Magento install. Click the “Continue After Manual Download” button in your browser (You’ve still got your browser open, right?). Some of you may or may not receive an error here. I didn’t on my first install of Magento, but I did on my webinade test install. If you do, it may say and look like this:
Path "/home/.donald/magento/magento.webinade.com/app/etc" must be writable
Path "/home/.donald/magento/magento.webinade.com/var" must be writable
Path "/home/.donald/magento/magento.webinade.com/media" must be writable
Image:

Don’t worry! These are easy fixes. Run these commands at the command-line (in Putty):
chmod 777 ./app/etc/
chmod 777 ./var
chmod 777 ./media

Now click the “Continue” button in the browser and the errors should be gone. You’re now presented with a Configuration page, with all kinds of great MySQL settings and textboxes. Fill them in to match whatever you created you MySQL database with earlier. You’ll also want to check the box that says “Use Web Server (Apache) Rewrites” – this is good for SEO. You can check the Box for SSL URLs, but only if you have an SSL certificate installed and configured for your Dreamhost account. My page looks like this:

   9.

      Click Continue, and the next page will present you with form fields to setup your Administrator account as well as create an Encryption Key. Follow the instructions, fill in the boxes, and click Continue.
  10. Step 10 – All Done!
      You’re now done setting up Magento. Sit back, relax, crack open a cold beer (or bottle of wine), and let the gorgeous chicks flock to you. Maybe not?I suggest you login to the backend and start playing around. There is a lot of configuration that needs to happen before your store will go live, including customizing your own store design. There is a lot of great documentation available on Magento’s site, as well as a well populated forum, with several knowledgeable developers and supporters.

Please Note: Magento is in BETA! This means that you will more than likely run into problems, small or big. I don’t suggest running a live site on Magento until it reaches a stable release – hopefully by the end of March. Be sure to follow the forums.

And please don’t go whining on the forums, and posting ridiculous threads like “It’s broken! OMGz!!!!!!11!1” or “Magento doesn’t work! MY LIFE IS OVER! KILL ME NOW!” It doesn’t solve the problem. Others can’t help you, and you look like an idiot. Have some respect for the developers and supporters, and post knowledgeable threads, detailing what specifically doesn’t work. And please, please, please search the forums before posting. Odds are, someone else has had the same problem.

Feel free to post any questions or comments below. I’m always open to discussion and support. I’ll be playing with Magento over the next week, and hopefully will have a positive, thorough review.

Categories: Softwares, Webmasters Resources Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.