nitro 0.8.0 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. data/AUTHORS +3 -4
  2. data/ChangeLog +418 -0
  3. data/LICENSE +1 -1
  4. data/README +157 -89
  5. data/RELEASES +50 -0
  6. data/Rakefile +5 -7
  7. data/benchmark/nitro/bench.rb +5 -0
  8. data/benchmark/nitro/simple-webrick-n-200.txt +44 -0
  9. data/benchmark/nitro/static-webrick-n-200.txt +43 -0
  10. data/benchmark/nitro/tiny-lhttpd-n-200-c-5.txt +43 -0
  11. data/benchmark/nitro/tiny-webrick-n-200-c-5.txt +44 -0
  12. data/benchmark/nitro/tiny-webrick-n-200.txt +44 -0
  13. data/benchmark/nitro/tiny2-webrick-n-200.txt +44 -0
  14. data/{lib/nitro/server/cluster.rb → bin/cluster} +26 -30
  15. data/bin/proto/README +2 -2
  16. data/bin/proto/{apache.conf → conf/apache.conf} +0 -0
  17. data/bin/proto/conf/app.conf.rb +22 -0
  18. data/bin/proto/conf/lhttpd.conf +236 -0
  19. data/bin/proto/ctl +4 -0
  20. data/bin/proto/lib/README +5 -0
  21. data/bin/proto/log/README +3 -0
  22. data/bin/proto/root/fcgi.rb +6 -0
  23. data/bin/proto/root/index.xhtml +65 -7
  24. data/bin/proto/root/m/nitro.png +0 -0
  25. data/examples/blog/README +7 -5
  26. data/examples/blog/{apache.conf → conf/apache.conf} +0 -0
  27. data/examples/blog/conf/app.conf.rb +56 -0
  28. data/examples/blog/conf/lhttpd.conf +236 -0
  29. data/examples/blog/ctl +4 -0
  30. data/examples/blog/lib/blog.rb +11 -136
  31. data/examples/blog/lib/blog/controller.rb +99 -0
  32. data/examples/blog/lib/blog/model.rb +39 -0
  33. data/examples/blog/log/README +3 -0
  34. data/examples/blog/root/comments.xhtml +2 -2
  35. data/examples/blog/root/fcgi.rb +6 -0
  36. data/examples/blog/root/index.xhtml +4 -5
  37. data/examples/blog/root/login.xhtml +2 -2
  38. data/examples/blog/root/style.xsl +9 -9
  39. data/examples/blog/root/view_entry.xhtml +2 -2
  40. data/examples/flash/conf/app.conf.rb +23 -0
  41. data/examples/flash/ctl +4 -0
  42. data/examples/flash/log/README +3 -0
  43. data/examples/flash/root/index.xhtml +0 -9
  44. data/examples/flash/root/show_inline_text.xhtml +10 -5
  45. data/examples/no_xsl_blog/README +12 -0
  46. data/examples/no_xsl_blog/conf/apache.conf +0 -0
  47. data/examples/no_xsl_blog/conf/app.conf.rb +57 -0
  48. data/examples/no_xsl_blog/conf/lhttpd.conf +236 -0
  49. data/examples/no_xsl_blog/ctl +4 -0
  50. data/examples/no_xsl_blog/lib/blog.rb +20 -0
  51. data/examples/no_xsl_blog/lib/blog/controller.rb +102 -0
  52. data/examples/no_xsl_blog/lib/blog/model.rb +39 -0
  53. data/examples/no_xsl_blog/lib/blog/template.rb +134 -0
  54. data/examples/no_xsl_blog/log/README +3 -0
  55. data/examples/no_xsl_blog/root/comments.xhtml +41 -0
  56. data/examples/no_xsl_blog/root/entry_form.xhtml +22 -0
  57. data/examples/no_xsl_blog/root/fcgi.rb +6 -0
  58. data/examples/no_xsl_blog/root/index.xhtml +39 -0
  59. data/examples/no_xsl_blog/root/login.xhtml +21 -0
  60. data/examples/no_xsl_blog/root/m/bubbles.gif +0 -0
  61. data/examples/no_xsl_blog/root/m/comments_curve.gif +0 -0
  62. data/examples/no_xsl_blog/root/m/down.gif +0 -0
  63. data/examples/no_xsl_blog/root/m/footer_bg.gif +0 -0
  64. data/examples/no_xsl_blog/root/m/garrow.gif +0 -0
  65. data/examples/no_xsl_blog/root/m/gbull.gif +0 -0
  66. data/examples/no_xsl_blog/root/m/grbull.gif +0 -0
  67. data/examples/no_xsl_blog/root/m/h1_bg.gif +0 -0
  68. data/examples/no_xsl_blog/root/m/header_bg.gif +0 -0
  69. data/examples/no_xsl_blog/root/m/nitro.gif +0 -0
  70. data/examples/no_xsl_blog/root/m/obull.gif +0 -0
  71. data/examples/no_xsl_blog/root/m/page_bg.gif +0 -0
  72. data/examples/no_xsl_blog/root/m/rss.gif +0 -0
  73. data/examples/no_xsl_blog/root/m/side_title_bg.gif +0 -0
  74. data/examples/no_xsl_blog/root/m/sidebar_bg.gif +0 -0
  75. data/examples/no_xsl_blog/root/recent_posts.xhtml +14 -0
  76. data/examples/no_xsl_blog/root/style.css +301 -0
  77. data/examples/no_xsl_blog/root/view_entry.xhtml +25 -0
  78. data/examples/no_xsl_blog/root/view_entry.xml +12 -0
  79. data/examples/og/run.rb +2 -2
  80. data/examples/tiny/README +2 -2
  81. data/examples/tiny/conf/apache.conf +5 -0
  82. data/examples/tiny/conf/app.conf.rb +21 -0
  83. data/examples/tiny/conf/lhttpd.conf +236 -0
  84. data/examples/tiny/ctl +4 -0
  85. data/examples/tiny/log/README +3 -0
  86. data/examples/tiny/root/fcgi.rb +6 -0
  87. data/examples/tiny/root/index.xhtml +7 -4
  88. data/examples/tiny/root/nitro.png +0 -0
  89. data/lib/glue.rb +13 -9
  90. data/lib/glue/array.rb +1 -1
  91. data/lib/glue/cache.rb +1 -1
  92. data/lib/glue/flexob.rb +12 -0
  93. data/lib/glue/hash.rb +1 -1
  94. data/lib/glue/inflector.rb +2 -2
  95. data/lib/glue/logger.rb +4 -8
  96. data/lib/glue/misc.rb +14 -0
  97. data/lib/glue/number.rb +1 -1
  98. data/lib/glue/object.rb +26 -0
  99. data/lib/glue/pool.rb +1 -1
  100. data/lib/glue/property.rb +84 -91
  101. data/lib/glue/string.rb +1 -1
  102. data/lib/glue/time.rb +1 -1
  103. data/lib/glue/validation.rb +1 -1
  104. data/lib/nitro.rb +18 -6
  105. data/lib/nitro/adaptors/cgi.rb +291 -0
  106. data/lib/nitro/adaptors/fastcgi.rb +42 -0
  107. data/lib/nitro/adaptors/runner.rb +123 -0
  108. data/lib/nitro/adaptors/webrick.rb +110 -0
  109. data/lib/nitro/buffering.rb +43 -0
  110. data/lib/nitro/builders/form.rb +1 -1
  111. data/lib/nitro/builders/rss.rb +1 -1
  112. data/{bin → lib/nitro}/cluster.rb +26 -30
  113. data/lib/nitro/context.rb +82 -0
  114. data/lib/nitro/controller.rb +50 -0
  115. data/lib/nitro/cookie.rb +46 -0
  116. data/lib/nitro/dispatcher.rb +105 -0
  117. data/lib/nitro/filters.rb +9 -10
  118. data/lib/nitro/localization.rb +42 -0
  119. data/lib/nitro/mail.rb +11 -14
  120. data/lib/nitro/render.rb +275 -0
  121. data/lib/nitro/request.rb +128 -0
  122. data/lib/nitro/response.rb +38 -0
  123. data/lib/nitro/scaffold.rb +11 -11
  124. data/lib/nitro/session.rb +84 -0
  125. data/lib/nitro/{server/shaders.rb → shaders.rb} +56 -36
  126. data/lib/nitro/ui/pager.rb +23 -26
  127. data/lib/nitro/{sitemap.rb → ui/sitemap.rb} +4 -12
  128. data/lib/nitro/uri.rb +1 -1
  129. data/lib/nitro/version.rb +10 -8
  130. data/lib/og.rb +66 -65
  131. data/lib/og/backend.rb +1 -1
  132. data/lib/og/backends/mysql.rb +48 -52
  133. data/lib/og/backends/psql.rb +34 -37
  134. data/lib/og/connection.rb +15 -15
  135. data/lib/og/enchant.rb +16 -9
  136. data/lib/og/meta.rb +127 -54
  137. data/lib/og/mock.rb +18 -18
  138. data/lib/og/version.rb +6 -4
  139. data/lib/parts/content.rb +4 -8
  140. data/test/glue/tc_logger.rb +3 -0
  141. data/test/glue/tc_property.rb +19 -3
  142. data/test/nitro/adaptors/tc_cgi.rb +63 -0
  143. data/test/nitro/adaptors/tc_webrick.rb +15 -0
  144. data/test/nitro/builders/tc_xml.rb +2 -2
  145. data/test/nitro/tc_context.rb +13 -0
  146. data/test/nitro/tc_controller.rb +47 -0
  147. data/test/nitro/tc_dispatcher.rb +64 -0
  148. data/test/nitro/tc_session.rb +20 -0
  149. data/test/nitro/{tc_sitemap.rb → ui/tc_sitemap.rb} +1 -1
  150. data/test/root/blog/list.xhtml +6 -0
  151. data/test/tc_og.rb +41 -4
  152. metadata +115 -59
  153. data/bin/proto/app.rb +0 -20
  154. data/bin/proto/config.rb +0 -77
  155. data/examples/blog/app.rb +0 -21
  156. data/examples/blog/config.rb +0 -95
  157. data/examples/blog/env.rb +0 -22
  158. data/examples/flash/README +0 -34
  159. data/examples/flash/app.rb +0 -20
  160. data/examples/flash/config.rb +0 -38
  161. data/examples/flash/lib/flash.rb +0 -40
  162. data/examples/flash/tmp.swf +0 -0
  163. data/examples/tiny/app.rb +0 -19
  164. data/examples/tiny/config.rb +0 -29
  165. data/examples/tiny/root/nitro-small.png +0 -0
  166. data/lib/nitro/application.rb +0 -217
  167. data/lib/nitro/config.rb +0 -128
  168. data/lib/nitro/events.rb +0 -122
  169. data/lib/nitro/html.rb +0 -151
  170. data/lib/nitro/http.rb +0 -102
  171. data/lib/nitro/l10n.rb +0 -30
  172. data/lib/nitro/server.rb +0 -59
  173. data/lib/nitro/server/appserver.rb +0 -67
  174. data/lib/nitro/server/cookie.rb +0 -87
  175. data/lib/nitro/server/dispatcher.rb +0 -62
  176. data/lib/nitro/server/filters.rb +0 -75
  177. data/lib/nitro/server/filters/autologin.rb +0 -51
  178. data/lib/nitro/server/fragment.rb +0 -70
  179. data/lib/nitro/server/handlers.rb +0 -127
  180. data/lib/nitro/server/render.rb +0 -426
  181. data/lib/nitro/server/request.rb +0 -658
  182. data/lib/nitro/server/requestpart.rb +0 -54
  183. data/lib/nitro/server/script.rb +0 -387
  184. data/lib/nitro/server/server.rb +0 -57
  185. data/lib/nitro/server/session.rb +0 -220
  186. data/lib/nitro/server/user.rb +0 -46
  187. data/lib/nitro/server/webrick.rb +0 -180
  188. data/lib/nitro/service.rb +0 -26
  189. data/lib/xsl/ui.xsl +0 -51
  190. data/lib/xsl/xforms.xsl +0 -28
  191. data/test/nitro/server/tc_cookie.rb +0 -34
  192. data/test/nitro/server/tc_filters.rb +0 -38
  193. data/test/nitro/server/tc_request.rb +0 -70
  194. data/test/nitro/server/tc_requestpart.rb +0 -28
  195. data/test/nitro/server/tc_session.rb +0 -34
  196. data/test/nitro/tc_events.rb +0 -44
  197. data/test/nitro/tc_html.rb +0 -79
  198. data/test/nitro/tc_http.rb +0 -18
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0"?>
2
+
3
+ <span>
4
+ <h2>Recent posts</h2>
5
+ <?r if @entries ?>
6
+ <ul>
7
+ <?r for entry in @entries ?>
8
+ <li><a href="view_entry?oid=#{entry.oid}">#{entry.title}</a></li>
9
+ <?r end ?>
10
+ </ul>
11
+ <?r else ?>
12
+ no entries
13
+ <?r end ?>
14
+ </span>
@@ -0,0 +1,301 @@
1
+ body {
2
+ margin: 0;
3
+ padding: 0;
4
+ font-family: Verdana, sans-serif;
5
+ font-size: small;
6
+ color: #333;
7
+ background: #e0e0e0;
8
+ }
9
+
10
+ a:link {
11
+ color: #69c;
12
+ }
13
+
14
+ a:visited {
15
+ color: #666699;
16
+ }
17
+
18
+ a:hover {
19
+ color: #693;
20
+ }
21
+
22
+ a:active {
23
+ color: #cc3333;
24
+ text-decoration: none;
25
+ }
26
+
27
+ input, textarea {
28
+ font-family: Verdana, sans-serif;
29
+ font-size: small;
30
+ }
31
+
32
+ #page {
33
+ position: relative; top: 50%; left: 50%;
34
+ margin: 0px; margin-left: -400px;
35
+ width: 847px;
36
+ background: url(m/page_bg.gif) repeat-y;
37
+ }
38
+
39
+ #header {
40
+ margin: 0px;
41
+ color: #fff;
42
+ font-family: "Lucida Grande", "Trebuchet MS";
43
+ background: url(m/header_bg.gif) no-repeat top left;
44
+ }
45
+
46
+ #header h1 {
47
+ margin: 0px;
48
+ padding: 45px 60px 50px 160px;
49
+ background: url(m/h1_bg.gif) no-repeat bottom left;
50
+ }
51
+
52
+ #header h1 a {
53
+ color: #fff;
54
+ text-decoration: none;
55
+ }
56
+
57
+ #footer {
58
+ height: 40px;
59
+ color: #fff;
60
+ font-size: 80%;
61
+ background: url(m/footer_bg.gif) repeat-y;
62
+ padding-top: 15px; padding-left: 90px;
63
+ }
64
+
65
+ #footer a {
66
+ color: #fff;
67
+ }
68
+
69
+ #footer a:hover {
70
+ color: #fc0;
71
+ }
72
+
73
+ .main {
74
+ float: left;
75
+ margin: 10px; margin-left: 60px;
76
+ padding-left: 2px;
77
+ margin-bottom: 20px;
78
+ width: 460px;
79
+ }
80
+
81
+ .main li {
82
+ list-style: none;
83
+ padding-left: 14px;
84
+ margin-bottom: 3px;
85
+ background: url(m/obull.gif) no-repeat 0 6px;
86
+ }
87
+
88
+ .side {
89
+ color: #999;
90
+ margin: 0 41px 0px 547px;
91
+ padding-top: 25px; padding-left: 20px; padding-right: 20px;
92
+ font-size: 85%;
93
+ line-height: 1.4em;
94
+ background: url(m/sidebar_bg.gif) no-repeat 0 0;
95
+ }
96
+
97
+ .side h2 {
98
+ margin: 0 0 0 0;
99
+ padding: 25px 0 0 30px;
100
+ color: #666;
101
+ height: 32px !important;
102
+ height /**/:57px; /* for IE5/Win */
103
+ font-family: "Lucida Grande", "Trebuchet MS";
104
+ font-size: 130%;
105
+ background: url(m/side_title_bg.gif) no-repeat 0px 15px;
106
+ }
107
+
108
+ .side ul {
109
+ margin-top: 0px;
110
+ padding: 0px;
111
+ }
112
+
113
+ .side li {
114
+ list-style: none;
115
+ margin-left: 0px; margin-bottom: 3px;
116
+ padding-left: 14px;
117
+ background: url(m/gbull.gif) no-repeat 0 6px;
118
+ }
119
+
120
+ .entry {
121
+ border-bottom: 1px solid #eee;
122
+ margin-top: 15px; margin-bottom: 15px;
123
+ }
124
+
125
+ .full-entry {
126
+ margin-top: 15px; margin-bottom: 15px;
127
+ }
128
+
129
+ h2.date {
130
+ margin-top: 0;
131
+ padding-left: 14px;
132
+ font-size: 90%;
133
+ color: #f93;
134
+ background: url(m/down.gif) no-repeat 0 50%;
135
+ }
136
+
137
+ .post {
138
+ padding-left: 15px;
139
+ padding-bottom: 15px;
140
+ }
141
+
142
+ .post h3.title {
143
+ margin-top: 0;
144
+ font-family: "Lucida Grande", "Trebuchet MS";
145
+ font-size: 130%;
146
+ letter-spacing: -1px;
147
+ color: #f63;
148
+ }
149
+
150
+ .post .footer {
151
+ margin: 0; margin-top: 10px;
152
+ padding: 0 0 0 14px;
153
+ font-size: 88%;
154
+ color: #999;
155
+ background: url(m/grbull.gif) no-repeat 0 6px;
156
+ }
157
+
158
+ #comments {
159
+ margin-top: 30px;
160
+ padding-top: 10px;
161
+ font-size: 85%;
162
+ line-height: 1.5em;
163
+ color: #666;
164
+ background: #eee url(m/comments_curve.gif) no-repeat top left;
165
+ }
166
+
167
+ #comments h2 {
168
+ margin: 20px 0 15px 0;
169
+ padding: 8px 0 0 40px;
170
+ font-family: "Lucida Grande", "Trebuchet MS";
171
+ font-size: 130%;
172
+ color: #666;
173
+ background: url(m/bubbles.gif) no-repeat 10px 0;
174
+ height: 29px !important; /* for most browsers */
175
+ height /**/:37px; /* for IE5/Win */
176
+ }
177
+
178
+ #comments form {
179
+ margin: 10px;
180
+ padding-bottom: 10px;
181
+ }
182
+
183
+ .comment {
184
+ padding: 10px;
185
+ border-bottom: 1px solid #ddd;
186
+ }
187
+
188
+ .comment .footer {
189
+ margin: 4px 0 0 0;
190
+ padding: 0 0 0 60px;
191
+ color: #999;
192
+ background: url(m/garrow.gif) no-repeat 44px 2px;
193
+ }
194
+
195
+ .error {
196
+ color: #f00;
197
+ }
198
+
199
+ .clear {
200
+ clear: both;
201
+ height: 0px;
202
+ line-height: 0px;
203
+ font-size: 0px;
204
+ overflow: hidden;
205
+ background-color: #f00;
206
+ }
207
+
208
+ #rendering-errors {
209
+ float: left;
210
+ border: 1px solid red;
211
+ background: white;
212
+ padding: 10px;
213
+ margin: 20px;
214
+ }
215
+
216
+ .rss li {
217
+ list-style: none;
218
+ padding-left: 34px; padding-top: 3px;
219
+ margin-bottom: 3px;
220
+ height: 18px;
221
+ background: url(m/rss.gif) no-repeat 0 6px;
222
+ }
223
+
224
+ /* --- pager --- */
225
+
226
+ .pager {
227
+ margin-top: 40px; margin-bottom: 50px;
228
+ border-top: 1px solid #ccc;
229
+ background-color: #f0f0f0;
230
+ }
231
+
232
+ .pager .first {
233
+ float: left;
234
+ padding: 5px;
235
+ }
236
+
237
+ .pager .previous {
238
+ float: left;
239
+ padding: 5px;
240
+ margin-left: 5px;
241
+ }
242
+
243
+ .pager .next {
244
+ float: right;
245
+ padding: 5px;
246
+ margin-right: 5px;
247
+ }
248
+
249
+ .pager .last {
250
+ float: right;
251
+ padding: 5px;
252
+ }
253
+
254
+ .pager ul {
255
+ float: left;
256
+ margin: 0px;
257
+ padding: 0px;
258
+ }
259
+
260
+ .pager li {
261
+ float: left;
262
+ display: inline;
263
+ padding: 5px;
264
+ padding-left: 10px;
265
+ padding-right: 10px;
266
+ background: none;
267
+ }
268
+
269
+ .pager li.active {
270
+ background-color: #ffa;
271
+ }
272
+
273
+ .noitems {
274
+ padding: 5px;
275
+ text-align: center;
276
+ }
277
+
278
+ /* --- forms --- */
279
+
280
+ dl {
281
+ margin: 0px;
282
+ }
283
+
284
+ dt {
285
+ display: block;
286
+ margin: 0px;
287
+ margin-right: 10px;
288
+ padding-bottom: 10px;
289
+ font-weight: bold;
290
+ }
291
+
292
+ dd {
293
+ display: block;
294
+ margin: 0px;
295
+ padding-bottom: 10px;
296
+ }
297
+
298
+ textarea {
299
+ width: 90%;
300
+ height: 150px;
301
+ }
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0"?>
2
+
3
+ #{s_page}
4
+
5
+ <div class="full-@entry">
6
+ <h2 class="date">#{@entry.create_time.strftime('%B %e, %G')}</h2>
7
+ <div class="post">
8
+ <h3 class="title">#{@entry.title}</h3>
9
+ #{@entry.body}
10
+ <div class="footer">
11
+ posted by gmosx at #{@entry.create_time.strftime('%R %p')}
12
+ <?r if session[:owner] ?>
13
+ [<a href="del_entry?oid=#{@entry.oid}">del</a>]
14
+ <?r end ?>
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <div id="comments">
20
+ <render href="comments" />
21
+ </div>
22
+
23
+ <p><a href="/">Home</a></p>
24
+
25
+ #{e_page}
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0"?>
2
+
3
+ <entry>
4
+ <title>#{@entry.title}</title>
5
+ <date>#{@entry.create_time.strftime('%B %e, %G')}</date>
6
+ <body>#{@entry.body}</body>
7
+ <comments>
8
+ <?r for comment in @entry.comments ?>
9
+ <comment>#{comment.body}</comment>
10
+ <?r end ?>
11
+ </comments>
12
+ </entry>
@@ -6,7 +6,7 @@
6
6
  # * George Moschovitis <gm@navel.gr>
7
7
  #
8
8
  # (c) 2004 Navel, all rights reserved.
9
- # $Id: run.rb 198 2004-12-22 11:26:59Z gmosx $
9
+ # $Id: run.rb 202 2005-01-17 10:44:13Z gmosx $
10
10
 
11
11
  $:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
12
12
 
@@ -273,7 +273,7 @@ puts '---'
273
273
 
274
274
  c2.articles.each { |a| puts a.title }
275
275
 
276
- article.del_category(c1)
276
+ article.delete_category(c1)
277
277
 
278
278
  puts '---'
279
279
 
@@ -7,8 +7,8 @@ An example to test Nitro.
7
7
 
8
8
  $ cd examples/tiny
9
9
 
10
- $ ruby app.rb --start
10
+ $ ruby ctl
11
11
 
12
- browse http://127.0.0.1:9090
12
+ browse http://127.0.0.1:8080
13
13
 
14
14
  to stop the example press Ctrl+C
@@ -0,0 +1,5 @@
1
+ # Nitro: Apache-FastCGI configuration.
2
+ #
3
+ # * George Moschovitis <gm@navel.gr>
4
+ # (c) 2005 Navel, all rights reserved.
5
+ # $Id$
@@ -0,0 +1,21 @@
1
+ # * George Moschovitis <gm@navel.gr>
2
+ # (c) 2004-2005 Navel, all rights reserved.
3
+ # $Id: app.rb 197 2004-12-21 13:50:17Z gmosx $
4
+
5
+ $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
6
+
7
+ $DBG = true
8
+
9
+ require 'nitro'
10
+
11
+ # gmosx, FIXME: make this default!
12
+
13
+ require 'ostruct'
14
+
15
+ conf = {
16
+ :host => 'localhost',
17
+ :port => 8080,
18
+ :dispatcher => N::Dispatcher.new
19
+ }
20
+
21
+ $conf = OpenStruct.new(conf)
@@ -0,0 +1,236 @@
1
+ # lighttpd configuration file
2
+ # $Id$
3
+
4
+ ############ Options you really have to take care of ####################
5
+
6
+ ## modules to load
7
+ # at least mod_access and mod_accesslog should be loaded
8
+ # all other module should only be loaded if really neccesary
9
+ # - saves some time
10
+ # - saves memory
11
+
12
+ server.modules = (
13
+ "mod_rewrite",
14
+ # "mod_redirect",
15
+ "mod_access",
16
+ # "mod_auth",
17
+ # "mod_status",
18
+ "mod_fastcgi",
19
+ # "mod_simple_vhost",
20
+ # "mod_evhost",
21
+ # "mod_cgi",
22
+ # "mod_compress",
23
+ # "mod_ssi",
24
+ # "mod_usertrack",
25
+ # "mod_rrdtool",
26
+ "mod_accesslog"
27
+ )
28
+
29
+ ## a static document-root, for virtual-hosting take look at the
30
+ ## server.virtual-* options
31
+ server.document-root = "/home/gmosx/navel/nitro/examples/tiny/root/"
32
+
33
+ ## where to send error-messages to
34
+ server.errorlog = "/home/gmosx/navel/nitro/examples/tiny/log/lighttpd.error.log"
35
+
36
+ # files to check for if .../ is requested
37
+ server.indexfiles = ( "index.html" )
38
+
39
+ # mimetype mapping
40
+ mimetype.assign = (
41
+ ".pdf" => "application/pdf",
42
+ ".sig" => "application/pgp-signature",
43
+ ".spl" => "application/futuresplash",
44
+ ".class" => "application/octet-stream",
45
+ ".ps" => "application/postscript",
46
+ ".torrent" => "application/x-bittorrent",
47
+ ".dvi" => "application/x-dvi",
48
+ ".gz" => "application/x-gzip",
49
+ ".pac" => "application/x-ns-proxy-autoconfig",
50
+ ".swf" => "application/x-shockwave-flash",
51
+ ".tar.gz" => "application/x-tgz",
52
+ ".tgz" => "application/x-tgz",
53
+ ".tar" => "application/x-tar",
54
+ ".zip" => "application/zip",
55
+ ".mp3" => "audio/mpeg",
56
+ ".m3u" => "audio/x-mpegurl",
57
+ ".wma" => "audio/x-ms-wma",
58
+ ".wax" => "audio/x-ms-wax",
59
+ ".ogg" => "audio/x-wav",
60
+ ".wav" => "audio/x-wav",
61
+ ".gif" => "image/gif",
62
+ ".jpg" => "image/jpeg",
63
+ ".jpeg" => "image/jpeg",
64
+ ".png" => "image/png",
65
+ ".xbm" => "image/x-xbitmap",
66
+ ".xpm" => "image/x-xpixmap",
67
+ ".xwd" => "image/x-xwindowdump",
68
+ ".css" => "text/css",
69
+ ".html" => "text/html",
70
+ ".htm" => "text/html",
71
+ ".js" => "text/javascript",
72
+ ".asc" => "text/plain",
73
+ ".c" => "text/plain",
74
+ ".conf" => "text/plain",
75
+ ".text" => "text/plain",
76
+ ".txt" => "text/plain",
77
+ ".dtd" => "text/xml",
78
+ ".xml" => "text/xml",
79
+ ".mpeg" => "video/mpeg",
80
+ ".mpg" => "video/mpeg",
81
+ ".mov" => "video/quicktime",
82
+ ".qt" => "video/quicktime",
83
+ ".avi" => "video/x-msvideo",
84
+ ".asf" => "video/x-ms-asf",
85
+ ".asx" => "video/x-ms-asf",
86
+ ".wmv" => "video/x-ms-wmv"
87
+ )
88
+
89
+ # Use the "Content-Type" extended attribute to obtain mime type if possible
90
+ # mimetypes.use-xattr = "enable"
91
+
92
+ #### accesslog module
93
+ accesslog.filename = "/home/gmosx/navel/nitro/examples/tiny/log/access.log"
94
+
95
+ ## deny access the file-extensions
96
+ #
97
+ # ~ is for backupfiles from vi, emacs, joe, ...
98
+ # .inc is often used for code includes which should in general not be part
99
+ # of the document-root
100
+ url.access-deny = ( "~", ".inc" )
101
+
102
+
103
+
104
+ ######### Options that are good to be but not neccesary to be changed #######
105
+
106
+ ## bind to port (default: 80)
107
+ server.port = 8080
108
+
109
+ ## bind to localhost (default: all interfaces)
110
+ #server.bind = "grisu.home.kneschke.de"
111
+
112
+ ## error-handler for status 404
113
+ #server.error-handler-404 = "/error-handler.html"
114
+ #server.error-handler-404 = "/error-handler.php"
115
+
116
+ ## to help the rc.scripts
117
+ # server.pid-file = "/var/run/lighttpd.pid"
118
+
119
+
120
+ ###### virtual hosts
121
+ ##
122
+ ## If you want name-based virtual hosting add the next three settings and load
123
+ ## mod_simple_vhost
124
+ ##
125
+ ## document-root =
126
+ ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
127
+ ## virtual-server-root + http-host + virtual-server-docroot
128
+ ##
129
+ #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
130
+ #simple-vhost.default-host = "grisu.home.kneschke.de"
131
+ #simple-vhost.document-root = "/pages/"
132
+
133
+
134
+ ##
135
+ ## Format: <errorfile-prefix><status>.html
136
+ ## -> ..../status-404.html for 'File not found'
137
+ #server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
138
+
139
+ ## virtual directory listings
140
+ #server.dir-listing = "enable"
141
+
142
+ ## send unhandled HTTP-header headers to error-log
143
+ #debug.dump-unknown-headers = "enable"
144
+
145
+ ### only root can use these options
146
+ #
147
+ # chroot() to directory (default: no chroot() )
148
+ #server.chroot = "/"
149
+
150
+ ## change uid to <uid> (default: don't care)
151
+ #server.username = "wwwrun"
152
+
153
+ ## change uid to <uid> (default: don't care)
154
+ #server.groupname = "wwwrun"
155
+
156
+ #### compress module
157
+ #compress.cache-dir = "/tmp/lighttpd/cache/compress/"
158
+ #compress.filetype = ("text/plain", "text/html")
159
+
160
+ #### fastcgi module
161
+ ## read fastcgi.txt for more info
162
+ fastcgi.server = ( ".rb" =>
163
+ ( "localhost" =>
164
+ (
165
+ "socket" => "/tmp/nitro-fcgi.socket",
166
+ "bin-path" => "/home/gmosx/navel/nitro/examples/tiny/root/fcgi.rb"
167
+ )
168
+ )
169
+ )
170
+
171
+ #### CGI module
172
+ #cgi.assign = ( ".pl" => "/usr/bin/perl",
173
+ # ".cgi" => "/usr/bin/perl" )
174
+ #
175
+
176
+ #### SSL engine
177
+ #ssl.engine = "enable"
178
+ #ssl.pemfile = "server.pem"
179
+
180
+ #### status module
181
+ # status.status-url = "/server-status"
182
+ # status.config-url = "/server-config"
183
+
184
+ #### auth module
185
+ ## read authentification.txt for more info
186
+ # auth.backend = "plain"
187
+ # auth.backend.plain.userfile = "lighttpd.user"
188
+ # auth.backend.plain.groupfile = "lighttpd.group"
189
+
190
+ # auth.backend.ldap.hostname = "localhost"
191
+ # auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
192
+ # auth.backend.ldap.filter = "(uid=$)"
193
+
194
+ # auth.require = ( "/server-status" =>
195
+ # (
196
+ # "method" => "digest",
197
+ # "realm" => "download archiv",
198
+ # "require" => "group=www|user=jan|host=192.168.2.10"
199
+ # ),
200
+ # "/server-info" =>
201
+ # (
202
+ # "method" => "digest",
203
+ # "realm" => "download archiv",
204
+ # "require" => "group=www|user=jan|host=192.168.2.10"
205
+ # )
206
+ # )
207
+
208
+ #### url handling modules (rewrite, redirect, access)
209
+
210
+ url.rewrite = (
211
+ "^/([\/\-_a-zA-Z0-9]+)?$" => "/fcgi.rb",
212
+ "^/([\/\-_a-zA-Z0-9]+)?\?([\-_a-zA-Z0-9=;&%]*)$" => "/fcgi.rb?$2"
213
+ )
214
+
215
+ # url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
216
+
217
+ #
218
+ # define a pattern for the host url finding
219
+ # %% => % sign
220
+ # %0 => domain name + tld
221
+ # %1 => tld
222
+ # %2 => domain name without tld
223
+ # %3 => subdomain 1 name
224
+ # %4 => subdomain 2 name
225
+ #
226
+ # evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
227
+
228
+ #### expire module
229
+ # expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
230
+
231
+ #### ssi
232
+ # ssi.extension = ( ".shtml" )
233
+
234
+ #### rrdtool
235
+ # rrdtool.binary = "/usr/bin/rrdtool"
236
+ # rrdtool.db-name = "/var/www/lighttpd.rrd"