<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.apoyar.eu/index.php?action=history&amp;feed=atom&amp;title=Installing_ruby_on_rails_with_Nginx_passenger</id>
	<title>Installing ruby on rails with Nginx passenger - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.apoyar.eu/index.php?action=history&amp;feed=atom&amp;title=Installing_ruby_on_rails_with_Nginx_passenger"/>
	<link rel="alternate" type="text/html" href="https://wiki.apoyar.eu/index.php?title=Installing_ruby_on_rails_with_Nginx_passenger&amp;action=history"/>
	<updated>2026-07-21T03:47:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.apoyar.eu/index.php?title=Installing_ruby_on_rails_with_Nginx_passenger&amp;diff=74&amp;oldid=prev</id>
		<title>78.45.88.190: Configure Nginx to use Ruby on Rails.</title>
		<link rel="alternate" type="text/html" href="https://wiki.apoyar.eu/index.php?title=Installing_ruby_on_rails_with_Nginx_passenger&amp;diff=74&amp;oldid=prev"/>
		<updated>2017-05-29T10:17:02Z</updated>

		<summary type="html">&lt;p&gt;Configure Nginx to use Ruby on Rails.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;* install requisites:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;apt-get install ruby ruby-dev ruby-bundler&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* install the Passenger app:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;apt-get install -y apt-transport-https ca-certificates&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sh -c &amp;#039;echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main &amp;gt; /etc/apt/sources.list.d/passenger.list&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;apt-get update&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;apt-get install nginx-extras passenger&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* install ruby dev packages:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;apt-get install libgmp3-dev make gcc g++ libpq-dev &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* set Nginx to use Passenger:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;vi /etc/nginx/nginx.conf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* find the following lines, and uncomment them:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;include /etc/nginx/passenger.conf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* edit the Passenger configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;vi /etc/nginx/passenger.conf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* change the passenger_ruby line to point to your ruby executable:&lt;br /&gt;
&lt;br /&gt;
passenger_ruby /home/deploy/.rbenv/shims/ruby; # If you use rbenv&lt;br /&gt;
&lt;br /&gt;
passenger_ruby /home/deploy/.rvm/wrappers/ruby-2.1.2/ruby; # If use use rvm, be sure to change the version number&lt;br /&gt;
&lt;br /&gt;
passenger_ruby /usr/bin/ruby; # If you use ruby from source&lt;br /&gt;
&lt;br /&gt;
The passenger_ruby is the important line here. Make sure you only set this once and use the line from the example that pertains to the version of Ruby you installed.&lt;br /&gt;
&lt;br /&gt;
Once you&amp;#039;ve changed passenger_ruby to use the right version Ruby, you can run the following command to restart Nginx with the new Passenger configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;service nginx restart&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* In order to get Nginx to respond with the Rails app, we need to modify it&amp;#039;s sites-enabled:&lt;br /&gt;
&lt;br /&gt;
server {&lt;br /&gt;
    listen 80;&lt;br /&gt;
    server_name devtimesheet.apoyar.eu;&lt;br /&gt;
    passenger_enabled on;&lt;br /&gt;
    rails_env production;&lt;br /&gt;
    passenger_friendly_error_pages on;&lt;br /&gt;
&lt;br /&gt;
    root /var/www/timesheet;&lt;br /&gt;
    passenger_app_root /var/www/timesheet;&lt;br /&gt;
&lt;br /&gt;
    access_log /var/log/nginx/timesheet_access.log;&lt;br /&gt;
    error_log /var/log/nginx/timesheet_error.log;&lt;br /&gt;
&lt;br /&gt;
    # redirect server error pages to the static page /50x.html&lt;br /&gt;
    error_page   500 502 503 504  /50x.html;&lt;br /&gt;
    location = /50x.html {&lt;br /&gt;
        root   html;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>78.45.88.190</name></author>
	</entry>
</feed>