четверг, 14 июня 2012 г.

Ubuntu Rails3 rvm

Original please see: http://thekindofme.wordpress.com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/

Before installation:
sudo apt-get update
sudo apt-get install build-essential git-core curl libmysqlclient-dev nodejs
sudo apt-get install libtool
sudo apt-get install gcc

Install rvm:
curl -L https://get.rvm.io | bash -s stable --ruby

If you have problem due installing nginx(openssl) please see:
http://jamiecurle.co.uk/blog/setting-up-rails-in-ubuntu-10-dot-04-using-nginx-and-passenger/


Install nginx+passenger and make it as service:
https://gist.github.com/sathishmanohar/5491263

Ubuntu ssh keys.

Please see https://help.ubuntu.com/community/SSH/OpenSSH/Keys


mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
sudo service ssh restart
vi .ssh/authorized_keys


Add your local id_rsa.pub to the authorized_keys.

chmod 600 ~/.ssh/authorized_keys


Luck!

Set up new user on the ubuntu.

Add new user:
sudo useradd ubuntu -m -s /bin/bash
Add new group:
# sudo addgroup admin
Add user to group:
# sudo adduser <username> <groupname>
in our case:
# sudo adduser ubuntu admin
Make ubuntu sudoers without password:
 # sudo vi /etc/sudoers
Set up
%admin ALL=NOPASSWD: ALL 
for %admin group.

Check:
#sudo su ubuntu 
sudo ls -ls //should not need password

Good luck!