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 :-
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
When you getting error when we start the nginx :-
When you getting error when we start the nginx :-
Can't start Nginx - Job for nginx.service failed
Job for nginx.service failed. See "systemctl status nginx.service" and "journalctl -xe" for details.
Then we need to install the nginx :-
Then, install nginx
from the PPA - sudo apt-get install nginx nginx-full nginx-common
should do this.
Comments