1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
A Ruby/Rack web server built for parallelism
Find a file
evanweaver 7c9d988d4d Backport Eric's changes to the http parser from trunk (Eric Wong).
Apply fix for Ragel 6 (Eric Wong, Ry Dahl).

Two tests fail with the new parser (1 failed with the old parser). Needs investigation.

Close #12 (mongrel_rails send_signal leaves a filehandle open until gc).
Close #14 (mongrel_rails command line option --num-procs does not change the max number of procs).
Close #15 (mongrel squashes helpful exception in register method).
Close #16, XXX needs audit! (CGIWrapper "options" attr_reader has no corresponding @options variable).
Close #20 (Mongrel doesn't erase temporary files during it's operation on windows).
Close #19, XXX needs audit! (HttpResponse#reset does not properly reset HeaderOut).
Close #22 (gem_plugin should load gems from Gem.path not Gem.dir).
Close #23 (mongrel_cluster's mongrel_rails configuration option isn't fully respected).

If I had git, being offline wouldn't have resulted in one massive commit.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-2@995 19e92222-5c0b-0410-8929-a290d50e31e9
2009-03-27 02:43:46 -07:00
bin Backport Eric's changes to the http parser from trunk (Eric Wong). 2009-03-27 02:43:46 -07:00
examples Additional simple feature for upload progress plugin. New redirect header and configuration option. 2006-06-18 04:57:26 +00:00
ext Backport Eric's changes to the http parser from trunk (Eric Wong). 2009-03-27 02:43:46 -07:00
lib Backport Eric's changes to the http parser from trunk (Eric Wong). 2009-03-27 02:43:46 -07:00
projects Backport Eric's changes to the http parser from trunk (Eric Wong). 2009-03-27 02:43:46 -07:00
test Backport Eric's changes to the http parser from trunk (Eric Wong). 2009-03-27 02:43:46 -07:00
tools minor test cleanups 2007-10-21 02:54:53 +00:00
CHANGELOG Tag 1.1.5 for release. 2008-05-22 06:12:37 +00:00
COPYING Ruby license applied to all files 2006-06-30 20:42:12 +00:00
LICENSE licensing 2007-10-26 10:01:54 +00:00
Manifest manifest; jruby test removed 2007-11-01 05:03:52 +00:00
mongrel-public_cert.pem signed mongrel gem 2007-09-23 03:09:56 +00:00
Rakefile Backport Eric's changes to the http parser from trunk (Eric Wong). 2009-03-27 02:43:46 -07:00
README readme 2007-10-27 08:58:39 +00:00
setup.rb Update setup.rb to silence errors on shebang replacement. Camping handler now allows passing back of an IO object, to allow large file streaming. Simpler underscore replacement on Tepee wiki words. 2006-04-10 18:56:16 +00:00
TODO oops... gems is quite necessary 2007-11-01 06:14:56 +00:00

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