RVM Nginx Passenger Rails configuration Server

Source: Internet
Author: User

Install passenger

1

Gem Install passenger

Install Ngnix

1

Passenger-install-nginx-module

Nginx and passenger are already installed, default configuration and commands

1

#配置

2

/opt/nginx/conf/nginx.conf

3

Command

4

/opt/nginx/sbin/nginx

Modify the default file

1

HTTP {

2

passenger_root/library/ruby/gems/1.8/gems/passenger-4.0.5;

3

Passenger_ruby/system/library/frameworks/ruby.framework/versions/1.8/usr/bin/ruby;

4

Rack_env gabriellocal;

Prepare Rails project, view Phusion

Configuring the server, configuring templates

1

server {

2

Listen 80;

3

Passenger_ruby/users/soft/.rvm/wrappers/ruby-1.9.3-p429@rails3/ruby;

4

server_name localhost;

5

Root/users/soft/sites/rails-unity/public; # <---Be sure to the ' public '!

6

Passenger_enabled on;

7

}

You need to configure the following

Passenger_ruby Use the correct ruby version

server_name owns the domain name

Listen-Listening ports

The public directory of the root Rails program

The latter items are fine, the first one is obtained by following

1

#切换到正确的rails版本

2

RVM Use 1.9.3@RAILS3

3

#安装passenger, there's no such command.

4

Gem Install passenger

5

Passenger-config--ruby-command

6

#在输出结果中找出 Passenger_ruby,

Reboot Nginx, complete

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.