Phusion Passenger

Tram Ho

Passenger

Passenger is an open source web application server for ruby. It handles handling HTTP requests, managing processes and resources. It also allows us to view and analyze problems. Passenger is easy to use and deploy to production.

Passenger is an app server like (puma, unicorn, torquebox). Nginx, Apache is a web server.

The passenger then helps you automatically connect between web apps and the web server

If you used to use unicorn to connect rails apps to web server and capistrano to automatically compile assets, package code … then you can use the passerger because it is modern and easier to deploy. Below is a comparison of the speed. It can be said that passenger runs 4 times faster than other ruby ​​web servers.

We all know Unicorn, Puma, Torquebox are all different so fast to be 2 -> 4 times faster is very difficult. However, there are many reasons to help Phusion Passenger faster.

https://www.rubyraptor.org/how-we-made-raptor-up-to-4x-faster-than-unicorn-and-up-to-2x-faster-than-puma-torquebox/

You can refer to the link above.

Deploy with phusion passenger and nginx

  1. Install nginx and start nginx

    Nginx as mentioned above will be a web server, which will send requests from user to app server. If the request does not change frequently as css, js, the web server can resolve it without interacting with the app. Thus processing speed will be fast.

  2. Passenger installation

    You can install it via gem passenger

    Connect the module to nginx

    Or install via apt

    Next, create an APT file:

    Authorize the file and save it

    Update and install passenger with nginx

    OK so successfully installed the passenger

  3. Config nginx

    Open the file /etc/nginx/nginx.conf and leave the comment in two lines

    If not, we can add it in the http block

  4. Restart nginx

  5. Verify validate installation

  6. Check out the progress

  7. Create rails app, database, bundle, gem environments

    For example, app /var/www/html/passenger-app/public contains the source code of the app

  8. Config web server Create a config file to connect to your passenger-app rails passenger-app

    Add config

    Save and create symlinks

  9. Reset nginx and see results

Share the news now

Source : Viblo