Thursday, September 19, 2013

Setup AWS with Nginx + Passenger + Rails 3

1. Bring up a new instance with default AMI

2. Change SSH connection from .pem file dependent to username/password authentication:
+ SSH to server using .pem file as ec2-user account
+ Create a new account and change the ssh configuration to Password Authentication:
sudo su -
useradd -m deploy
passwd deploy
visudo --> add deploy user as sudoer
vi /etc/ssh/sshd_config --> enable PasswordAuthentication
/etc/init.d/sshd reload --> restart sshd server

3. Re-log in as deploy user

4. Update ruby to 1.9
+ sudo yum install ruby19
+ cd /usr/bin
+ sudo su -
+ for f in /usr/bin/*1.9
  ln -fs $f ${f%1.9}

5. Install passenger and nginx
+ sudo su -
+ gem install passenger
+ passenger-install-nginx-module

6. Deploy application with passenger

No comments: