Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Phusion Passenger  (Read 3482 times)

0 Members and 1 Guest are viewing this topic.

minos

  • Guest
Phusion Passenger
« on: November 30, 2013, 02:13:45 pm »
Phusion Passenger (informally also known as mod_rails and mod_rack) is a free module for the Apache HTTP Server and nginx for deployment of Ruby applications, including those built using the Ruby on Rails framework. It is available as a Gem package and is supported on Unix-like operating systems.

In order to run the ruby applications only we can use the Phusion Passenger Standalone.

Phusion Passenger Standalone is a web server that allows one to run Ruby web applications. Here are some of the highlights:

Unlike Phusion Passenger for Apache and Phusion Passenger for Nginx, Phusion Passenger Standalone does not require an external web server, it is its own and therefore extremely easy to get started.

It is powered by an Nginx core. This allows it to serve static files at blazing speeds, makes it secure enough to be directly attached to port 80, and allows it to handle slow clients. You don’t need to have Nginx already installed.

Automatically spawns and shuts down application processes. One Phusion Passenger Standalone instance can therefore handle multiple simultaneous connections and handles resource management for you. Crashing application processes are automatically restarted.

Can listen on a Unix socket, for use in reverse proxy setups.


Now in order to install the Phusion Passenger Standalone in the server please run the below comamnd

# gem install passenger

Now in order to start the application run the below command.

Go to your application’s root directory, and run: ( The directory in which applications uploaded ).

# passenger start

First time it will install the Nginx in the server from their repositories.

Downloading Nginx...                                                                                                                                                                           
# wget -O /tmp/passenger.k5fpdn/nginx-1.4.1.tar.gz http://nginx.org/download/nginx-1.4.1.tar.gz                                                                                                 
--2013-06-02 06:30:49--  http://nginx.org/download/nginx-1.4.1.tar.gz                                                                                                                           
Resolving nginx.org... 206.251.255.63                                                                                                                                                           
Connecting to nginx.org|206.251.255.63|:80... connected.                                                                                                                                       
HTTP request sent, awaiting response... 200 OK                                                                                                                                                 
Length: 767107 (749K) [application/octet-stream]                                                                                                                                               
Saving to: “/tmp/passenger.k5fpdn/nginx-1.4.1.tar.gz”                                                                                                                                           
                                                                                                                                                                                               
100%[======================================================================================================================================================>] 767,107      492K/s   in 1.5s     
                                                                                                                                                                                               
2013-06-02 06:30:51 (492 KB/s) - “/tmp/passenger.k5fpdn/nginx-1.4.1.tar.gz” saved [767107/767107]                                                                                               
                                                                                                                                                                                               
Installing Phusion Passenger Standalone...                                                                                                                                                     
[*********************************************] Copying files...                                                                                                                               
All done!                                                                                                                                                                                       
                                                                                                                                                                                               
*** Phusion Passenger: no passenger_native_support.so found for the current Ruby interpreter. Compiling one...                                                                                 
# mkdir -p /usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/libout/ruby/ruby-1.9.3-x86_64-linux
# cd /usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/libout/ruby/ruby-1.9.3-x86_64-linux
# /usr/local/rvm/wrappers/ruby-1.9.3-p429/ruby '/usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/ext/ruby/extconf.rb'
checking for alloca.h... yes
checking for ruby/io.h... yes
creating Makefile
# make
compiling /usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/ext/ruby/passenger_native_support.c
linking shared-object passenger_native_support.so
=============== Phusion Passenger Standalone web server started ===============
PID file: /root/passenger.3000.pid
Log file: /root/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
===============================================================================
2013/06/02 06:32:37 [error] 30374#0: *4 "/root/public/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: _, request: "HEAD / HTTP/1.1", host: "0.0.0.0"

This will start Phusion Passenger on port 3000. If you want to run it on a different port, use the -p option

# sudo passenger start -p 80

From the above document root you can see the default document root is “ /root/public/ “