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
luislavena 75907c1773 Using relative paths in certificate chain (support added in Echoe 2.6).
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@629 19e92222-5c0b-0410-8929-a290d50e31e9
2007-09-25 20:42:38 +00:00
bin refactor timeout and death_time to throttle and timeout, respectively, make throttle not be zero for sub-second timeouts, improve documentation, update long command-line flags 2007-09-24 16:26:38 +00:00
examples Additional simple feature for upload progress plugin. New redirect header and configuration option. 2006-06-18 04:57:26 +00:00
ext/http11 Getting ready for mongrel 1.0.2 - site and versions update. Did I forget to change something? 2007-09-16 19:42:00 +00:00
lib avoid warnings on 1.8.6, at least 2007-09-24 16:37:26 +00:00
projects Using relative paths in certificate chain (support added in Echoe 2.6). 2007-09-25 20:42:38 +00:00
site signed mongrel gem 2007-09-23 03:09:56 +00:00
test avoid warnings on 1.8.6, at least 2007-09-24 16:37:26 +00:00
tools signed mongrel gem 2007-09-23 03:09:56 +00:00
CHANGELOG signed mongrel gem 2007-09-23 03:09:56 +00:00
COPYING Ruby license applied to all files 2006-06-30 20:42:12 +00:00
LICENSE Switched Mongrel to Ruby license. 2006-06-30 20:13:35 +00:00
Manifest remove irrelevant files from the manifest 2007-09-24 01:24:50 +00:00
mongrel-public_cert.pem signed mongrel gem 2007-09-23 03:09:56 +00:00
Rakefile forgot that += calls = implicitly 2007-09-24 05:45:18 +00:00
README Updated README with latest information and referred to mongrel site. 2006-11-25 05:16:43 +00:00
setup.rb

= 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 a C extension to provide fast
HTTP 1.1 protocol parsing and fast URI lookup.  This combination makes the server
scream without too many portability issues.

You can view http://mongrel.rubyforge.org for more information.

== Quick Start

After you've installed (either with gem install mongrel or via source) you should
have the mongrel_rails command available in your PATH.  Then you 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 (probably won't work in win32):

 > 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 zedshaw at zedshaw.com and I'll help.  Comments about the API are welcome.