> gem install passenger

passenger -install-apache2-module

Welcome to the Passenger Apache 2 module installer.

This installer will guide you through the entire installation process. It
shouldn’t 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 advise you on how to
solve any problems.

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

Checking for required software…

* GNU C++ compiler… found at /usr/bin/g++
* Ruby development headers… found
* OpenSSL support for Ruby… found
* RubyGems… found
* Rake… found at /usr/local/bin/rake
* Apache 2… found at /usr/local/sbin/httpd
* Apache 2 development headers… found at /usr/local/sbin/apxs
* Apache Portable Runtime (APR) development headers… found
* fastthread… found

Compiling and installing Apache 2 module…
cd /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1
rake clean apache2
(in /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1)
### In ext/apache2:
rm -rf Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o mod_passenger.so

### In ext/passenger:
make clean
rm -f Makefile

### In ext/boost/src:
rm -f libboost_thread.a *.o

### In test:
rm -f Apache2ModuleTests *.o

### In benchmark:
rm -f DummyRequestHandler

### In ext/boost/src:
g++ -O2 -fPIC -I../.. -D_REENTRANT -DNDEBUG -c *.cpp
ar cru libboost_thread.a *.o
ranlib libboost_thread.a

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -g -I/usr/local/include/apr-1 -fno-strict-aliasing -pipe -I/usr/include -I/usr/local/include/apache22 -I.. -c mod_passenger.c

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -g -I/usr/local/include/apr-1 -fno-strict-aliasing -pipe -I/usr/include -I/usr/local/include/apache22 -I.. -c Utils.cpp

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -g -I/usr/local/include/apr-1 -fno-strict-aliasing -pipe -I/usr/include -I/usr/local/include/apache22 -I.. -c Logging.cpp
### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -g -I/usr/local/include/apr-1 -fno-strict-aliasing -pipe -I/usr/include -I/usr/local/include/apache22 -I.. -c Configuration.cpp

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -g -I/usr/local/include/apr-1 -fno-strict-aliasing -pipe -I/usr/include -I/usr/local/include/apache22 -I.. -c Hooks.cpp
In file included from StandardApplicationPool.h:46,
from ApplicationPoolClientServer.h:32,
from Hooks.cpp:39:
SpawnManager.h: In member function ‘void Passenger::SpawnManager::restartServer()’:
SpawnManager.h:209: warning: missing sentinel in function call

### In ext/apache2:
g++ -shared Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so -lstdc++ -lpthread ../boost/src/libboost_thread.a -L/usr/local/lib -laprutil-1 -ldb-4.2 -lexpat -liconv -lapr-1 -lcrypt -lpthread

### In ext/passenger:
ruby extconf.rb
creating Makefile

### In ext/passenger:
cc -I. -I/usr/local/lib/ruby/1.8/amd64-freebsd7 -I/usr/local/lib/ruby/1.8/amd64-freebsd7 -I. -fPIC -O2 -fno-strict-aliasing -pipe -fPIC -c native_support.c
cc -shared -o native_support.so native_support.o -L’.’ -L’/usr/local/lib’ -Wl,-R’/usr/local/lib’ -L. -rdynamic -Wl,-soname,native_support.so -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby18 -lcrypt -lm -rpath=/usr/lib:/usr/local/lib -pthread -lc

The Apache 2 module was successfully installed.

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

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/local/bin/ruby18

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific

Press ENTER to continue.

Deploying a Ruby on Rails application: an example

Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host
to your Apache configuration file, and set its DocumentRoot to
/somewhere/public, like this:

ServerName www.yourhost.com
DocumentRoot /somewhere/public

And that’s it! You may also want to check the Users Guide for security and
optimization tips and other useful information:

/usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.1/doc/Users guide.html

Enjoy Passenger, a product of Phusion (www.phusion.nl) :-)