Return to Tech/ruby

Install Passenger


passengerのインストール

apache経由でrailsを利用する場合の設定

$ sudo yum install libcurl-devel


$ sudo /usr/local/bin/gem install passenger
Fetching: passenger-5.0.21.gem (100%)
Building native extensions.  This could take a while...
Successfully installed passenger-5.0.21
Parsing documentation for passenger-5.0.21
unable to convert "\x88" from ASCII-8BIT to UTF-8 for src/cxx_supportlib/vendor-modified/boost/thread/future.hpp, skipping
unable to convert "\x97" from ASCII-8BIT to UTF-8 for src/cxx_supportlib/vendor-modified/boost/utility/declval.hpp, skipping
Installing ri documentation for passenger-5.0.21


以下実行します。
※スワップメモリが不足している旨、警告されますが
機能試験であるため、そのまま続行します。
$ sudo passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v5.0.21.

This installer will guide you through the entire installation process.
It shouldnt take more than 3 minutes in total.

Here's what you can expect from the installation process:

  1. The Apache 2 module will be installed for you.
  2. You'll learn how to configure Apache.
  3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advice you on how to solve any problms.

Press Enter to continue, or Ctrl-C to abort.

----
Which language are you interested in?

Use  to select.
If the menu doesn't display correctly, press '!'

  * * Ruby
    * Python
    * Node.js
    * Meteor


以下が正常であることを確認
  * Checking for Curl development headers with SSL support...
        Found: yes
        curl-config location: /usr/bin/curl-config
        Header location: /usr/include/curl/curl.h
        Version: libcurl 7.19.7
        Usable: yes
        Supports SSL; yes

----
Your system does not have a lot of virtual memory

Compiling Phusion Passenger works best when you have at least 1024 MB of
virtual memory. However your system only has 768 MB of total
virtual memory (256 MB RAM, 512 MB swap).
It is recommended that you temporarily add more swap space
before proceeding. You can do it as follows:

  sudo dd if=/dev/zero of=/swap bs=1M count=1024
  sudo mkswap /swap
  sudo swapon /swap

See also http://wiki.archilinux.org/index.php/Swap for more information
about swap file on Linux.

If you cannot activate a swap file (e.g. because you're on OpenVZ, or if you
don't have root privileges) then you should install Phusion Passenger through
DES/RPM packages. For more information, please refer to our installation documentation:

  https://www.phusionpassenger.com/library/install/apache/

Press Ctrl-C to abort this installer (recommended).
Press Enter if you want to continue with installation anyway.

----
Compiling and installing Apache 2 module...
省略

下のロードモジュールの定義をhttpdの設定ファイルに記述することで
apache経由でruby(on rails)を利用可能となります。
----
Almost there!

Please edit your  Apache configuration file, and add these lines:

  LoadModule passenger_module /usr/local/lib/ruby/gem/2.0.0/gems/passenger-5.0.21/buildout/apache2/mod_passenger.so
  
    PassengerRoot /usr/local/lib/ruby/gem/2.2.0/gems/passenger-5.0.21
    PassengerDefaultRuby /usr/local/bin/ruby
  

After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!

Press Enter when you are done editing.


----
Validating installation...

  * Checking whether this Passenger install is in PATH... ?
  * Checking whether there are no other Passenger installations... ?
  * Checking whether Apache is installed... ?
  * Checking whether the Passenger module is correctly configured in Apache... ((!)

    You did not specify 'LoadModule passenger_module' in any of your Apache
    configuration files. Please paste the configuration snippet that this
    installer printed earlier, into one of your Apache configuration files,
    such as /etc/httpd/conf/httpd.conf.

Deleted 0 errors(s), 1 warnings(s).
Press Enter to continue.

----

Deploying a web application

To learn how to deploy a web app on Passenger, please follow the deployment
guide:

  https://www.phusionpassenger.com/library/deploy/apache/deploy/

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com

Phusion Passenger is a registerred trademark of Hongli Lai & Ninh Bui.

Return to Tech/ruby