thin 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of thin might be problematic. Click here for more details.
- data/COPYING +18 -0
- data/README +32 -45
- data/Rakefile +66 -23
- data/bin/thin +76 -45
- data/doc/benchmarks.txt +64 -249
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +37 -100
- data/doc/rdoc/rdoc-style.css +5 -0
- data/example/config.ru +9 -0
- data/ext/thin_parser/common.rl +54 -0
- data/ext/thin_parser/ext_help.h +14 -0
- data/ext/thin_parser/extconf.rb +6 -0
- data/ext/thin_parser/parser.c +1199 -0
- data/ext/thin_parser/parser.h +49 -0
- data/ext/thin_parser/parser.rl +143 -0
- data/ext/thin_parser/thin.c +424 -0
- data/lib/rack/adapter/rails.rb +136 -0
- data/lib/rack/handler/thin.rb +13 -0
- data/lib/thin.rb +28 -12
- data/lib/thin/connection.rb +47 -0
- data/lib/thin/daemonizing.rb +5 -1
- data/lib/thin/headers.rb +3 -2
- data/lib/thin/logging.rb +6 -13
- data/lib/thin/request.rb +53 -133
- data/lib/thin/response.rb +21 -25
- data/lib/thin/server.rb +30 -94
- data/lib/thin/version.rb +2 -2
- data/lib/thin_parser.bundle +0 -0
- data/spec/daemonizing_spec.rb +94 -0
- data/spec/headers_spec.rb +35 -0
- data/spec/request_spec.rb +258 -0
- data/spec/response_spec.rb +40 -0
- data/spec/server_spec.rb +75 -0
- data/spec/spec_helper.rb +126 -0
- metadata +79 -99
- data/bin/thin_cluster +0 -53
- data/doc/rdoc/classes/Kernel.html +0 -182
- data/doc/rdoc/classes/Process.html +0 -175
- data/doc/rdoc/classes/Thin.html +0 -184
- data/doc/rdoc/classes/Thin/CGIWrapper.html +0 -438
- data/doc/rdoc/classes/Thin/Cluster.html +0 -392
- data/doc/rdoc/classes/Thin/Command.html +0 -221
- data/doc/rdoc/classes/Thin/CommandError.html +0 -154
- data/doc/rdoc/classes/Thin/Commands.html +0 -145
- data/doc/rdoc/classes/Thin/Daemonizable.html +0 -250
- data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +0 -203
- data/doc/rdoc/classes/Thin/DirHandler.html +0 -250
- data/doc/rdoc/classes/Thin/Handler.html +0 -195
- data/doc/rdoc/classes/Thin/Headers.html +0 -244
- data/doc/rdoc/classes/Thin/InvalidRequest.html +0 -150
- data/doc/rdoc/classes/Thin/Logging.html +0 -214
- data/doc/rdoc/classes/Thin/RailsHandler.html +0 -234
- data/doc/rdoc/classes/Thin/RailsServer.html +0 -175
- data/doc/rdoc/classes/Thin/Request.html +0 -379
- data/doc/rdoc/classes/Thin/Response.html +0 -311
- data/doc/rdoc/classes/Thin/Server.html +0 -381
- data/doc/rdoc/files/bin/thin.html +0 -188
- data/doc/rdoc/files/bin/thin_cluster.html +0 -175
- data/doc/rdoc/files/lib/thin/cgi_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/cluster_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/command_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/consts_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/daemonizing_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/handler_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/headers_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/logging_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/mime_types_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/rails_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/recipes_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/request_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/response_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/server_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/statuses_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/version_rb.html +0 -171
- data/lib/thin/cgi.rb +0 -159
- data/lib/thin/cluster.rb +0 -147
- data/lib/thin/command.rb +0 -49
- data/lib/thin/commands/cluster/base.rb +0 -24
- data/lib/thin/commands/cluster/config.rb +0 -36
- data/lib/thin/commands/cluster/restart.rb +0 -35
- data/lib/thin/commands/cluster/start.rb +0 -40
- data/lib/thin/commands/cluster/stop.rb +0 -28
- data/lib/thin/commands/server/base.rb +0 -7
- data/lib/thin/commands/server/start.rb +0 -33
- data/lib/thin/commands/server/stop.rb +0 -29
- data/lib/thin/consts.rb +0 -37
- data/lib/thin/handler.rb +0 -57
- data/lib/thin/mime_types.rb +0 -619
- data/lib/thin/rails.rb +0 -44
- data/lib/thin/recipes.rb +0 -36
- data/lib/transat/parser.rb +0 -247
@@ -1,188 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » File: thin
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">home</a></li>
|
53
|
-
<li><a href="/thin/doc/">doc</a></li>
|
54
|
-
<li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
|
55
|
-
<li><a href="/thin/trac.fcgi/browser">code</a></li>
|
56
|
-
<li><a href="/thin/trac.fcgi/report">tickets</a></li>
|
57
|
-
<li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
|
58
|
-
</ul>
|
59
|
-
<div id="sidebar">
|
60
|
-
<h2>Files</h2>
|
61
|
-
<ul class="list">
|
62
|
-
<li><a href="../../files/README.html" value="File: README">README</a></li>
|
63
|
-
<li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.rb</a></li>
|
64
|
-
<li><a href="../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../files/lib/thin/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
|
66
|
-
<li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
|
67
|
-
<li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
68
|
-
<li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
|
69
|
-
<li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
70
|
-
<li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
71
|
-
<li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
|
72
|
-
<li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
|
73
|
-
<li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
|
74
|
-
<li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
75
|
-
<li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
76
|
-
<li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
77
|
-
<li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
78
|
-
<li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
79
|
-
<li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
80
|
-
<li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
|
81
|
-
</ul>
|
82
|
-
|
83
|
-
<h2>Classes</h2>
|
84
|
-
<ul class="list">
|
85
|
-
<li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
86
|
-
<li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</a></li>
|
87
|
-
<li><a href="../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../classes/Thin/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
|
92
|
-
<li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
93
|
-
<li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
|
94
|
-
<li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
|
95
|
-
<li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
96
|
-
<li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
97
|
-
<li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
98
|
-
<li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
|
99
|
-
<li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
100
|
-
<li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
|
101
|
-
<li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
102
|
-
<li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
|
103
|
-
<li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
|
104
|
-
<li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
|
105
|
-
<li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
|
106
|
-
</ul>
|
107
|
-
</div>
|
108
|
-
<div id="container">
|
109
|
-
<div id="header">
|
110
|
-
<a href="/thin/" title="Home">
|
111
|
-
<img id="logo" src="../../logo.gif" />
|
112
|
-
</a>
|
113
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
<div id="content">
|
117
|
-
<h2>File: thin</h2>
|
118
|
-
|
119
|
-
<div id="bin/thin" class="page_shade">
|
120
|
-
<div class="page">
|
121
|
-
<div class="header">
|
122
|
-
<div class="path">bin/thin / Sun Dec 02 23:31:40 -0500 2007</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<h2>thin</h2>
|
126
|
-
<p>
|
127
|
-
Script to launch a <a href="../../classes/Thin.html">Thin</a> server for a
|
128
|
-
Rails application.
|
129
|
-
</p>
|
130
|
-
<p>
|
131
|
-
To start a server for your current Rails app:
|
132
|
-
</p>
|
133
|
-
<pre>
|
134
|
-
thin start
|
135
|
-
</pre>
|
136
|
-
<p>
|
137
|
-
You can specify the port using the -p option:
|
138
|
-
</p>
|
139
|
-
<pre>
|
140
|
-
thin start -p3001
|
141
|
-
</pre>
|
142
|
-
<p>
|
143
|
-
By default the server will bind to 0.0.0.0:3000
|
144
|
-
</p>
|
145
|
-
<p>
|
146
|
-
You can specify which Rails environment should be loaded with the -e
|
147
|
-
option:
|
148
|
-
</p>
|
149
|
-
<pre>
|
150
|
-
thin start -e production
|
151
|
-
</pre>
|
152
|
-
<p>
|
153
|
-
You can also start the server in daemon mode:
|
154
|
-
</p>
|
155
|
-
<pre>
|
156
|
-
thin start -d
|
157
|
-
</pre>
|
158
|
-
<p>
|
159
|
-
And later stop it
|
160
|
-
</p>
|
161
|
-
<pre>
|
162
|
-
thin stop
|
163
|
-
</pre>
|
164
|
-
<p>
|
165
|
-
Run <tt>thin help</tt> to get help.
|
166
|
-
</p>
|
167
|
-
|
168
|
-
|
169
|
-
<strong>Requires:</strong>
|
170
|
-
thin/command
|
171
|
-
</ul>
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
|
180
|
-
|
181
|
-
</div>
|
182
|
-
</div>
|
183
|
-
<div id="footer">
|
184
|
-
<hr />
|
185
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
186
|
-
</div>
|
187
|
-
</body>
|
188
|
-
</html>
|
@@ -1,175 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » File: thin_cluster
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">home</a></li>
|
53
|
-
<li><a href="/thin/doc/">doc</a></li>
|
54
|
-
<li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
|
55
|
-
<li><a href="/thin/trac.fcgi/browser">code</a></li>
|
56
|
-
<li><a href="/thin/trac.fcgi/report">tickets</a></li>
|
57
|
-
<li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
|
58
|
-
</ul>
|
59
|
-
<div id="sidebar">
|
60
|
-
<h2>Files</h2>
|
61
|
-
<ul class="list">
|
62
|
-
<li><a href="../../files/README.html" value="File: README">README</a></li>
|
63
|
-
<li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.rb</a></li>
|
64
|
-
<li><a href="../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../files/lib/thin/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
|
66
|
-
<li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
|
67
|
-
<li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
68
|
-
<li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
|
69
|
-
<li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
70
|
-
<li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
71
|
-
<li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
|
72
|
-
<li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
|
73
|
-
<li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
|
74
|
-
<li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
75
|
-
<li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
76
|
-
<li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
77
|
-
<li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
78
|
-
<li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
79
|
-
<li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
80
|
-
<li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
|
81
|
-
</ul>
|
82
|
-
|
83
|
-
<h2>Classes</h2>
|
84
|
-
<ul class="list">
|
85
|
-
<li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
86
|
-
<li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</a></li>
|
87
|
-
<li><a href="../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../classes/Thin/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
|
92
|
-
<li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
93
|
-
<li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
|
94
|
-
<li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
|
95
|
-
<li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
96
|
-
<li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
97
|
-
<li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
98
|
-
<li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
|
99
|
-
<li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
100
|
-
<li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
|
101
|
-
<li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
102
|
-
<li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
|
103
|
-
<li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
|
104
|
-
<li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
|
105
|
-
<li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
|
106
|
-
</ul>
|
107
|
-
</div>
|
108
|
-
<div id="container">
|
109
|
-
<div id="header">
|
110
|
-
<a href="/thin/" title="Home">
|
111
|
-
<img id="logo" src="../../logo.gif" />
|
112
|
-
</a>
|
113
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
<div id="content">
|
117
|
-
<h2>File: thin_cluster</h2>
|
118
|
-
|
119
|
-
<div id="bin/thin_cluster" class="page_shade">
|
120
|
-
<div class="page">
|
121
|
-
<div class="header">
|
122
|
-
<div class="path">bin/thin_cluster / Sun Dec 02 23:31:53 -0500 2007</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<h2>this_cluster</h2>
|
126
|
-
<p>
|
127
|
-
Script used to launch multiple server instances. It takes most of the same
|
128
|
-
argument as the <tt>thin</tt> script plus the -n option to specify the
|
129
|
-
number of servers to run.
|
130
|
-
</p>
|
131
|
-
<p>
|
132
|
-
Also, you can store your options into a config file, create it like this:
|
133
|
-
</p>
|
134
|
-
<pre>
|
135
|
-
thin_cluster config -C /var/www/my_app/current config
|
136
|
-
</pre>
|
137
|
-
<p>
|
138
|
-
Then a config file will be created in
|
139
|
-
/var/www/my_app/current/config/thin.yml with the default options. You can
|
140
|
-
launch your 3 servers with:
|
141
|
-
</p>
|
142
|
-
<pre>
|
143
|
-
thin_cluster start
|
144
|
-
</pre>
|
145
|
-
<p>
|
146
|
-
And stop them with:
|
147
|
-
</p>
|
148
|
-
<pre>
|
149
|
-
thin_cluster stop
|
150
|
-
</pre>
|
151
|
-
<p>
|
152
|
-
Run <tt>thin_cluster help</tt> to get help.
|
153
|
-
</p>
|
154
|
-
|
155
|
-
|
156
|
-
<strong>Requires:</strong>
|
157
|
-
thin/command
|
158
|
-
</ul>
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
</div>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
|
168
|
-
</div>
|
169
|
-
</div>
|
170
|
-
<div id="footer">
|
171
|
-
<hr />
|
172
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
173
|
-
</div>
|
174
|
-
</body>
|
175
|
-
</html>
|
@@ -1,263 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » File: cgi.rb
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">home</a></li>
|
53
|
-
<li><a href="/thin/doc/">doc</a></li>
|
54
|
-
<li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
|
55
|
-
<li><a href="/thin/trac.fcgi/browser">code</a></li>
|
56
|
-
<li><a href="/thin/trac.fcgi/report">tickets</a></li>
|
57
|
-
<li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
|
58
|
-
</ul>
|
59
|
-
<div id="sidebar">
|
60
|
-
<h2>Files</h2>
|
61
|
-
<ul class="list">
|
62
|
-
<li><a href="../../../files/README.html" value="File: README">README</a></li>
|
63
|
-
<li><a href="../../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.rb</a></li>
|
64
|
-
<li><a href="../../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../../files/lib/thin/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
|
66
|
-
<li><a href="../../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
|
67
|
-
<li><a href="../../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
68
|
-
<li><a href="../../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
|
69
|
-
<li><a href="../../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
70
|
-
<li><a href="../../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
71
|
-
<li><a href="../../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
|
72
|
-
<li><a href="../../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
|
73
|
-
<li><a href="../../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
|
74
|
-
<li><a href="../../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
75
|
-
<li><a href="../../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
76
|
-
<li><a href="../../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
77
|
-
<li><a href="../../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
78
|
-
<li><a href="../../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
79
|
-
<li><a href="../../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
80
|
-
<li><a href="../../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
|
81
|
-
</ul>
|
82
|
-
|
83
|
-
<h2>Classes</h2>
|
84
|
-
<ul class="list">
|
85
|
-
<li><a href="../../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
86
|
-
<li><a href="../../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</a></li>
|
87
|
-
<li><a href="../../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../../classes/Thin/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
|
92
|
-
<li><a href="../../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
93
|
-
<li><a href="../../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
|
94
|
-
<li><a href="../../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
|
95
|
-
<li><a href="../../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
96
|
-
<li><a href="../../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
97
|
-
<li><a href="../../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
98
|
-
<li><a href="../../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
|
99
|
-
<li><a href="../../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
100
|
-
<li><a href="../../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
|
101
|
-
<li><a href="../../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
102
|
-
<li><a href="../../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
|
103
|
-
<li><a href="../../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
|
104
|
-
<li><a href="../../../classes/Process.html" title="Module: Process">Process</a></li>
|
105
|
-
<li><a href="../../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
|
106
|
-
</ul>
|
107
|
-
</div>
|
108
|
-
<div id="container">
|
109
|
-
<div id="header">
|
110
|
-
<a href="/thin/" title="Home">
|
111
|
-
<img id="logo" src="../../../logo.gif" />
|
112
|
-
</a>
|
113
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
<div id="content">
|
117
|
-
<h2>File: cgi.rb</h2>
|
118
|
-
|
119
|
-
<div id="lib/thin/cgi.rb" class="page_shade">
|
120
|
-
<div class="page">
|
121
|
-
<div class="header">
|
122
|
-
<div class="path">lib/thin/cgi.rb / Fri Nov 30 16:34:18 -0500 2007</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<h2><a href="../classes/Thin.html">Thin</a></h2>
|
126
|
-
<p>
|
127
|
-
Tiny, fast & funny HTTP server
|
128
|
-
</p>
|
129
|
-
<p>
|
130
|
-
<a href="../classes/Thin.html">Thin</a> is a web server written entirely in
|
131
|
-
Ruby in the simplest way possible. It does as little as possible to serve
|
132
|
-
your Rails application, which makes it one of the fastest Rails server out
|
133
|
-
there.
|
134
|
-
</p>
|
135
|
-
<h3>Installation</h3>
|
136
|
-
<p>
|
137
|
-
For the latest stable version:
|
138
|
-
</p>
|
139
|
-
<pre>
|
140
|
-
sudo gem install thin
|
141
|
-
</pre>
|
142
|
-
<p>
|
143
|
-
For the risky but so much cooler alpha version:
|
144
|
-
</p>
|
145
|
-
<pre>
|
146
|
-
sudo gem install thin --source http://code.macournoyer.com
|
147
|
-
</pre>
|
148
|
-
<p>
|
149
|
-
Or from source:
|
150
|
-
</p>
|
151
|
-
<pre>
|
152
|
-
svn co http://code.macournoyer.com/svn/thin/trunk thin
|
153
|
-
cd thin
|
154
|
-
rake install
|
155
|
-
</pre>
|
156
|
-
<h3>Usage</h3>
|
157
|
-
<p>
|
158
|
-
In your Rails app directory:
|
159
|
-
</p>
|
160
|
-
<pre>
|
161
|
-
thin start
|
162
|
-
</pre>
|
163
|
-
<p>
|
164
|
-
See <a
|
165
|
-
href="http://code.macournoyer.com/thin/doc/files/bin/thin.html">code.macournoyer.com/thin/doc/files/bin/thin.html</a>
|
166
|
-
</p>
|
167
|
-
<h3>Deployment</h3>
|
168
|
-
<p>
|
169
|
-
To deploy your Rails application using a cluster of thin servers. You can
|
170
|
-
start it with:
|
171
|
-
</p>
|
172
|
-
<pre>
|
173
|
-
thin_cluster start
|
174
|
-
</pre>
|
175
|
-
<p>
|
176
|
-
To use the Capistrano recipes, add this to your Capfile:
|
177
|
-
</p>
|
178
|
-
<pre>
|
179
|
-
require 'thin'
|
180
|
-
require 'thin/recipes'
|
181
|
-
</pre>
|
182
|
-
<p>
|
183
|
-
and create a config file using:
|
184
|
-
</p>
|
185
|
-
<pre>
|
186
|
-
thin_cluster config
|
187
|
-
</pre>
|
188
|
-
<p>
|
189
|
-
See <a
|
190
|
-
href="http://code.macournoyer.com/thin/doc/files/bin/thin_cluster.html">code.macournoyer.com/thin/doc/files/bin/thin_cluster.html</a>
|
191
|
-
</p>
|
192
|
-
<h3>Security</h3>
|
193
|
-
<p>
|
194
|
-
<a href="../classes/Thin.html">Thin</a> should never be used facing the
|
195
|
-
internet directly, it should always be hidden behind a proxy server!
|
196
|
-
</p>
|
197
|
-
<p>
|
198
|
-
<a href="../classes/Thin.html">Thin</a> is faster because it doesn‘t
|
199
|
-
do a lot of things that other Ruby web servers do (use threads, validate
|
200
|
-
the body length, be very strict about the request format, etc.) but that a
|
201
|
-
good proxy server do very well (and a lot faster then any Ruby code could
|
202
|
-
possibly do). So it is very important that you setup you proxy server
|
203
|
-
correctly in order to secure <a href="../classes/Thin.html">Thin</a> from
|
204
|
-
potential attacks.
|
205
|
-
</p>
|
206
|
-
<p>
|
207
|
-
Nginx comes with everything you need and can be used securely out of the
|
208
|
-
box with thin.
|
209
|
-
</p>
|
210
|
-
<p>
|
211
|
-
Apache mod_proxy is not secure because it doesn‘t cache the request
|
212
|
-
before sending it to the backend, which open your server to easy DoS
|
213
|
-
attacks. You need to install mod_accel (<a
|
214
|
-
href="http://sysoev.ru/en">sysoev.ru/en</a>/) to make mod_proxy behave like
|
215
|
-
Nginx on that side.
|
216
|
-
</p>
|
217
|
-
<h3>License</h3>
|
218
|
-
<p>
|
219
|
-
Ruby License, <a
|
220
|
-
href="http://www.ruby-lang.org/en/LICENSE.txt">www.ruby-lang.org/en/LICENSE.txt</a>.
|
221
|
-
</p>
|
222
|
-
<h3>Credits</h3>
|
223
|
-
<p>
|
224
|
-
Lots of the code was inspired (or stolen entirely) from Mongrel <a
|
225
|
-
href="http://mongrel.rubyforge.org">mongrel.rubyforge.org</a> by Zed Shaw.
|
226
|
-
Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw
|
227
|
-
<zedshaw at zedshaw dot com> You can redistribute it and/or modify it
|
228
|
-
under either the terms of the GPL.
|
229
|
-
</p>
|
230
|
-
<p>
|
231
|
-
transat/parser.rb was taken from Piston source code. Copyright (c) 2006
|
232
|
-
Francois Beausoleil <francois@teksol.info>
|
233
|
-
</p>
|
234
|
-
<p>
|
235
|
-
<a href="../classes/Thin.html">Thin</a> is copyright Marc-Andre Cournoyer
|
236
|
-
<macournoyer@gmail.com>
|
237
|
-
</p>
|
238
|
-
<p>
|
239
|
-
Please report any bug at <a
|
240
|
-
href="http://code.macournoyer.com/thin/trac.fcgi/newticket">code.macournoyer.com/thin/trac.fcgi/newticket</a>
|
241
|
-
</p>
|
242
|
-
|
243
|
-
|
244
|
-
<strong>Requires:</strong>
|
245
|
-
cgi
|
246
|
-
</ul>
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
</div>
|
253
|
-
</div>
|
254
|
-
|
255
|
-
|
256
|
-
</div>
|
257
|
-
</div>
|
258
|
-
<div id="footer">
|
259
|
-
<hr />
|
260
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
261
|
-
</div>
|
262
|
-
</body>
|
263
|
-
</html>
|