Close and Go BackBack to Viget

Ruby on Rails: Making the Jump to LiteSpeed

Kevin McFadden
Kevin McFadden, Former Staffer, November 27, 2006 1

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:



  1. Grab a copy of LiteSpeed from http://www.litespeedtech.com/products/webserver/download/

  2. Install it. Answer N for PHP support and then go ahead and accept the defaults for the remaining questions.

  3. gem install ruby-lsapi, required for everything to work.

  4. If everything was successful, you can view the admin site on the port of your choosing.

  5. Under Server Admin -> Virtual Hosts, delete the Example virtual host.

  6. Under the Default Listener, delete the pre-configured virtual host listener.

  7. 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.


  8. Instantiate the member virtual host to create an editable configuration.

  9. For the default listener, map the virtual host to the domain (myapp -> myapp.viget.com) and save.

  10. Following “Apply your changes” provides a handy button to restart the LiteSpeed service.

  11. Point your browser to one of the domains to verify it worked.

The instantiation part for step #7 is not necessary for one virtual host, but if you have more, step #8 requires a unique configuration for mapping purposes.

The downside is there are two versions of LiteSpeed: free as in beer and enterprise. As you know, anything with the word “enterprise” associated with it is generally expensive and LiteSpeed is no different. However, for most medium traffic sites the free version should work well, and if it is a high traffic site you can probably afford the cost or use multiple servers.

Punch it, Chewie!

References

Trackback: Ruby on Rails: Making the Jump to LiteSpeed at There was Code; Then there was AJAX! on 11/28 at 07:33 AM [...] Earlier this week I wrote about LiteSpeed. Besides potentially being expensive, it also requires having your own server or VPS. [...]----- [...] Ruby on Rails: Making the Jump to LiteSpeed (tags: web sysadmin rails litespeed) [...]----- [...] Kevin McFadden (Viget Labs) shares the ten essential steps for implementing a name-based virtual host running on an Ubuntu server.read more | digg story Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [...]-----
Inflatable Jumpers said on 08/08 at 05:00 AM

Big fan right here of LiteSpeed here. I can’t give enough raves of what it has done for me with rails.

Trackback URL: Trackbacks are disabled for this entry

A Development Community for Viget Labs and Beyond

Every team member here at Viget Labs strives to be an innovator. We members of the development team are no different - that's why we're constantly engaging in community discussions and exploring the unknown that is the next generation of open-source web applications.

Viget Is Hiring!

Viget has job openings for Ruby Developers, Interns, and Front-End Developers. Learn More »

Recent Comments

I have used several different strategies for achieving this, and have settled on the plugin seed_fu to accomplish this task. Because it uses plain ruby files you have quite a few more options for manipulating your seed data as opposed to using fixtures. I have found that this lets me create seed data that is much less brittle than fixtures can be. You can find seed_fu on...