- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
Project Website Part 5: Morph in 11 steps or so

Eventually in the course of developing the Project Website application, it was time to put the project on a staging server for client viewing.
Often we'll host that ourselves, but in this case I decided to try out Morph, which provides a relatively inexpensive virtual hosting environment for Rails applications, using the Amazon Web Services cloud. Even better, Morph allows you to set up a development environment for free. (The free version is limited in size and bandwidth, and they also apparently will shut down the server if you don't deploy for 30 days -- a limitation obviously not shared by the paid environments).
I was able to go from total Morph ignoramus to running deployed app in under two hours. After reading this you should be able to do it even faster. (Full disclosure: Morph and Pathfinder are co-sponsers of the WindyCityRails conference September 20, 2008. That doesn't really have anything to do with anything, I just wanted to mention the convference)
Here are the steps:
- Go to http://www.mor.ph. Click on login, then create a new account. You'll need to activate via email.
-
After activating, you can create a new subscription:

We'll create a Ruby on Rails project (the other option is Java), set the database to MySQL and create the subscription. -
You wind up in the control panel, which starts off like this:

- Click "Create Data Base", which does nothing visible, but, well.. creates your database.
- Click "Dowload Cap File. This will download a Capistrano file called
morph_deploy.rb. You should put this in the root directory of your application. - Open the morph deploy file file, and change the line
set :repositoryto point to your repository. In my case, I'm using a local git repository, so I need to set it toset :repository, '.'. Note that I'm not changing the source control scm setting here, per the directions from Morph, I'll be doing that in my command line. Not sure why they want you to do it like that. - You do need to do some prep work on your application. You should have as many gems as possible in your vendor/gems directory, if you are using Rails 2.1 gem tasks, this is easy. Morph has gems on the server, but you don't want to be dependent on their versioning. You must have Capistrano 2.0 or higher on your local machine. And any thing you want to be able to do on the remote system should be available as a Rake task. Also, if you are uploading files in your app, you need to store them elsewhere, like Amazon S3.
- Okay, at this point, we're ready to go. The recommended invocation for deploying my app via morph is
cap -f morph_deploy.rb -s scm=git -s deploy_via=checkout morph:deploy
$ cap -f morph_deploy.rb -s scm=git -s deploy_via=checkout morph:deploy * executing `morph:deploy' ** transaction: start * executing `morph:update_code' * executing `morph:upload_code_to_s3' * executing `morph:get_code' Downloading the code from the repository... Getting upload information *** Getting info for Morph authentication *** Morph user: xxxxxx Password: Uploading code to S3... Creating new appspace version... Code Upload Done. Deploy Done. ** transaction: commit
Note that I got challenged for my username and password, so you do need to watch this one go.
- At this point, your control panel will look like this. (You might have to click a "start process" button to get this screen exactly).

-
The "Manage" link is where all the interesting stuff is.

The Dashboard lets you redownload the Capistrano file, revert to old versions, and see details of old versions. Charts has CPU and Memory usage histories. DB Admin takes you to phpMyAdmin, which lets you do all kinds of database manipulation. Web Stats has, well, web stats, hits, pages, and bandwidth -- the Google Analytics style features, although not quite as pretty. The Logs tab gives you access to the production log and all deployment logs.
- The Tasks tab is interesting, this is your main method of interaction with the running system.

The pulldown has a list of all your Rake tasks (not alphabetized, for some reason). If you run one, you'll see the output on that screen in a few moments. You do not have general SSH access to the system, but the phpMyAdmin interface lets you do almost anything you'd need that is database related. Anything else, you need to roll up as a Rake task and run here. You can also set scheduled and event tasks.
And that's how I got my site uploaded to Morph, quick and easy.
Topics: Project Website, Ruby on Rails
Comments: 6 so far
Leave a comment
About Pathfinder
Recent
- Firefox Plugin Malware ‘Trojan.PWS.ChromeInject.A’
- Pathfinder releases version 1 of the its Flash Platform microsite (codename Mica)
- Pimp my Rails: Five Plugins & Gems to Make Rails Better
- iPhone: Using Pre-processor Directives for Device Testing
- Subtle OpenGL Projection Matrix Difference Between iPhone Simulator and Device
- App Security: Throw Out the Org Chart!
- Pimp my jQuery: Five plugins to replace the features Prototype and Scriptaculous users expect
- Thanksgiving 2008: What We’re Thankful For (In Rails)
- iPhone SDK: Testing with TextMate & GTM
- GWTQuery - JQuery-like Syntax in GWT
Archives
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006


Thanks for the writeup.
Cool service but I ran into some problems.
1) File uploading is a bit foobared. They dont support filesystem. AttachmentFu S3 was throwing permission denied errors
2) Couldnt install gems. Rails 2.1 doesnt pick up Gem Plugins that are in the vendor directory so freezing wasnt an option. I wish it would pick the gems out of environment.rb and just install them. But I guess there’s limitations since its shared server
3) Cap deployment failures are really tough to debug. Lots of trial and error. Nondeterministic so I kept having to do refreshes on their tool to see if it updated. They should just email any deployment failures along with the log files so its not such a pain
Looks like a promising tool. Not quite ready to give up my slice quite yet. I wish I could though.
Comment by tom, Friday, August 8, 2008 @ 8:17 pm
Thanks for mentioning the conference!
Comment by Matt Polito, Saturday, August 9, 2008 @ 2:13 pm
Glad to hear that you had a quick and easy time with it, Noel. Do let us in with more of your thoughts as you continue to explore the Morph Appspace for your apps deployment.
Appreciate the kind words.
Best.
alain
http://www.mor.ph
Thanks to Matt, too for giving the Mor.ph -sters a chance to participate in the event.
Comment by friarminor, Saturday, August 9, 2008 @ 7:02 pm
The unalphabetized rake task names are a pain. Also, I’ve experienced significant delays after deploying; it seems like Morph has their own processes that throw up various not-found or bad-gateway pages for a while. I’ve just trained my client to wait an hour before testing newly-delivered features.
I hacked up the morph_deploy script to remove the need for command-line arguments and created a bash helper so I can just ‘morph_deploy ‘
Comment by Veez, Saturday, August 9, 2008 @ 9:02 pm
Noel, thanks for the post. Anytime you need our help with deployment, we’re here to help.
@Veez thanks as well. not sure if you’ve visited our forums, but feel free to post your suggestions and hiccups you encounter at forums [dot] mor [dot] ph. you may also email me directly. deployment shouldn’t be that difficult
Comment by M L, Wednesday, August 20, 2008 @ 1:57 am
Thanks for the post!
@tom: If there are gems you need that aren’t installed, we would gladly install on our systems. We do that all the time. The attachment-fu + S3 issues are now solved. We are adding more error handling to the deploy scripts, and working on automatic notification in case of errors.
@veez: Good point on the un-alphabetized rake tasks, we will fix this ASAP.
We are very happy to receive feedback of any kind, and do our best to address it ASAP.
Guy - Morph Labs CTO
Comment by Guy Naor, Saturday, August 23, 2008 @ 12:47 am