Installing Drush on Media Temple Grid Server

Drush is a tool for working on Drupal websites. It's technically filed away on Drupal.org as a "module", but it's not exactly a module. It's more like an add-on for your webserver setup, either development or production, that adds some really useful tools for managing your Drupal website. For instance, those of you familiar with Wordpress might be surprised to know that Drupal has no built in facility for updating either the core Drupal code or any of the add-ons (which go by the name "Plug-ins" in Wordpress and "Modules" in Drupal). I don't have any statistics to back this up, but I think the average Drupal site is built with many more of these open-source-and-constantly-shifting contributions than the typical Wordpress site.

What all that means is that Drupal is a pain in the ass to maintain. When one of your modules has an update, you get a message that tells you so. These messages come all the time. They never stop, actually. And there's no way to make them go away except to go and download the latest version(s) and upload it/them to the server over FTP, hope nothing went wrong with the transfer, and then go and update your DB, more or less manually. Over time, slackness can set in.

I've been reading about it for several weeks because the most interesting thing it does (to me now) is take care of updating your stuff. The downside for some is that it's a command line tool. However, if you like the command line because it makes you feel like a real programmer, you're in luck! drush up updates your site, modules and all by downloading them straight from the Drupal CVS repository, and then running any DB updates for you. "Magic", you might say had you been deprived of this after having tasted Wordpress' sweet waters.

I haven't even used it yet, but I spent the last two days figuring our how to install it, and found the answer scattered over 3 or 4 different places. Maybe I'm the only one, but I figured I'd make it a little easier for the next guy.

  1. Make sure you know how to use SSH on your grid server account, and log in.
  2. You will now be at the command line. You want to make sure you are in the home directory, so type:
    cd ~/
  3. At this point you'll create a folder for stuff that you install to live in. Type:
    mkdir bin, and then switch into that directory:
    cd bin
  4. This command fetches it from drupal.org for you:
    wget http://ftp.drupal.org/files/projects/drush-All-versions-3.0-beta1.tar.gz
    in tarball form.
  5. Untar:
    tar xzvf drush-All-versions-3.0-beta1.tar.gz
  6. Switch into the new drush folder:
    cd drush
  7. Take a look at the contents of that folder by typing ls and make sure everything looks like this:
    LICENSE.txt commands drush.api.php drush.info drush_logo-black.png example.drushrc.php
    README.txt drush drush.bat drush.php example.drush.inc includes
  8. Note the path to that folder by typing:
    pwd.
    You'll get something back like: /home/70298/users/.home/bin/drush.
    The drush command is at the end of that path, and you have to let the server know that now.
    Note that everything before bin can be replaced with ~/.
  9. Switch back to your FTP client and root around in your server for the "home" folder. It's going to be back toward the root:cd ~/users
  10. You may or may not see a file named .bash_profile. Note that it might be hidden depending on your FTP client. If you are sure that it's not there, create a file and give it that name.
  11. MT runs PHP4 on the command line by default. You have to specifically tell it to run Drush with PHP5. Thus, paste this into the file you just created (.bash_profile).
    alias drush='/usr/bin/php5 ~/bin/drush/drush.php'
  12. source .bash_profile to reload the .bash_profile file.
  13. God willing, if you type in drush at this point you are going to get a long list of newly available commands.

Note that this took me over a month of poking and prodding to get working correctly. Specifically, in contrast to all the Drush installation tutorials I found out there, I had to specifically direct it to the drush.php file, rather than the generic drush wrapper file that the tutorials directed me to use when aliasing the Drush command. As usually YMMV.

Good luck!

EDIT - September 8, 2010

I've been having issues with updating the Drupal core with Drush. drush up works just fine to update any modules, but for some reason I get an error that Drush needs PHP 5.2 when trying to update the core. It seems to kick out of php5 when it gets to Drupal core. I've tried running the full php5 /home/70298/users/.home/bin/drush/drush.php up and it still says that my cli version of PHP is too old. Any suggestions/workarounds/fixes are most welcome. Thanks, JG.

Comments

Awesome, I had problems with

Awesome, I had problems with the old php cli version stuff until I saw this post. Thanks a lot!

Thanks, I was about to try to

Thanks, I was about to try to install drush on Media Temple gridserver, thought I would google it first and came across your post. Thanks so much for posting this. saved me a few headaches.

Nice post man, thanks! Do

Nice post man, thanks!

Do you know for any reason why when you are drushing in a specific domain, and then switch to another domain the drush command fails?

Just curious...thanks again.

Can i update multisiting

Can i update multisiting drupal installation via drush? Thanks.

drush is a must for managing

drush is a must for managing drupal sites ... makes live so much easier! when i get my gs account i'll definetly need to install drush so i'll consider your instructions.

thanks in advance.

I was reading about Drush

I was reading about Drush when I finally decided to start playing with Drupal. One thing I love coming from WordPress is the ease of upgrading. Just press a button and done. When I found out that you have to disable modules, re-upload files, run update.php multiple times - I got a headache. I haven't installed Drush. But it looks like the solution I might need. While I'm on my Drupal rant ... what's the best way to migrate from a development server to a live server? Using Drupal I feel like a Bird in a house =).

Well, let me have a Drupal

Well, let me have a Drupal rant here. I wrote this post over a month ago and figured it would be decent search engine fodder since I didn't really see much else out there on this very, very specific topic.

I haven't been too much on this blog lately, in case you haven't noticed. Last night I dropped by and saw that I had a bevy of comments on this post that I didn't even know about.

The thing I don't like about Drupal is that you have to tell it to do everything. Not just that, but it's usually a three step process to tell it to do something simple like send me an email when someone leaves a comment. You actually have to enable two modules and then set them up just to get it to send an email telling me to check my site. Anyway...

And Ron, FWIW, I went to the NYC DrupalCamp about a month ago and the absolute best presentation I went to was called "Wordpress is Better than Drupal". I guess this room full of mostly Drupal devs had never really used WP before. It convinced me to start a project that I was over a month into in WP. Point being, there is a lot that Drupal is totally clueless about, almost all of it in the User Experience category.

I'll write up a post about migrating a site. It's a little dicey sometimes. Are you on MAMP?

Great to hear your input.

Great to hear your input. Yeah... I'm on MAMP. My main reason for messing with Drupal is to see if it's better for Calendar management and onsite search. I'm not much of a WP plugin fan. I'd rather edit my theme php. But when budget strikes plugins make for easy work arounds. I figure if I can learn enough about setting up Drupal and massaging good design into it, some of the modules might make for better end results.

You hit it on the head with User Experience. It's one reason the iPhone is so popular. And probably the same reason why WP has 11 million active installations versus the hundreds of thousands for Drupal.

thanks for the conversation!

Alright, I have to move a

Alright, I have to move a Drupal site into production in the next week or so here, so I'll make sure to take good notes. Most of it is out there, but it's not quite as simple as moving a WP install. A BIG help while you're developing a Drupal site locally in MAMP is if you get VHosts setup. That lets you set the root of the site to a http://root-URL instead of http://localhost:8888/one-level-removed. That was a big hurdle for me to clear, because then you can really set relative URLs in your content without it messing up on your staging server. Fer instance, if you have all images stored in the /images folder, with a default MAMP setup the images will actually be in localhost:8888/yer-site/images, rather than yer-site/images. However, if you use relative URLs in your stylesheets or whatever to pull those images, /images will pull from localhost:8888/images, which of course doesn't exists. this should have been a blog post...

Anyway, on Drupal search - check out the Lucene module. Drupal's default search is a'ight, but it seems to leave folks wanting.

On Drupal theming, it's very similar to WP theming, but you've probably figured that out already. If you can see the correlations - template.php in D6, functions.php in WP - you'll be in good shape.

On Drupal v WP user Experience, it's pretty obvious that Drupal is for developers by developers. Wordpress is easy to use for almost anyone, and since many webhosts have automatic installers it's pretty much a no-brainer. Not so for Drupal though.

I'm actually really digging WP lately, mostly due to the fact that Drupal has forced me to get familiar with a lot of actually programming/hacking. The paradigm with modules/plugins latching on to hooks is the pretty much the same in both. Drupal just gives you a lot more out of the box, at the cost of a lot of complexity of setup.

Wish I had time to write as much as I want, but duty calls...

Also, here's a decent video

Also, here's a decent video on the Drupal Date module. It's a beast.

I've found the simple old Calendar plugin pretty easy to hack into submission. there a re a couple others that might be better suited, but I haven't had the occasion to try them yet. I noticed that the Events Manager plugin is used pretty stylishly on OkGo's website. Anyway...

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.

Subscriptions