Ruby on Rails: Making the Jump to LiteSpeed
As RoR becomes more mainstream, hosting a Rails application in a production environment becomes increasingly important. There are numerous tutorials explaining how to cobble together mongrel, apache, lighttpd, fastcgi, and friends, but the amount of configuration can be daunting. Why go to that much trouble when LiteSpeed "Just Works"™? For a basic "Hello World" application, performance compares very well to the cobbled together systems, and installing it takes less than five minutes. To summarize the screencast, here are the ten essential steps for implementing a name-based virtual host running on an Ubuntu server, although this will work on any OS supported by LiteSpeed:
- Grab a copy of LiteSpeed from http://www.litespeedtech.com/products/webserver/download/
- Install it. Answer N for PHP support and then go ahead and accept the defaults for the remaining questions.
- gem install ruby-lsapi, required for everything to work.
- If everything was successful, you can view the admin site on the port of your choosing.
- Under Server Admin -> Virtual Hosts, delete the Example virtual host.
- Under the Default Listener, delete the pre-configured virtual host listener.
- Under EasyRailsWithSuEXEC, add a new member virtual host.
- Give your virtual host a name (e.g., myapp).
- Specify the domain (e.g., viget.com.)
- Enter the path to the top level of your rails application (i.e., where app and config are located.)
- Save your changes.
- Instantiate the member virtual host to create an editable configuration.
- For the default listener, map the virtual host to the domain (myapp -> myapp.viget.com) and save.
- Following "Apply your changes" provides a handy button to restart the LiteSpeed service.
- Point your browser to one of the domains to verify it worked.