Small introduction
I plan to translate with testing all 8 sections of the original library with links to the original, they are not always accurate and relevant, that is, it will rather be not an exact translation, but a retelling.
To start:
In general, Passenger can be installed:
')
- System-wide:
1.1 Package manager of your distribution.
1.2 From the tarball. - Locally via RubyGems.
The passenger itself can be started with the 3rd keys:
passenger start
passenger stop
passenger status
But the most important is the key - help after the command (which is quite usual), for example
$ passenger start --help
Very useful. It will be clear why.
Passenger integrates with apache, nginx, can work as a lightweight stand-alone web server. If in the Rails application it is added to the Gemfile, then the rails server will launch it, not WEBricks, having previously installed it for you locally, but you can do it differently, see below. The meaning of a complete build with binary files is not very clear, can an ordinary user connect modules to apache2 or nginx?
This 5-minute tutorial will teach you how to launch ruby applications with PhusionPassenger server in development mode.
Strictly speaking described the installation option RubyGems. (Approx. Translation)- What is Passenger?
- Preparation of demo applications.
- Updating your gem bundle.
- Start the server.
bundle exec rails server - Logs.
- Stop the server.
- Findings.
What is Passenger?Passenger is an open-source web application server (
there is also an Enterprise version - approx. ). It serves HTTP requests, manages resources, allows diagnostics, monitoring, etc.
Passenger is very easy to use
further active bragging creators in the original video.This guide is not comprehensive. Instead, it allows you to start work as quickly as possible, after which
you can consider .
The translation will be more important there, more difficult, with illustrations.Preparing Demo ApplicationsAs usual, "hello world."
Rails:
$ git clone https://github.com/phusion/passenger-ruby-rails-demo.git $ cd passenger-ruby-rails-demo
Sinantra:
$ git clone https://github.com/phusion/passenger-ruby-sinatra-demo.git $ cd passenger-ruby-sinatra-demo
Updating your gem bundleRun:
From the translator: it's not entirely clear"Open your app's Gemfile and add" passenger ":"
Open and add.
$ gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler"
Gem, Gemfile's themselves already exist.
# gem 'passenger'
So guess. I tried and so and so - it works. This is a note.
Then everything is obvious
$ cd /path-to-your-app
$ bundle install
...
Installing passenger xxx
...
Your bundle is complete!
Server startupNow you can start the server:
$ bundle exec passenger start
======= Phusion Passenger Standalone web server started =======
PID file: /Users/phusion/myapp/tmp/pids/passenger.3000.pid
Log file: /Users/phusion/myapp/log/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/
You can stop Phusion Passenger Standalone by pressing Ctrl-C.
===============================================================
It is better not to run a standalone passenger on localhost and port 3000, better
$ bundle exec passenger start -p 8081 -a 192.168.1.1
Or whatever you have.
As already said
$ bundle exec rails server
Launches passsenger, which will pop up locally.
LogsLogging is rich, usually log / passenger.XXXX.log, where XXXX is the port number, under Rails messages are also output to the terminal. Here the topic is extensive, after all, the logs of the applications and web servers themselves (
this is my opinion - approx. Transl. )
Server shutdownNot hard to guess:
Ctrl-C or
$ bundle exec passenger stop
From another console.
findingsTo be honest, "take a pie from the shelf."
UPD1. In general, this entry. As the authors put it, "In 5 minutes, get acquainted with the product." Therefore, the cougar with the unicorn is not mentioned (see comments below). Then, the authors are sometimes subjective, I convey their words. It should also be borne in mind that advice has to be checked. And a drawback. Phusion Passenger not only supports Ruby, but the volume is a bit large. The second I have at my disposal are two laboratory virtual machines CentOS 7.2 and Debian 8.0, alas, I use Apache, Nginx is installed, but is used less frequently. After a brief introduction follows two sections, but I will try to remove the repetitions and collect the most valuable of the basics and practices.