Introduction to configuring Passenger + Apache
Passenger in its Apache integration mode is to be configured via the Apache configuration file. There is no configuration file that is specific to Passenger only.
Configuring Passenger for Apache works as follows:
- During the Passenger installation process, Apache is setup to load the Passenger Apache module.
- The Passenger Apache module registers Passenger-specific configuration options inside Apache.
- You, the administrator, configure Passenger by adding Passenger-specific configuration options to the Apache configuration file.
- Restart or reload Apache to apply any configuration changes.
Here is an example of an Apache configuration file which also configures Passenger:
PassengerRuby /usr/bin/ruby2.0 <VirtualHost *:80> ServerName yourserver.com DocumentRoot /var/www/myapp/code/public PassengerStickySessions on <Directory /var/www/myapp/code/public> Allow from all Options -MultiViews Require all granted </Directory> </VirtualHost>
For Passenger to work, only a few configuration options need to be setup in Apache. If you have already gone through the installation process, then these configuration options are already set.
LoadModule passenger_module ...option must exist in the Apache configuration. This option tells Apache to load the Passenger module from the given filename. If this option does not exist, then Passenger is not loaded into Apache at all, and Apache will complain about syntax errors whenever it encounters Passenger configuration options.
- The PassengerRoot option must exist in the Apache configuration. This option tells Passenger where to find its own resource files. Without this option, Passenger is still loaded, but will not be able to operate.
- The PassengerDefaultRuby option does not have to exist, but it is strongly recommended that you set it.
Start configuring Passenger
Passenger provides a wide range of features and customization options. Some of them are for improving or tweaking the application's performance characteristics, some of them influence application or connection handling behavior, etc. Please visit the configuration index page to learn what you can configure.