Installing CAS rubycas on Ubuntu 16.04.4 LTS

5 minutes

Let’s just say that my Homelab usage has gone through the roof in the last few months. Not only am I writing bespoke applications to solve my day-to-day needs, I am continually adding to the tools at my disposal. For instance, I recently decided to not renew my Evernote subscription, after discovering how I could make Confluence bend to my needs.

Having worked with USF’s NetID authentication system (CAS), I got it in my head to implement CAS for my own bespoke applications. It really wasn’t the most straightforward of all installs. What follows is the knowledge distilled from nearly two days of head scratching, and gotchas.

We’ll use the Ruby server named – rubycas found


  • Installed Ubuntu 16.04.4 LTS on a virtual machine
    • 2 Processors
    • 4 GB RAM
    • 40 GD SSD/HDD space
  • Ruby installed
  • Rubygems installed
  • LOT of patience.


Install Ubuntu 16.04.4 LTS

Basically the process as outlined by the Confluence document.

  • Ubuntu Admin
  • Setting a static IP
  • MySQL & PHPMyAdmin
  • Add Web Development Group

Install Ruby and Ruby Gems

adapted from

Using rbenv, the only version that actually works is 2.1.5.

We will need the mysql2 adapter

Create CAS Database in MySQL

Also create a table in the casserver database called casserver_users


Time to install rubycas-server

Install rubycas

Edit config.yml

Edit the file and save.

Now create the two log files.

Post Install

Edit Gemfile

Edit /var/www/html/rubycas-server/db/migrate/001_create_initial_structure.rb, add this to the top.

If Gemfile.lock is not there already, use the one attached to this document.

And start

Apache Passenger

This has been adapted from a from a variety of sources. The intent behind this is to have Apache run the rubycas application natively. This eliminates the need to use the start command above.

Install Passenger (free)

This has been adapted from here

Check if Passenger is working fine.

This should be the output

Now to find the Passenger path.

The thing to note is “command” on line 2. The path should be noted.

Configure vhost

Now we have to make sure Apache can execute ruby applications. Edit the vhost file.

Lo and behold if all went well, go to http://<YOUR URL>/login and you should be golden.

Proof being in the pudding, here’s mine :)


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.