-
Notifications
You must be signed in to change notification settings - Fork 7
Installation: Apache & Passenger
Apache and Passenger work together to serve up the HydraDAM web pages. Apache is the generic web server and passenger (https://www.phusionpassenger.com/) manages the multiple processes HydraDAM (a ruby on rails app) generates.
-
The Apache server should already be installed as part of the Apache development package (one of the dependencies).
-
(CentOS only) Set Apache to start automatically on reboot by entering the command
sudo chkconfig httpd on
in the terminal window. -
(Ubuntu only) Install the passenger gem by entering the command
gem install passenger
. On CentOS you installed passenger as root when you cloned the Git repository & installed the Gems. -
Install passenger’s Apache module by entering the command
passenger-install-apache2-module
.
NOTE: if you see a "command not found" error, find the passenger Gem and include the path in your command/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/bin/passenger-install-apache2-module
. Parts of this path may be different depending on the configuration of your system. -
Follow the installer prompts - you'll need two sections of the final output for the next two steps. The final output should look similar to this.
[your_Username@ip hydradam]$ passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v4.0.37....
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.
--------------------------------------------
Which languages are you interested in?
Use to select.
If the menu doesn't display correctly, ensure that your terminal supports UTF-8.- ‣ ⬡ Ruby*
⬢ Python
⬡ Node.js
⬡ Meteor
--------------------------------------------
Checking for required software...
...
Sanity checking Apache installation...
All good!
... linking shared-object passenger_native_support.so--------------------------------------------
Almost there!Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37
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 to continue.
...
And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:/usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/doc/Users guide Apache.html
http://www.modrails.com/documentation/Users%20guide%20Apache.html - ‣ ⬡ Ruby*
-
When the installer is done, create the passenger configuration file using the steps below.
-
Begin the command to create the passenger.conf file by entering
sudo tee -a /etc/httpd/conf.d/passenger.conf <<EOF
in the terminal window. The computer is waiting for more input and will respond with the prompt>
. -
Copy the text that begins "LoadModule" from the passenger output and paste it in at the prompt. As an example, the text below was copied from the output example in Step 5.
LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37 PassengerDefaultRuby /usr/local/bin/ruby </IfModule>
- Add a line to configure the PassengerTempDir by typing
PassengerTempDir /opt/passenger_temp
, as shown below.
LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.37 PassengerDefaultRuby /usr/local/bin/ruby PassengerTempDir /opt/passenger_temp </IfModule>
- Add
EOF
on its own line and hit enter to create the file. For reference, see the sample passenger.conf file
-
-
Create the project configuration file using the steps below.
-
Begin the command to create the file by entering
sudo tee -a /etc/httpd/conf.d/$HYDRA_NAME.conf <<EOF
in the terminal window. The computer is waiting for more input and will respond with the prompt>
-
Copy these two lines to begin your configuration file: Note: You will need to change www.yourhoust.com to your server's name. For example, www.dcehydradam.com or hydradam.publictvstation.org and then hit Enter. You will see the
>
prompt again.<VirtualHost *:80> ServerName www.yourhost.com
-
Add the rest of the configuration information:
# !!! Be sure to point DocumentRoot to 'public'! DocumentRoot /opt/hydradam/public XSendFile on XSendFilePath /opt/xsendfile <Directory /opt/hydradam/public >
-
-
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
```
and hit Enter. You will see the >
prompt again.
-
Type
EOF
on its own line and hit enter to create the file. For reference, see the sample $HYDRA_NAME.conf file. -
Install mod_xsendfile for apache by entering the following commands:
cd /opt/install git clone https://github.com/nmaier/mod_xsendfile.git cd mod_xsendfile sudo apxs -cia mod_xsendfile.c
For more information, see the xsendfile docs.
-
Create the PassengerTempDir and XSendFile directories referred to in your passenger config by entering the command
mkdir /opt/passenger_temp /opt/xsendfile
.
The complete functionality of this step cannot be tested until you have also completed steps 15, 16, and 17. If you run into issues, please consult the Troubleshooting Guide.
Proceed to Create the Production SQL Database or return to the Overview page.