fix tests to use 'CONTENT_TYPE' instead 'HTTP_CONTENT_TYPE'
[ebb.git] / README
blob81a9f6905340cd80f327695f04ba189cc0e43748
1 # A Web Server Called *Ebb*
3 Ebb aims to be a small and fast web server specifically for hosting 
4 dynamic web applications. It is not meant to be a full featured web server
5 like Lighttpd, Apache, or Nginx. Rather it should be used in multiplicity
6 behind a load balancer and a front-end server. It is not meant to serve static files in production.
8 At one level Ebb is a minimalist C library that ties together the 
9 [Mongrel state machine](http://mongrel.rubyforge.org/browser/tags/rel_1-0-1/ext/http11/http11_parser.rl) 
10 and [libev](http://software.schmorp.de/pkg/libev.html) event loop. One can use
11 this library to drive a web application written in C. (Perhaps for embedded 
12 devices?) However, most people will be interested in the binding of this
13 library to the Ruby programming language. The binding provides a
14 [Rack](http://rack.rubyforge.org/) server interface that allows it to host
15 Rails, Merb, or other frameworks.
17 A Python-WSGI binding is under development.
19 ## Install
21 The Ruby binding is available as a Ruby Gem. It can be install by executing
23     gem install ebb
25 Ebb depends on having glib2 headers and libraries installed. For example, in
26 Macintosh if one is using Darwin ports then the following should do the trick
27   
28     port install glib2
29   
30 Downloads are available at
31 the [RubyForge project page](http://rubyforge.org/frs/?group_id=5640).
33 ## Running
35 Using the executable `ebb_rails` one can start Ebb with a Rails project. Use
36 `ebb_rails -h` to see all of the options but to start one can try
38     cd my_rails_project/
39     ebb_rails start
41 When using `ebb_rails` from monit, the monitrc entry might look like this:
43     check process myApp4000
44       with pidfile /home/webuser/myApp/current/tmp/ebb.4000.pid
45       start program = "/usr/bin/ruby /usr/bin/ebb_rails start -d -e production -p 4000 -P /home/webuser/myApp/current/tmp/ebb.4000.pid -c /home/webuser/myApp/current" as uid webuser and gid webuser
46       stop program = "/usr/bin/ruby /usr/bin/ebb_rails stop -P /home/webuser/myApp/current/tmp/ebb.4000.pid" as uid webuser and gid webuser
47       if totalmem > 120.0 MB for 2 cycles then restart
48       if loadavg(5min) greater than 10 for 8 cycles then restart
49       group myApp
51 To use Ebb with a different framework you will have to do a small amount of
52 hacking at the moment! :)
54 ## Speed
56 Because Ebb-Ruby handles most of the processing in C, it is able to do work
57 often times more efficiently than other Ruby language web servers.
59 ![Benchmark](http://s3.amazonaws.com/four.livejournal/20080311/ebb.png)
61 Ebb-Ruby can handle threaded processing better than the other 'evented' 
62 servers. This won't be of any benefit to Rails applications because Rails
63 places a lock around each request that wouldn't allow concurrent processing
64 anyway. In Merb, for example, Ebb's thread handling will allow Ebb instances
65 to handle larger loads. [More](http://four.livejournal.com/848525.html)
67 ## Contributions
69 Contributions (patches, criticism, advice) are very welcome! 
70 Please send all to to 
71 [the mailing list](http://groups.google.com/group/ebbebb).
73 The source code
74 is hosted [github](http://github.com/ry/ebb/tree/master). It can be retrieved 
75 by executing
77     git clone git://github.com/ry/ebb.git
79 Here are some features that I would like to add:
80 * HTTP 1.1 Expect/Continue (RFC 2616, sections 8.2.3 and 10.1.1)
81 * A parser for multipart/form-data
82 * Optimize and clean up upload handling
83 * Option to listen on unix sockets instead of TCP
84 * Python binding
86 ## (The MIT) License
88 Copyright © 2008 [Ry Dahl](http://tinyclouds.org) (ry at tiny clouds dot org)
90 <div id="license">
91 Permission is hereby granted, free of charge, to any person obtaining
92 a copy of this software and associated documentation files (the
93 "Software"), to deal in the Software without restriction, including
94 without limitation the rights to use, copy, modify, merge, publish,
95 distribute, sublicense, and/or sell copies of the Software, and to
96 permit persons to whom the Software is furnished to do so, subject to
97 the following conditions:
99 The above copyright notice and this permission notice shall be
100 included in all copies or substantial portions of the Software.
102 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
103 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
104 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
105 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
106 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
107 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
108 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
109 </div>