public
Description: Mongrel on git
Homepage: http://mongrel.rubyforge.org/
Clone URL: git://github.com/mongrel/mongrel.git
name age message
file CHANGELOG Sat Dec 22 18:48:46 -0800 2007 changelog git-svn-id: svn://rubyforge.org/var... [evanweaver]
file COPYING Fri Jun 30 13:42:12 -0700 2006 Ruby license applied to all files git-svn-id: ... [zedshaw]
file LICENSE Fri Oct 26 03:01:54 -0700 2007 licensing git-svn-id: svn://rubyforge.org/var... [evanweaver]
file Manifest Sun Dec 16 12:50:51 -0800 2007 One step in the right direction. git-svn-id: ... [wayneeseguin]
file README Sat Oct 27 01:58:39 -0700 2007 readme git-svn-id: svn://rubyforge.org/var/sv... [evanweaver]
file Rakefile Sun Mar 30 11:11:47 -0700 2008 Remove deprecated WIN32 and use Gem::Platform::... [luislavena]
file TODO Sat Dec 29 01:07:32 -0800 2007 update TODO with 1.9 tasks git-svn-id: svn://... [evanweaver]
directory bin/ Mon Apr 14 23:02:03 -0700 2008 Make mongrel_rails drop the PID file *before* l... [ezmobius]
directory examples/ Sun Dec 16 13:42:53 -0800 2007 New Mongrel.log is verified working for Mongrel... [wayneeseguin]
directory ext/ Thu Mar 27 14:46:28 -0700 2008 http11_parser: accept '"' (double-quote), '<', ... [normalperson]
directory lib/ Sat Mar 01 18:34:53 -0800 2008 mongrel: avoid needless syscall when num_proces... [normalperson]
file mongrel-public_cert.pem Sat Sep 22 20:09:56 -0700 2007 signed mongrel gem git-svn-id: svn://rubyforg... [evanweaver]
directory projects/ Wed Jan 02 14:04:11 -0800 2008 mongrel_service will no longer change it's regi... [luislavena]
file setup.rb Mon Apr 10 11:56:16 -0700 2006 Update setup.rb to silence errors on shebang re... [why]
directory test/ Sun Mar 30 22:25:39 -0700 2008 Remove fixed port numbers used in tests, make t... [luislavena]
directory tools/ Sat Oct 20 19:54:53 -0700 2007 minor test cleanups git-svn-id: svn://rubyfor... [evanweaver]
README
= Mongrel:  Simple Fast Mostly Ruby Web Server

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.