There is a lot of demand in my country for rails and hosting, yet there is not one provider that does this. Are there packaged solutions, or at least guides, out there that can help me get started with providing hosting to people?
You can think of it as a local Heroku.com
I think there is no detailed guides, because every hosting is differs because the demands are different.
For a small sites the Apache/NginX and Phusion Passenger will be very good, because it is easy to use. For large sites, a dedicated VPS is a better solution, because it cannot stale performance (e.g. memory) from other sites.
Some special cases, you can use separated mongrel or webrick instances and proxy them over the webserver.
See the following keywords in google: capistrano, phusion passenger, ruby enterprise, linux rails hosting, xen vps hosting.
Partnering with Jelastic PaaS is a perfect match here. This cloud platform provides out-of-box support for Ruby hosting with automated deployment to containers, automatic scaling and intuitive UI for management https://jelastic.com/blog/ruby-paas-hosting/
And it can be installed on top of any infrastructure (bare metal, IaaS, clouds like Azure or GCP). Currently, it is already available in many countries from local service providers https://jelastic.cloud/
If interested, just drop a message here https://jelastic.com/cloud-platform-for-hosting-providers/
Related
I have a rails application that is currently hosted on Heroku. It is used on our local network only, and my boss does not want a 3rd party hosting our data. I convinced IT to set me up a virtual windows server to deploy my app on. However, it has been very difficult to set up for production.
Is there anyway that I can use a hosting service for my application, but have the database reside on our local network?
Or is there an easier way to deploy a rails app on a windows server? I have been looking into using the Linux Subsystem for Windows.
If your app is used on your local network only, why not ditch Heroku and host your Rails app locally as well? What benefit is a scalable cloud hosting provider giving you? Especially since it seems your boss has security concerns about remote hosting of a database. Bringing the entire thing in house may be the best solution.
Simple answer is yes you can, but why would you. It's simpler to run your application locally than connecting your remote app to a local database.
Your best bet is to use a Linux virtual machine instead of Windows, usually there is to much hassle to get rails application to work on windows, especially compiling native gems.
I suggest that you get a CentOS VM, and install Nginx with passenger gem using rbenv or rvm.
Digital Ocean has a nice guide that explains this process in details:
How To Deploy Rails Apps Using Passenger With Nginx on CentOS 6.5
I am new to Ruby on Rails. I have been working as junior developer and most of time working on localhost so don't know how to launch Ruby on rails application, How to Configure Ruby on rails application and how to deploy it.
often I came accross following terms but don't know It's meaning and how to use them and where to use them.
Apache
Phusion Passenger
Heroku
nginx
Please Help me and also looking forward to any good tutorial to learn all that terms.
Thanks.
I think there is quite a lot of resources on the web for this, but :
Heroku is a platform as a service. Basically, you push your rails app to a git remote, and that's it, deployed. You can manage addons, workers, and processes from CLI, and scale up/down if you need. Probably the most painless way to start with.
Apache & nginx are two werbservers, I'd say they are the most common in the rails world. Nginx is the latest of the two and it seems to be better for most of the tasks, but if you want to know which to choose, there is several posts on the internet for that too.
Phusion passenger is the bridge (or one of the available bridges) between your rails app and your webserver. If you've done php before, think of it as mod_php.
Since this is all new to you I'd advise that you start with hosting on Heroku. You can do a lot with the free version and it's arguably the easiest way to get started with hosting your rails website. Check out the getting started guide from Heroku. There's also another beginners guide here.
Once you feel comfortable with Heroku your next step could be looking into hosting on your own virtual private server (VPS). The setup is much more manual but things that would cost extra money on Heroku are now free if you set it up yourself on your VPS. Here is a great article on VPS hosting.
For reference, I was hosting websites on Heroku for about a year before I started looking into hosting on my own VPS. Now what I do is start by hosting my projects on Heroku since it's the fastest way to get up and running. Then if the website is successful I transition to a VPS.
I am about learning to program with Ruby on Rails but I'd like to know if web applications built on ROR can be hosted on the regular Linux servers.
Absolutely. One of the great reference books on Rails, "Agile Web Development with Rails" (written by the guys that created Rails), takes you through a whole demo app that includes server setup, configuration, deployements, everything. They deploy on Linux.
I also ran a site for over a year that was a Rails app, on Linux, and it totally rocked.
I think you'll also find that the broader Rails community prefers Linux. That means when you need help with something, you're much more likely to find someone else who has had your specific problem and is able to help you fix it.
You may also find this question helpful in choosing - how to select a Rails host (if you don't host it yourself).
Yes they can be and its advised to use Linux Hosting. I hardly if anybody uses windows hosting for Ruby on Rails. As for servers, You can use
A server called Mongrel ( in a cluster ) Behind Apache or Nginx.
Unicorn
Apache with Mod_Rails ( Phusion Passenger )
My setup: Rails 2.3.10, Ruby 1.8.7 on Windows
The last time I deployed a Rails app from Windows to Linux on Slicehost, I used Capistrano, Nginx, Mongrel, and SVN. That was 3 years ago, fast forward to now, I'm still on Windows for development and is now looking to deploy to EC2. A quick search turns up tools like Rubber and Chef which aren't easy to grasp with a quick read. It seems like Rubber and Chef are designed for multi-EC2 instances deployment which will be useful when I need to scale.
I'm also new to Passenger but it seems to be the default way to deploy Rails app nowadays, one thing that isn't so clear to me is whether Passenger is a replacement for Mongrel? In my old setup, I configured Nginx to forward the Rails requests to a cluster of Mongrel processes but I don't see anything like that for Passenger.
Any insights are much appreciated.
We use something like what you're describing for our production server: EC2 + Apache + Passenger. We haven't had any need to use the fancy deployment tools you describe - plain old Capistrano (plus capistrano-ext so we can use it for multiple environments) does the job just fine. I've looked at Rubber (not Chef), but deemed it needlessly automagical and too poorly documented, and I'm really not sure what it offers that can't be done just as well with roles in Capistrano.
Passenger has been great. It's an "overseer" that manages a collection of Mongrel-like workers (I had thought that the workers were Mongrels, but upon further reading, I don't think they are. The Passenger comparisons page even compares its RPS to a Mongrel cluster, so...), starting them up as needed, culling them under low loads, restarting them if they crash, etc. It's actually very similar to the Server + Mongrel Cluster you described, but probably a bit better, as Passenger has an understanding of the underlying workers that Nginx / Apache don't. And you'll have to make a few minor tweaks to get Capistrano playing nicely with Passenger.
And if possible, pair Passenger with Ruby Enterprise Edition (from the same guys who made Passenger). It's a much faster version of Ruby, mostly due to a rewritten, configurable garbage collector. You'll have to tune your GC settings to get the most out of it.
Hope this helps!
Both might help:
http://ginzametrics.com/deploy-rails-app-to-ec2-with-rubber.html
Hosting rails on ec2
Rubystack allows you to have the same Rails environment for development on Windows and for deployment on Linux. We also have EC2 images (scroll to the bottom) and it is completely free, so you may want to give it a try.
Also, this may not work for you, but depending on your requirements, you may want to go for a PaaS solution like Heroku
After a bad experience trying to get even the simplest Rails application running at Lunarpages, I'm moving to Slicehost. Does anyone have an opinion as to which of their Linux distros to use for a fairly high-traffic Rails site? They offer CentOS, Debian 5, Fedora (10 to 12), Gentoo, Red Hat EL 5, and Ubuntu (8 and 9).
While we're on the subject, does anyone have any opinions as to the relative merits of Slicehost versus Amazon WS?
Thanks!
I've always been a fan of Ubuntu, it's easy to use and lots of other people are using it so there is a lot of information if you run into trouble.
I've never used Slicehost but AWS is pretty great if you're going to be bringing instances up and down often (since you only pay for what is running). If you just have one server that will be running continuously then AWS might end up costing more without giving you much benefit. It all depends on how you use it though and if the flexibility of AWS is worth the (potential) added cost in your situation.
If you are interested in systems administration. I would go with Slicehost, Linode or AWS ec2, Linode has been shown to be more performant (link) than both Slicehost and AWS.
With that said, if you aren't interested in systems administration I would go with Heroku. It is the easiest way to deploy and management is minimal. You do have to be aware that Heroku is limited on some 3rd party services you would install on your own, but but they do have some packages included that you can enable for sending email etc. You are also limited on file size and they recommend you store your assets on AWS s3.
In terms of overhead Linode is less than AWS ec2, because AWS ec2 is really for high availability, Heroku is the least as mentioned above. AWS will cost you more than Slicehost or Linode and I think if your site is small more than Heroku too.
You will need decent Linux chops to get going on AWS, Slicehost, and Linode. Heroku will keep you away from most of this but also limit you if you need something really custom. For distro choice I would say Ubuntu hands down if you are new.
I've run RoR on Ubuntu 8.04 LTS on Amazon (Approx 3-4 years worth of uptime across a few servers for a couple of sites) and Slicehost (Approx 8 months). I've had zero complaints/niggles/problems with the linux distro or the hosts themselves. I'd just grab whatever linux distro you're most comfortable with, I build pretty much everything from source for RoR in production anyway:
Download gem
Build Ruby EE from source
Install passenger with nginx from source
etc. etc.
As to the merits of your two options, I've always used Amazon for work/business and slicehost for smaller stuff. This is pretty subjective and I really can't fault either, but for work/important stuff I'd still lean towards Amazon. It's not a strong leaning, but the flexibility of turning on/off instances at will, plus S3 would have me go that way again.
I'm using slicehost and running Ubuntu intrepid with passenger/rails.
My choice was mostly based on there being a lot of rails related documentation for that distro. Which has definitely made it easier.
http://articles.slicehost.com/ubuntu-intrepid
In terms of dedicated rails hosts, don't forget to check out heroku. They use a completely git-based system to deploy your app (which can be written against any of the major Ruby frameworks), and you only get charged for the database and CPU-hours that you actually use.
I also have heard good things about EngineYard.
Ubuntu is likely the most popular OS for Rails, probably because of Ubuntu being a very popular Linux distro. It's a great OS that will do anything and everything you need it to.
Having said that, it's not necessarily the only distro that works well with Rails. CentOS, for instance, is an excellent choice as well.
I would also second other people's recommendations of Heroku, and EngineYard as well. For VPS, I would probably rather pick Linode over Slicehost.
I'm partial to Ubuntu, as once you get your apt-get all updated and squared away, installation is quite quick and painless. Though, I'm sure this is said for any distro that makes good use of apt-get.
I second (or whatever sequence this shows up as) the calls for Heroku and Linode.
As for Amazon, I use the S3, and RDS if I can. The RDS not as much, but I'm moving some stuff there. But paperclip with the S3 is pretty great.
I use Centos for development and production, not problem with that, I think you need check some specific needed points in your app and only important stuff.
A GNU/Linux distribution with required points (or maybe that allow to put in) is all that your need, for example begin from a kernel.