Translations of this page?:

VPS Setup nginx passenger

This tutorial was preformed using Ubuntu 8.04 LTS

$ ssh root@12.12.12.12 (your IP address)

Building Essentials

$ apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev vim wget curl
$ apt-get -y install mysql-server libmysqlclient15-dev mysql-client

User Administration

$ adduser demo
$ visudo 

Add to the end of the file:

demo ALL=(ALL) ALL)

Set Up SSH (Local Machine)

$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ scp ~/.ssh/id_rsa.pub demo@12.12.12.12:~

Setup SSH (Remote Server)

$ mkdir /home/demo/.ssh
$ mv /home/demo/id_rsa.pub /home/demo/.ssh/authorized_keys
$ chown -R demo:demo /home/demo/.ssh
$ chmod 700 /home/demo/.ssh
$ chmod 600 /home/demo/.ssh/authorized_keys

Edit the SSH configuration.

$ sudo vim /etc/ssh/sshd_config
PermitRootLogin no
X11Forwarding no
UsePAM no
UseDNS no
AllowUsers demo
$ sudo /etc/init.d/ssh restart
$ ssh demo@12.12.12.12

Locales

$ sudo locale-gen en_GB.UTF-8
$ sudo /usr/sbin/update-locale LANG=en_GB.UTF-8

Git

$ sudo apt-get install tcl8.4 tk8.4
$ cd ~/temp\
$ wget kernel.org/pub/software/scm/git/git-1.6.3.1.tar.gz
$ tar xzvf git-1.6.3.1.tar.gz
$ cd git-1.6.3.1
$ ./configure
$ make
$ sudo make install
$ sudo ln -s /usr/local/bin/git /usr/bin/git

Ruby & Passenger

$ mkdir ~/temp && cd ~/temp
$ wget rubyforge.org/frs/download.php/57097/ruby-enterprise-1.8.6-20090520.tar.gz
$ tar xzvf ruby-enterprise-1.8.6-20090520.tar.gz
$ sudo ./ruby-enterprise-1.8.6-20090520/installer
$ export PATH=/opt/ruby-enterprise-1.8.6-20090520/bin:$PATH
$ sudo /opt/ruby_ee/bin/passenger-install-nginx-module

Nginx

$ sudo useradd -s /sbin/nologin -r www-data
$ sudo usermod -a -G www-data demo
$ mkdir ~/public_html
$ mkdir ~/public_html/01_project
$ sudo su
$ chgrp -R www-data ~/public_html/
$ chmod -R 2750 ~/public_html/
$ mkdir /opt/nginx/sites-available
$ mkdir /opt/nginx/sites-enabled
$ wget railsgeek.com/vps/vhost01 -P /opt/nginx/sites-available
$ ln -s /opt/nginx/sites-available/vhost01 /opt/nginx/sites-enabled
$ wget railsgeek.com/vps/nginx.conf -P /opt/nginx/conf
$ wget railsgeek.com/vps/nginx -P /etc/init.d
$ chmod +x /etc/init.d/nginx
$ /etc/init.d/nginx start

Discussion

Daniel Waite, 2009/06/05 21:44

Regarding the git portion, I had to run ./configure before running make.

John Yerhot, 2009/08/27 19:03

Thanks Daniel. I've added it to the page.

 
deployment/vps-setup-nginx-passenger.txt · Last modified: 2009/08/27 19:02 by yerhot
 
Recent changes RSS feed Creative Commons License