views:

236

answers:

2

Hello,

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 / 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 have updated /etc/init.d/nginx script and add /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 2 nginx installations where I only relied on passenger to install it...

Thanks a lot for your help, I am kind of lost here :)

Luc

A: 

I don't think that this is a programming related question, but anyway...

It seems like passenger installation have configured nginx to look for config file in /etc/nginx. Post your nginx configure flags and check if /etc/init.d/nginx overrides config file path.

http://wiki.nginx.org/NginxCommandLine

adlanelm
Hello, well it seems that I got 2 installations. Still do not know how this happens but this is the case. I probably missed something in my installation script :) thanks anyway. Regards,Luc
Luc
+2  A: 

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.

Hongli
Thanks a lot, but what I do not understand is how the first one has been installed ? I did not issue any apt-get install nginx command. Well, thank you, this is much clearer now :)
Luc