Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passenger and Nginx or Passenger Standalone only?

Excuse me if my question may seem inappropriate but i was unable to find any information regarding my question.

I am currently choosing a production web server for my rails app, Passenger seems to fit my needs perfectly, although there is a small question that popped in my head.

It seems that Passenger is already based on Nginx core, but I see there is also a version passenger-nginx. What's the difference between them if they are both based on Nginx?

Thank you in advance.

like image 490
Vitali Avatar asked Mar 29 '12 08:03

Vitali


People also ask

What is Nginx and passenger?

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 is passenger used for?

What is Passenger®? 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 Apache passenger?

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

When you configure Nginx as a reverse proxy for Apache both may listen to the same port?

You do that by configuring NGINX as a reverse proxy for Apache. With this setup, NGINX will listen for all incoming requests to port 80 and pass them on to Apache, which is listening in on port 8080.


2 Answers

Passenger standalone is good enough to run in production, it may be easier to use the OS packages instead

  • Installation is usually as simple as yum install or apt-get install
  • Usually includes all the appropriate startup scripts like /etc/init.d/nginx
  • You don't have to write scripts to make sure it starts up after rebooting. Ubuntu will automatically set that up, and on CentOS/RedHat, it's just a one-time call to chkconfig
  • Opening ports 80 and 443 usually requires root, but your app should execute as your regular unprivileged user. The OS packages handle this automatically.
  • Running a shared copy of nginx means you can run multiple sites/apps from the same server, by different users, if needed.

It seems that Passenger is already based on Nginx core but i see there are also a version passenger-nginx. What's the difference between them if they are both based on Nginx?

There is almost no difference. Passenger standalone just automates setting up nginx (if you don't already have it) and passenger-nginx. Passenger standalone typically starts as your regular unprivileged user on port 3000 or another a high port number, and nginx typically starts as root using ports 80 and 443.

like image 101
John Douthat Avatar answered Oct 13 '22 19:10

John Douthat


Nginx is a web server on top of that passenger done some binding(In general) so rails application work,prior to that we have to set mogrel cluster or similar to that.

So there are 2 ways you can use nginx+passenger 1) Standalone way 2) In general for all app

Standalone way preferably for dev environment So in general for all app if you have already install passenger You can run passenger-install-nginx-module it will fall into 2 way of installing nginx

If nginx is already present then specify directory if not it will download and install nginx and if you want add another custom library to nginx like for upload module etc you can specify path of library while installing.

I hope this clear out some basic.

like image 21
Amar Avatar answered Oct 13 '22 18:10

Amar