INSTALLING NGINX + PASSENGER + UBUNTU

Installing Nginx + Passesnger Ubuntu :- 

we will refer this link for installing nginx + passenger :-

https://www.phusionpassenger.com/library/install/nginx/install/oss/xenial/

/etc/nginx/
nginx.conf:-

       user root;
       worker_processes auto;
       pid /run/nginx.pid;

       events {
            worker_connections 768;
       }

       http {
            client_max_body_size 1000M;
            sendfile on;
            tcp_nopush on;
            tcp_nodelay on;
            keepalive_timeout 65;
            types_hash_max_size 2048;

            include /etc/nginx/mime.types;
            default_type application/octet-stream;

           ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
           ssl_prefer_server_ciphers on;

           access_log /var/log/nginx/access.log;
           error_log /var/log/nginx/error.log;

           gzip on;
           gzip_disable "msie6";
           include /etc/nginx/passenger.conf;

           include /etc/nginx/conf.d/*.conf;
           include /etc/nginx/sites-enabled/*;
      }

/etc/nginx/
passenger.conf:-

         passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
         passenger_ruby /home/selectivo/.rvm/gems/ruby-2.1.10/wrappers/ruby;


/etc/nginx/sites-enabled
default :-

         server {
              listen 80 default_server;
              listen [::]:80 default_server;
              server_name 136.144.156.213;
              passenger_enabled on;
              root /usr/share/nginx/html;
              location / {
              root /var/deploy/latest/selectivo/current/public;
            }
          }


Notes :-  

When we want to use the passenger with Nginx or Apache. Then we need to find the passenger ruby path.

So, we can easily find the ruby path using :-


passenger-config --ruby-command
When we run then we will get like :-
Command: /home/rohit/.rvm/gems/ruby-2.1.10/wrappers/ruby
  Version: ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]
  To use in Apache: PassengerRuby /home/rohit/.rvm/gems/ruby-2.1.10/wrappers/ruby
  To use in Nginx : passenger_ruby /home/rohit/.rvm/gems/ruby-2.1.10/wrappers/ruby
  To use with Standalone: /home/rohit/.rvm/gems/ruby-2.1.10/wrappers/ruby /usr/bin/passenger start
Add that line in passenger.conf file

Popular posts from this blog

CARRIERWAVE - UPLOAD ANY MEDIA (AUDIO , VIDEO AND IMAGE ) FILE IN RAILS

SELECT COUNTRY WITH STATE AND IT'S CITIES RAILS

CREATE API FOR USER SIGN UP, LOGIN AND CREATE PUBLISHER WITH CURRENT USER

RAILS: UPLOADING PHOTOS VIA AMAZON S3 AND PAPERCLIP (UPLOADING FILES TO S3 IN RUBY WITH PAPERCLIP)

UNINITIALIZED CONSTANT PAPERCLIP::STORAGE::S3::AWS

DEPLOYING PROJECT USING CAPISTRANO (CAPISTRANO IN RAILS)

GENERATE PDF FILE IN RAILS

HOW TO CALL RAILS API FROM SIMPLE HTML PAGE.