15

Currently, I have a reseller account with the company HostGator. I design websites, which up until now have occasionally been wrapped in Wordpress CMSs and the like (PHP applications). I then sell hosting (of the site I've designed) to the client, which is pretty simple, in that I can simply click a button and add a new shared hosting account/site with whatever settings I want. Furthermore, I then utilize WHMCS to automate billing and account management.

It's a nice package and pretty simple. I pay something like $25 a month, and can sell a hundred accounts under this (because my clients bandwidth requirements are low).

Now I am finding the need to develop more customized applications, including a minimalist CMS and several proprietary things. I soon anticipate developing these apps for clients as well. Thus, I've spent the past few months learning Rails, and it's coming along well now.

The thing that has nagged at me all along, though, is the deployment issue. I can't wrap my brain around it. It seems like all of the popular options (Heroku, etc) have nice automation with git and are set up in the "Rails Way". I get that (sort of). But it's terribly expensive... a single dyno, a helper, and the cheapest database (which they say is mainly suitable for testing) that isn't limited to 5MB runs $51. This is for ONE app!!! Throw in a "production" DB and you're over $200. This is like... the same prices as getting a server somewhere, right?

Meanwhile, going back to what I guess is a "traditional" hosting environment with Hostgator, their server only has Ruby 1.8.7 and Rails 2.3.5... No Rails 3. AND, no Passenger (not that I really understand the difference in CGI or mod_rails or whatever, but they say Passenger is the simplest). So I'm to understand that if I build an app in Rails 3, it won't run at all on this host? But damn, I already have these accounts under my reseller account there, all running static html and/or PHP stuff, right? So what now? How do I get all of this under one simple (and affordable) roof?

Forgive my ignorance, but I just don't get it. Managing a VPS is cool and all, but entails learning server admin stuff and security... And it's expensive. I get that a shared and/or reseller "server-based" (forgive the terminology) may be inadequate for large-scale apps that use a lot of bandwidth... But what about for those of us who are building real (but small and low bandwidth) apps (with Rails) and who want to deploy them simply, cheaply, using the same conceptual approach as PHP? Even after learning all of this Ruby and Rails stuff for months, I'm questioning whether it's worth it when it comes to deployment. I want to build a small app, upload it to my home directory on a shared server account, and just make it run. Why should that be so hard? Am I just choosing the wrong language/framework?

Forgive my ignorance in the subject; these questions are not rhetorical; just trying to learn here.

So:

1) I'd appreciate if someone could give me a good rundown of how to understand deployment in Rails vs. PHP.

2) I'd appreciate if someone could address my issue with running a hosting/web business around reseller hosting (Hostgator) while also being able to host Rails apps. Can it be done? And how can a company like Hostgator completely ignore what's current in Rails/Ruby?

Thanks.

2
  • 2
    +1 for not saying "hey, I'll just rent a VPS! I won't get hacked because I've got automatic updates, right?"
    – Pekka
    Commented Mar 4, 2011 at 22:53
  • 4
    @closevoters if you have to closevote, at least vote to migrate it to serverfault or webmasters. It's a perfectly fine question, and not argumentative at all
    – Pekka
    Commented Mar 4, 2011 at 23:00

4 Answers 4

8

Although Rails hosting will probably never be as inexpensive as PHP, since the infrastructure requirements are always higher, it is not expensive to host a Rails site.

It does take a certain amount of technical skill to properly deploy a Linux-based server and load on Rails and all the associated database back-end stuff, but this is not an insurmountable obstacle. Any competent programmer could probably get up to speed inside of a few weeks with just a few hours a day and a good reference book. This is the sort of thing that is valuable to know anyway as it helps you tune your deployment environment.

Many "out of the box" Rails hosting systems are expensive. EngineYard, Joyent and Heroku are great examples of that, but in every case they do carry a premium over the self-hosted alternative.

If you have a client that can afford this premium, it's worth taking advantage of their expertise. If you're on a very tight budget, you may not be able to justify this.

The lest expensive Rails hosting solution I know of that works is using Linode with a standard distribution combined with Passenger. With some basic tuning, nothing especially difficult, you can host a small to medium scale site on even their most inexpensive offering. A machine with 512MB of memory can typically host two to three lightly loaded Rails sites or one busy one. By lightly loaded I mean hundreds of visitors per day. Busy is thousands to tends of thousands.

In fact, I have had so much trouble with shared PHP hosting that it's not worth the cost savings to do it that way. Instead I have several VPS systems on Linode that are specifically for PHP hosting, WordPress blogs, typically, and they perform very well. Although you might find it a nuisance that you have to go in and patch the machines once in a while, at least you can schedule that and anticipate potential problems instead of being at the mercy of your provider.

Commodity hosting companies will often break things accidentally and getting service restored can be a time-consuming process of trouble tickets and phone calls.

Deployment of any application, Rails or otherwise, is all about workflow. Many Ruby-oriented tools like Capistrano and Chef can make managing applications much easier than a manual approach.

My take on Rails: It can be a bit more expensive, but it's a lot easier to manage once you get used to the tools and automate your workflow.

1
  • 1
    A good overview on how to host rails, +1. The thing about self-hosting is that you have to be somewhat good at it, reserve some time to look after your box frequently, and know what to do when this happens in the middle of the night. That's what always kept me away from it
    – Pekka
    Commented Mar 4, 2011 at 23:07
5

Not an answer to your question, but to be very honest, my initial impulse when I read about your business setup was: "Why is he not just sticking with PHP?"

Don't get me wrong: I'm sure Ruby is a beautiful language, and Rails a great framework and much of it is in many ways superior to PHP. It's also great for a developer to explore new fields etc. etc.

But from a purely business perspective, PHP is arguably "where it's at" for three important things at the moment:

  • Cheap hosting, and

  • CMS software for every taste, size, skill level and requirement and favourite colour. Some of them are even half-way usable, and

  • Affordable developers, some of them even half-way capable.

So if I were you, I would look into whether your requirements can be fulfilled with PHP first.

Otherwise, +1 for asking a very thoughtful question, and it's going to be interesting to see the results. I have seen affordable rails hosting but it's few and far between.

4
  • Sounds like PHP is half-way there on every count by your description. It's really not that bad as far as the environment goes, and from a business perspective, coding aside, it's just one component for another. What kind of developers you have available might be the driving factor here.
    – tadman
    Commented Mar 4, 2011 at 23:03
  • Thanks. I hope I haven't started a war with this question, and that it won't devolve into that. Just trying to wrap my head around this stuff from the perspective of a business and of an aspiring developer (with no real attachment to any particular language or paradigm).
    – rcd
    Commented Mar 4, 2011 at 23:08
  • @rcd you're welcome. The only thing is that this question might be better off on Serverfault.com or Webmasters.SE - if five people vote accordingly, it will be automatically migrated there.
    – Pekka
    Commented Mar 4, 2011 at 23:17
  • Sounds good; I will keep those sites in mind from now on; if I should do something to move it there (or should just repost it there), please let me know; I may be unaware of such a feature.
    – rcd
    Commented Mar 5, 2011 at 1:01
3

I have found a very good rails shared host: webfaction. I am very pleased with it. Check it out! The prices are amazingly low, they offer one-click installers for rails, the number of sites you can host is unlimited. Their highest supported rails-version is 3.0.5!!! :) You have ssh access to your share, so you have full control, you can deploy using capistrano, or do stuff by hand on the server. Really awesome.

Their documentation is really good, and they have a very active support-forum, for all other questions.

1

A good new solution to this old problem is Digital Ocean.

We deployed a Rack app and it is not that hard. Pricing starts at $5/month/app.

They have a One-Click App for Rails which should make things easier.

Not the answer you're looking for? Browse other questions tagged or ask your own question.