ABET Project for EAS Comm Office
We were approached by the E&AS Communications Office to provide them with a platform for them to complete their ABET project (Accreditation Board for Engineering and Technology).
Specifically, they wanted a web platform that:
- is stable.
- is secure.
- has Ruby on Rails 3.
Getting Ruby on Rails with Apache working is relatively easy. However, this won't get you publicly accessible pages. For that, Passenger needs to be installed. This is where the real fun
Using openSUSE Studio, I've created install images with most
of the software needed:
Studio installs any dependent packages as necessary.
In the case more detailed info is needed, you should be able to find it here at the modrails site
When the system is booted the first time, you'll need to build
the actual passenger module for Apache to use:
This is a script that came with the passenger Ruby gem to check for needed executables that compile and install the passenger Apache module. (This is a required step unless you'd like to install Passenger by hand, which will be much more
When done, you should see:
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.0/ext/apache2/mod_passenger.so
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 Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!
AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off
And that's it!
, insert the block of text above starting with
Next, create the developer's desired namespace for deployment under DocumentRoot
). For this project, it is:
Then, in the VirtualHost
directive they are exposed as:
On the production system, replace "staging" with "production".
If the developer is using the "Capistrano" Ruby gem, as in the case of this project, you'll need to create an SSH key for use with it, as well as give that user write access to the DocumentRoot
mentioned above. ASSIGN THIS SSH KEY A PASSPHRASE!! Password/Passphrase-less SSH keys are evil evil evil.
NOTE: You may also want to
directory and files to prevent the user from overwriting them to create passphrase-less SSH keys.
Of course, the SSH key should be the same on both machines, development and production.