Installing Drush On Dreamhost

Outside of CivicActions I host some sites for friends and family on Dreamhost.  I’ve always had a decent experience with DH for the kinds of sites I am talking about, especially for the price.  Today I decided to get Drush installed. The first thing I did was ask on the drupal-seattle IRC channel if anyone had done it.  Thinkling (Maarten) directed me to this post on Drupal.org.

It is pretty straight forward, but I figured I would spell it out with a little bit more information.

So here are the steps you must take:

SSH in to your dreamhost account


$ wget http://ftp.drupal.org/files/projects/drush-All-Versions-2.1.tar.gz
$ tar -xzf drush-All-Versions-2.1.tar.gz
$ mv drush drush_2.1
$ alias drush='/full/pathto/drush_2.1/drush'
$ pico .bash_profile

Then add the following two lines to the end of your .bash_profile

export PATH=/usr/local/php5/bin/:$PATH
alias drush='/full/pathto/drush_2.1/drush'

Save your file.

This presumes that drush_2.1 lives in your user root directory, you would have to change the path if it lived elsewhere. Your full path will look something like:

"/home/username/drush_2.1/drush".

Here is the step that will save you a little bit of headache and worry:

LOGOUT.  Terminate your SSH connection.  And then log back in. OR you can run $ source .bash_profile You can then type drush at the command line and it will work (give you a list of commands).  Of course you will want to run it from your drupal root.

Check out Owen’s blog post for more information and a video tutorial of Drush.

 

UPDATE:

It is worth noting, the reason to rename the drush directory something else is because you cannot have a symlink with the same name as the directory, that said, if you are not creating a symlink, and just using the alias route, it seems you do not need to rename the directory. This would make updating drush easier because you will not have to update the alias in the your .bash_profile.  Also, you could put the entire drush directory in some other directory within your root.  For example you could create a directory “drupal_tools” or some such.

Discover more from Gregory Heller

Subscribe now to keep reading and get access to the full archive.

Continue reading