The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
The Camping Server

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
The Camping Server Posted: Jul 12, 2006 3:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: The Camping Server
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Lately, I’ve been writing little Camping apps that I can just drop in a directory and they get automatically mounted. I’m running a personal web server with a wiki, CampSh, and development versions of Balloon and Hoodwink.d.

Both Mongrel and FastCGI can be set up to do this. Therefore: the ease of PHP installation, but the cleanliness of mini-Rails.

This idea has been blossoming on the wiki: TheCampingServer. It’s just a set of rules:

  • Load all Camping apps in a directory.
  • Load new apps that appear in that directory.
  • Mount those apps according to their filename. (e.g. blog.rb is mounted at /blog.)
  • Run each app’s `create` method upon startup.
  • Reload the app if its modification time changes.
  • Reload the app if it requires any files under the same directory and one of their modification times changes.
  • Support the `X-Sendfile` header.

For WEBrick or Mongrel, this setup can be accomplished by using the bin/camping script included with the gem:

 camping -s mongrel /var/www/camping/

For FastCGI, you can use a script like this:

 #!/usr/bin/env ruby
 require 'rubygems'
 require 'camping/fastcgi'
 Camping::Models::Base.establish_connection(...)
 Camping::FastCGI.serve("/var/www/camping")

I’d really like to see distributions offer a package which would allow simple setup of TheCampingServer, just as you see with PHP. If you’re interested in seeing this happen for the upcoming Camping 1.5 release, introduce yourself on the camping-list.

Read: The Camping Server

Topic: Trying Out NewsFire Previous Topic   Next Topic Topic: Simposio Científico y Tecnológico en Computación

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use