Technology Insights

503 Service Unavailable Error After Switching Litespeed Rails Site From Production Mode To Staging Mode

Earlier I switched one of the Litespeed web server virtual hosts from production mode to staging mode and after gracefully restarting rails was receiving a 503 Service Unavailable error. Initially I thought that maybe Litespeed had to be restarted completely instead of just a graceful restart but that produced the same results. Below I describe the errors including errors in the Litespeed logs as well as how to resolve the issue which ended up being a silly mistake on my part.

Technology Insights

Create Ruby Migration To Add An Index To A PostgreSQL Table

The other day I did some optimization work on a PostgreSQL database and at the end needed to create migrations so the changes I was going to make could be deployed on multiple servers. It was my first shot at migrations so I wanted to note for myself and anyone else that may find it useful how to create Ruby migrations for dropping and adding Indexes on PostgreSQL tables. Below you will find the basic concept for creating a migration that adds a Postgres table index and information on removing a table index which is just the reverse of adding.

Technology Insights

Start a Ruby On Rails Project In Development Mode With Apache And Mongrel

A friend of mine was over tonight and we were troubleshooting a issue with SVN authentication via the Redmine project management software. Redmine is built with Ruby and on this server is running via Apache and Mongrel. I needed to set the project to run in development mode but wasn’t very familiar with the Mongrel setup. After some research I found it was easy to change the environment from production to development using the Mongrel Cluster .yml file for that project. When using Mongrel each site appears to get its own .yml file so you can modify whatever settings you want to on a per site basis. Below I describe what needs to be changed, default locations, and any other actions that need to be taken to restart the Ruby on Rails project in development mode.

Technology Insights

How to Start Ruby on Rails in Development Mode with LiteSpeed Web Server

Starting ruby on rails in development mode with Litespeed is easy. You need to make sure that your database.yml is configured to handle development mode as well. Follow the steps below to start Litespeed running Ruby on Rails in development mode.

Please note both cofiguration settings listed in step one which include setting this to be the default for future virtual hosts and configuring current virtual hosts to restart in development mode.