Passenger is an web app server that auto-manages web apps. It integrates with NGINX, Apache, or Docker. It handles HTTP requests and manages processes and resources. It enables administration, monitoring, and problem diagnosis. Passenger can run in standalone mode, or integrate with NGINX/Apache as a module. Passenger's log file can be found in `log/passenger.XXXXX.log` What it does internally is manage a pool of processes that are running the application. It effectively load balances and manages the life-cycles of these processes. ## Commands * `passenger start` will start the standalone server for dev purposes. * `passenger stop` will stop the server if running in `nohup` mode. ## Configuration `passengerfile.json` customizes port, logs, and which environment we're working in. ## Restarting & Updating `bundle exec passenger-config restart-app` will force a restart of the app (using a terminal interface). You can also specify the app instead. Updating can be managed by [[Capistrano]] but manually done in a rails app by: ```bash bundle config set --local deployment 'true' bundle config set --local without 'development test' bundle install bundle exec rake assets:precompile db:migrate RAILS_ENV=production passenger-config restart-app $(pwd) ``` ## Rails Integration For [[Ruby On Rails]], if `passenger` is in the Gemfile, `rails server` will launch Passenger directly. Rails logs will be printed to the terminal through Passenger. ## NGINX setup Follow the guide [here](https://www.phusionpassenger.com/docs/tutorials/deploy_to_production/deploying_your_app/oss/aws/ruby/nginx/)