How to migrate Refinery CMS to CentOs 5.x - ruby-on-rails

I am new to Ruby on Rails.
I have built a demo site with Refinery CMS on my Mac environment and am ready to deploy it to my Virtual Dedicated Server running CentOS 5.x.
Can anyone walk me through the steps to deploy Refinery CMS on my server?
NOTE: I have successfully installed Ruby, Rails (correct versions to Refinery specs) and all the needed gems including Passenger.
I simply cannot figure out how to make the site work on my server. I would really appreciate some help on this as documentation is difficult to come by, I have already spent over $100 on books and they are of no help.
Thank you!!!!

Related

How to deploy a rails project on a Ubuntu server?

I've developed my Rails project locally and want to deploy it on my Ubuntu VPS. Now I've installed the gems on the VPS and copied my Rails App code to it. I can execute rails s --binding=0.0.0.0 in a putty session to the VPS and the website can be access from the Internet. The problem is when I close putty, the website is down. How to start my Rails App in a way that it still alive even if I closed putty?
Using rails s is not the way to go. It will use Webrick(or a different one if you choose) to handle the requests and it can be quite slow.
You should setup a production stack for serving your website.
Here is one of the best tutorials I've seen about how to deploy a Rails app to a production server(VPS).
In short you gonna need install RVM or Rbenv, Ruby, some libs, Database, Nginx and Passenger. You have alternatives too. But this is the basic.
I recommend using Capistrano for deploy. You can choose another deployment tool also, or none.
rails s it is best for development only.

Setting up Ruby on rails web application on Linode

I am an absolute newbie to web development and ruby on rails. I am planing to deploy a ror application on the Linode 512 plan. My website would be basically a forum that allows users to upload photos using Ruby 1.9.3 and Rails 3.2.
Which OS should I use? What are their difference? (Ubuntu / Debian / CentOS / Fedora)
Should I use Apache or Nginx? What are their difference?
Should I use PostgreSQL, MySQL, MongoDB or any other kinds of DB provided on Linode? What are their difference?
My target audience would come from China which means I can't use Amazon S3. Should I let the users upload the photos to the Linode server?
Is there any step-by-step beginner‘s guide for this issue?
Thx
First of all, I think you are worrying too much. If you are a newbie, just follow the popular choice for a start, then change, modify, scale as you go. As your skills mature, you will know what best suites you.
Below are some choices that will be easier for you:
Which OS should I use? What are their difference? Ubuntu
Should I use Apache or Nginx? What are their difference? Apache. If it is a small website, it doesn't matter for now.
Should I use PostgreSQL, MySQL, MongoDB or any other kinds of DB provided on Linode? What are their difference? MySQL. MongoDB is a NoSQL database, may not be for you for the moment.
My target audience would come from China which means I can't use Amazon S3. Should I let the users upload the photos to the Linode server? Upload to Linode for now. Don't scale it prematurely.
Is there any step-by-step beginner‘s guide for this issue? Ryan's RailsCasts: http://railscasts.com/episodes/373-zero-downtime-deployment and http://railscasts.com/episodes/335-deploying-to-a-vps, they are must-watch, but not free.
For all these setup, Linode's tutorial is good for a start. You should look at #Stefan answer too.
You should also try to deploy to Heroku just to get a feel of it. Rails Tutorial is good for you to learn up from development to deployment.
There are several dedicated Rails setup guides on Linode:
Apache and Passenger:
Ruby on Rails with Apache on Debian 6 (Squeeze)
Ruby on Rails with Apache on Ubuntu 10.04 (Lucid)
Ruby on Rails with Apache on Ubuntu 10.10 (Maverick)
nginx and Passenger:
Ruby on Rails with Nginx on Ubuntu 10.04 (Lucid)
Ruby on Rails with Nginx on Ubuntu 10.10 (Maverick)
Ruby on Rails with Nginx on Debian 5 (Lenny)
Ruby on Rails with Nginx on CentOS 5
As we have many linode deployment for rails apps my recommendation would be:
ubuntu/centos + mysql/postgres + nginx + passenger
If your application is going to have huge fb inout operations then you can mongodb as choice

Can I deploy a Rails App directly onto my companies website?

I have originally been hosting my apps on Heroku, however this is not an acceptable deployment method in my current environment. We have personal information in our applications that deploying to Heroku and setting up DNS forwarding is not acceptable. Regardless of how 'secure' or 'reliable' anyone may think it is, it is just not acceptable in my case.
Our host is siteturn.com, integrated with Plesk 10.4.4. If I SSH onto our websites server as admin and type
ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux].
rails -v
Rails 2.3.5
It appears Ruby and Rails are already installed (Older versions than I require, as I need ruby 1.9.3 and Rails 3.2) If I'm not mistaken it seems like my host 'supports' rails (why else would it already have it installed :P).
How should I go about deploying my application directly onto my companies website?
Heroku is an awesome service but the ease of deploying to Heroku has given you a skewed view of what is involved in hosting your own rails website. Heroku has shielded you from a lot of the hard parts.
For example, just because ruby and rails is installed does not necessarily mean you can host a production rails website. You'll need a rails specific web server (for example nginx and passenger, unicorn, etc). You also need a database (MySQL or Postgres) assuming your web app uses one. Also, as you said you need to upgrade the versions of ruby and rails.
That's just to get the server setup. After that you can get to the deployment part. Capistrano seems to be the most popular choice right now.
Take a look at this railscast episode on deploying to a virtual private server for a very good overview of what is involved. It also briefly goes into Capistrano as well. It's not a free episode but I feel it's definitly worth the money.
Pick up a copy of Agile Web Development with Rails, Third Edition and read what it says about deployment. That should get you started. There's more info required than can be put in a SO answer.

Requirements to run Ruby on Rails on Server

I want to develop a website using Ruby on Rails.
What is the requirements for the Server, i.e. what do I have to tell the admin what I need. I believe the server will be running on a machine that is already hosting some websites which use PHP. I dont know more about that so far, and it will probably be depending on my requirements.
As far as I understood from documentation and other questions the server needs to have ruby, rails installed. It also said that I could use cgi.
My problem is that I need a concrete list of things that my admin should provide.
Another question suggests that the only thing is to intall Phusion Passenger if I can use an Apache Werbserver. This would seem like an option maybe.
So what do I really need?
Phusion Passenger is the easiest way to go in a mixed environment.
A Rails app needs these things:
ruby (ruby enterprise edition or MRI 1.9.2)
rubygems
sort of gems handled with bundler
You should try it with Passenger on Your local computer. Then you will see the list for the installation.

Correct way to set up Rails environment?

Thanks Tilo for your response. I will try to ask a better question.
I need to set up a Ruby on Rails Production environment that will only be used to host RoR applications and will be used as a Git server too. There will be no development done to these applications on the Production server. Right now, I forsee the production server hosting a maximum of 5 to 6 applications only. A couple will be company internal only and the rest of the apps will be viewable to the public. The traffic that they will receive is about 12 to 20 hits per week.
I have been given access to a Virtual Machine that will be the Production server and is currently running Ubuntu 10.04 LTS, Apache2, MySQL, and Passenger. There will be two RoR developers using the Production server to host their applications.
My Development Environment of which I am running Ubuntu 10.04 LTS, Apache2, and MySQL on my own laptop looks like this for each project/application:
RVM installed per application, Git,
Ruby 1.9.2 installed thru rvm, Rails
3.0.3, and I have yet to install the Capistrano gem.
My question is I don't understand how to host a RoR application on our production server.
As an example of what might be done to host a RoR application: I am surmising that I will create a user called app1 under the home directory. Next, should I install Ruby system wide or should I install rvm for app1 and then Ruby for app1? What are the steps involved on how to set-up the environment to run an application on a production server?
Can you give me a few setup scenarios, please?
Thanks in advance.
You didn't tell us what you want to use this web-site for... is it company internal only?
just a few users? or is it externally facing the internet? Just one server running everything?
If it's facing the internet, I would certainly stay away from Ubuntu... look at CentOS/RedHat or FreeBSD to install on a production server.
I'd definitely use Capistrano for deployment. Definitely Git.
I would definitely not install RVM system-wide - IMHO it is not robust enough.
I emailed with Wayne Seguin (maker of RVM) and he also uses the method I've outlined in the post below,
using one dedicated deploy user:
For how to deploy ruby-versions and gems with RVM, look at this post:
Installing Ruby offline using rvm
If you really need two versions of Ruby for two different apps, then use two deploy-users!
Each of them has their own default-ruby-version(!) that's why you really need two users :)
and you can install / manage the gems for each project separately under each of the deploy accounts.
You should also put the git repository in each of the accounts, so you can test.

Resources