вторник, 29 октября 2013 г.

Configure Passenger + Nginx + RoR



Under sudo user:

sudo apt-get update

To install RVM, open terminal and type in this command:
curl -L get.rvm.io | bash -s stable

After it is done installing, load RVM.
source ~/.rvm/scripts/rvm

In order to work, RVM has some of its own dependancies that need to be installed. You can see what these are:
rvm requirements

rvm install 1.9.3

rvm use 1.9.3 --default
 rvm rubygems current
gem install passenger 

sudo apt-get install libcurl4-openssl-dev


Here is where Passenger really shines. As we are looking to install Rails on an nginx server, we only need to enter one more line into terminal:

rvmsudo passenger-install-nginx-module

sudo service nginx start

Also can use this script for init.d service

wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
sudo mv init-deb.sh /etc/init.d/nginx

sudo chmod +x /etc/init.d/nginx

sudo /usr/sbin/update-rc.d -f nginx defaults


after that you can control nginx with

sudo /etc/init.d/nginx stop

sudo /etc/init.d/nginx start

sudo /etc/init.d/nginx restart





Комментариев нет:

Отправить комментарий