Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx with passenger

I'm trying to move from Apache + Passenger to Nginx + passenger on my Ubuntu Lucid Lynx box.

When I install passenger:

sudo gem install passenger

and

cd /var/lib/gems/1.9.1/gems/passenger-2.2.14/bin
sudo ./passenger-install-nginx-module

everything is fine (no error). Nginx is downloaded and compiled and installed at the same time (when selecting the first option during passenger installation). By default it is installed in /opt/nginx.

I end up with the configuration file /opt/nginx/conf/nginx.conf; This conf file was automatically updated with passenger config). The thing I do not understand is that I also have the configuration file /etc/nginx/nginx.conf. What is the purpose of this one when it seems that the conf file in /opt/... is the main one?

When I run /etc/init.d/nginx start, it starts correclty saying that /etc/nginx/nginx.conf is ok. Does it mean that it does not check the other conf file?

I updated /etc/init.d/nginx script and added /opt/nginx/sbin at the beginning of the PATH and it seems the correct conf file is taken into account. It seems like I have two nginx installations where I only relied on passenger to install it.

like image 805
Luc Avatar asked Jun 07 '10 08:06

Luc


People also ask

What is Passenger for nginx?

The Passenger Nginx module registers Passenger-specific configuration options inside Nginx. You, the administrator, configure Passenger by adding Passenger-specific configuration options to the Nginx configuration file. Restart or reload Nginx to apply any configuration changes.

What does Phusion Passenger do?

Phusion Passenger® is an open source web application server. It handles HTTP requests, manages processes and resources, and enables administration, monitoring and problem diagnosis. Passenger is very easy to use, makes deploying in production much easier and is scalable.

What is passenger in Apache?

It is designed to integrate into the Apache HTTP Server or the nginx web server, but also has a mode for running standalone without an external web server. Phusion Passenger supports Unix-like operating systems, and is available as a gem package, as a tarball, or as native Linux packages.

What is Passenger library?

Welcome to the Passenger Library, a comprehensive online resource about Ruby, Python and Node. js deployment, administration, scaling, high availability and more — through the use of the Phusion Passenger application server. The entire library is open source.


1 Answers

You did end up with 2 Nginx installations:

  1. The one installed globally by your OS's package manager (/usr/sbin/nginx). This uses /etc/nginx/nginx.conf as configuration file by default.
  2. The one installed by Phusion Passenger (/opt/nginx/sbin/nginx). This uses /opt/nginx/conf/nginx.conf as configuration file by default.

Only (2) has Phusion Passenger support. Ignore (1) and do not use it.

like image 66
Hongli Avatar answered Nov 14 '22 10:11

Hongli