setting up a vps for rails: looking for advice, tutorials, etc.

9 views
Skip to first unread message

scott

unread,
Feb 29, 2012, 6:03:30 PM2/29/12
to rubyonra...@googlegroups.com
i am trying to learn how to setup and maintain a vps for some rails apps. i have used shared and managed hosting but now i am looking for the freedom and flexibility a vps offers. i signed up with linode to give me something to play around with until i feel comfortable to deploy my live apps to a vps. i want to learn best practices and how to do things right.

initially i plan on hosting only a few smaller rails apps, but hopefully more in the future.

i have searched google and read quite a bit, but was wondering if any of the rails professionals could point me in the direction of some good resources or give their input directly? 

i have also read through many of the stackscripts and some seem good, others don't even setup a firewall.

here are some of the questions that have been going through my head that i have been trying to figure out.

security
-all rails apps under one user or separate user for each app?
-is it necessary to change the ssh port?
-how insecure is keeping ssh passwords enabled?
-fail2ban?

keeping the software up to date
-apt will help keep the os and some apps up to date
-how to easily keep compiled software updated like nginx?
-how about ruby, gems, rails,...

which of the following is better for rails apps
which linux distro?
32bit vs 64bit?
iptables vs ufw?
apache vs nginx?
mysql vs postgresql?
passenger vs unicorn?
is it a good or bad idea to use rvm on a server?
rvm per user or system wide?

what are some good strategies for backing up the server in case of failure?

how do you monitor the resource usage to see if more ram or cpu is needed?
how much of what do you log and how do you monitor the logs?

thank you,
scott

Philip Hallstrom

unread,
Mar 1, 2012, 11:30:28 AM3/1/12
to rubyonra...@googlegroups.com

On Feb 29, 2012, at 3:03 PM, scott wrote:

> i am trying to learn how to setup and maintain a vps for some rails apps. i have used shared and managed hosting but now i am looking for the freedom and flexibility a vps offers. i signed up with linode to give me something to play around with until i feel comfortable to deploy my live apps to a vps. i want to learn best practices and how to do things right.
>
> initially i plan on hosting only a few smaller rails apps, but hopefully more in the future.
>
> i have searched google and read quite a bit, but was wondering if any of the rails professionals could point me in the direction of some good resources or give their input directly?
>
> i have also read through many of the stackscripts and some seem good, others don't even setup a firewall.
>
> here are some of the questions that have been going through my head that i have been trying to figure out.

You've got a lot of questions here that aren't rails specific... and a lot that are 6-to-1 half-dozen to the other...

Since you mention linode, I'd spend the time to read through the articles at http://library.linode.com/. And the comments. Then for a slightly different take read through http://articles.slicehost.com/.

> security
> -all rails apps under one user or separate user for each app?

Up to you. Are the apps related? Even if they are under a different user, can one user still read the other user's files?

> keeping the software up to date

> -how about ruby, gems, rails,...

I'd suggest not using the OS' apt for gems... use rvm and bundler, etc.

> which of the following is better for rails apps

> rvm per user or system wide?

If you go with Passenger you'll need to use rvm system wide as passenger can only use one ruby instance.

-philip

Reply all
Reply to author
Forward
0 new messages