github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

fauna / mongrel

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 26
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (9)
    • abandoned
    • cleanup
    • master ✓
    • rack
    • rel_1-0-1
    • rel_1-1-5
    • spinoff
    • stable_1-1
    • trunk_from_svn
  • Switch Tags (0)
  • Branch List
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Mongrel — Read more

  Cancel

mongrel.rubyforge.com

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Version. 
Evan Weaver (author)
Sun Mar 07 16:30:42 -0800 2010
commit  05de09b0ff88376beacec78f4bf2bfbd44c97163
tree    537433a70dceae08e4dbd00aeacc83dce1ad0e27
parent  d9479cb6b8a9987314a46c859738f51b1e4ad935
mongrel /
name age
history
message
file .gitignore Mon Jan 18 20:04:51 -0800 2010 Ignore jar files. [luislavena]
file COPYING Fri Jun 30 13:42:12 -0700 2006 Ruby license applied to all files git-svn-id: ... [zedshaw]
file History.txt Sun Mar 07 16:47:18 -0800 2010 Version. [Evan Weaver]
file LICENSE Fri Oct 26 03:01:54 -0700 2007 licensing git-svn-id: svn+ssh://rubyforge.org... [evanweaver]
file Manifest.txt Mon Jan 18 20:15:24 -0800 2010 Relocate Http11 JRuby extension. - Renamed htt... [luislavena]
file README.txt Sun Jan 17 09:08:35 -0800 2010 Small tweaks to gem generation. [luislavena]
file Rakefile Sun Jan 17 08:44:49 -0800 2010 Play nice with people don't like RubyGems [luislavena]
file TODO Wed Oct 31 23:14:56 -0700 2007 oops... gems is quite necessary git-svn-id: s... [evanweaver]
directory bin/ Sun Jan 17 09:49:30 -0800 2010 Applied pid dropping patch (1003) [David Smalley]
directory examples/ Mon Jul 06 23:42:29 -0700 2009 Deprecated obsolete Windows service scripts. [luislavena]
directory ext/ Sun Mar 07 16:47:18 -0800 2010 Version. [Evan Weaver]
directory lib/ Sun Mar 07 16:47:18 -0800 2010 Version. [Evan Weaver]
file mongrel-public_cert.pem Sat Sep 22 20:09:56 -0700 2007 signed mongrel gem git-svn-id: svn+ssh://ruby... [evanweaver]
directory projects/ Fri Mar 27 02:43:46 -0700 2009 Backport Eric's changes to the http parser from... [evanweaver]
file setup.rb Mon Apr 10 11:56:16 -0700 2006 Update setup.rb to silence errors on shebang re... [why]
directory tasks/ Fri Jan 22 15:01:10 -0800 2010 Upgrade JRuby parser code to fix deprecation [nicksieger]
directory test/ Sun Jan 17 09:53:21 -0800 2010 Corrected test setup for README [luislavena]
directory tools/ Tue Feb 19 22:26:33 -0800 2008 Move tools/trickletest into test/tools. git-s... [evanweaver]
README.txt
= Mongrel:  Simple Fast Mostly Ruby Web Server

* http://mongrel.rubyforge.org/
* http://rubyforge.org/projects/mongrel
* http://github.com/luislavena/mongrel

== Description

Mongrel is a small library that provides a very fast HTTP 1.1 server for Ruby web applications.  It is not particular to 
any framework, and is intended to be just enough to get a web application running behind a more complete and robust web 
server.

What makes Mongrel so fast is the careful use of an Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. 
This makes the server scream without too many portability issues.

See http://mongrel.rubyforge.org for more information.

== License

Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under the Ruby license and the GPL2. See the 
include LICENSE file for details.

== Quick Start

The easiest way to get started with Mongrel is to install it via RubyGems and then run a Ruby on Rails application. You 
can do this easily:

 $ gem install mongrel

Now you should have the mongrel_rails command available in your PATH, so just do the following:

 $ cd myrailsapp
 $ mongrel_rails start

This will start it in the foreground so you can play with it.  It runs your application in production mode.  To get help 
do:

 $ mongrel_rails start -h 

Finally, you can then start in background mode:

 $ mongrel_rails start -d

And you can stop it whenever you like with:

 $ mongrel_rails stop

All of which should be done from your application's directory.  It writes the PID of the process you ran into 
log/mongrel.pid.

There are also many more new options for configuring the rails runner including changing to a different directory, 
adding more MIME types, and setting processor threads and timeouts.

== Install

It doesn't explicitly require Camping, but if you want to run the examples/camping/ examples then you'll need to install 
Camping 1.2 at least (and redcloth I think). These are all available from RubyGems.

The library consists of a C extension so you'll need a C compiler or at least a friend who can build it for you.

Finally, the source includes a setup.rb for those who hate RubyGems.

== Usage

The examples/simpletest.rb file has the following code as the simplest example:

 require 'mongrel'

 class SimpleHandler < Mongrel::HttpHandler
    def process(request, response)
      response.start(200) do |head,out|
        head["Content-Type"] = "text/plain"
        out.write("hello!\n")
      end
    end
 end

 h = Mongrel::HttpServer.new("0.0.0.0", "3000")
 h.register("/test", SimpleHandler.new)
 h.register("/files", Mongrel::DirHandler.new("."))
 h.run.join

If you run this and access port 3000 with a browser it will say "hello!".  If you access it with any url other than 
"/test" it will give a simple 404.  Check out the Mongrel::Error404Handler for a basic way to give a more complex 404 
message.

This also shows the DirHandler with directory listings.  This is still rough but it should work for basic hosting.  
*File extension to mime type mapping is missing though.*

== Contact

E-mail the Mongrel list at http://rubyforge.org/mailman/listinfo/mongrel-users and someone will help you. Comments about 
the API are welcome.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server