1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
<?xml version='1.0' encoding='EUC-KR' ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
<!-- English Revision: 659902:1646392 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manualpage metafile="ssi.xml.meta">
<parentdocument href="./">How-To / Tutorials</parentdocument>
<title>¾ÆÆÄÄ¡ ÅõÅ丮¾ó: Server Side Includes ¼Ò°³</title>
<summary>
<p>Server-side includes¸¦ »ç¿ëÇÏ¿© HTML ¹®¼¿¡ µ¿ÀûÀÎ ³»¿ëÀ»
Ãß°¡ÇÒ ¼ö ÀÖ´Ù.</p>
</summary>
<section id="related"><title>¼Ò°³</title>
<related>
<modulelist>
<module>mod_include</module>
<module>mod_cgi</module>
<module>mod_expires</module>
</modulelist>
<directivelist>
<directive module="core">Options</directive>
<directive module="mod_include">XBitHack</directive>
<directive module="mod_mime">AddType</directive>
<directive module="core">SetOutputFilter</directive>
<directive module="mod_setenvif">BrowserMatchNoCase</directive>
</directivelist>
</related>
<p>ÀÌ ±ÛÀº º¸Åë SSI¶ó°í ºÎ¸£´Â Server Side Includes¸¦ ¼³¸íÇÑ´Ù.
SSI°¡ °¡´ÉÇϵµ·Ï ¼¹ö¸¦ ¼³Á¤ÇÏ´Â ¹æ¹ý°ú HTML ÆäÀÌÁö¿¡ µ¿ÀûÀÎ
³»¿ëÀ» Ãß°¡ÇÏ´Â ±âº»ÀûÀÎ SSI »ç¿ë¹ýÀ» ¼Ò°³ÇÑ´Ù.</p>
<p>ÀÌ ±ÛÀÇ µÞºÎºÐÀº SSI Áö½Ã¾î Á¶°Ç¹®°ú °°Àº °í±Þ±â¹ýÀ»
¼³¸íÇÑ´Ù.</p>
</section>
<section id="what"><title>SSI°¡ ¹«¾ùÀΰ¡?</title>
<p>SSI (Server Side Includes)´Â HTML ÆäÀÌÁö¿¡ »ç¿ëÇÏ´Â Áö½Ã¾î·Î,
ÆäÀÌÁö¸¦ ¼ºñ½ºÇÒ¶§ ¼¹ö°¡ ó¸®ÇÑ´Ù. SSI¸¦ »ç¿ëÇϸé CGI
ÇÁ·Î±×·¥À̳ª ´Ù¸¥ µ¿ÀûÀÎ ±â¼ú·Î ÆäÀÌÁö Àüü¸¦ ¸¸µé¾î¼
¼ºñ½ºÇÏÁö ¾Ê°íµµ HTML ÆäÀÌÁö¿¡ µ¿ÀûÀ¸·Î »ý¼ºÇÑ ³»¿ëÀ» Ãß°¡ÇÒ
¼ö ÀÖ´Ù.</p>
<p>SSI¸¦ »ç¿ëÇÒÁö ¾Æ´Ï¸é ÇÁ·Î±×·¥À¸·Î ÆäÀÌÁö Àüü¸¦ »ý¼ºÇÒÁö
°áÁ¤Àº ÆäÀÌÁö¿¡¼ Á¤ÀûÀÎ ºÎºÐÀÌ ¸¹ÀºÁö¿Í ÆäÀÌÁö¸¦ ¼ºñ½ºÇÒ
¶§¸¶´Ù ¾î´ÀÁ¤µµ¸¦ ´Ù½Ã °è»êÇؾßÇÒÁö¿¡ ´Þ·È´Ù. SSI´Â ÇöÀç
½Ã°£°ú °°ÀÌ ÀûÀº Á¤º¸¸¦ Ãß°¡Çϴµ¥ ÁÁ´Ù. ±×·¯³ª ÆäÀÌÁö¸¦
¼ºñ½ºÇÒ¶§ ÆäÀÌÁöÀÇ ´ëºÎºÐÀ» »ý¼ºÇØ¾ß ÇÑ´Ù¸é ´Ù¸¥ ¹æ¹ýÀ»
ã¾ÆºÁ¾ß ÇÑ´Ù.</p>
</section>
<section id="configuring">
<title>SSI°¡ °¡´ÉÇϵµ·Ï ¼¹ö ¼³Á¤Çϱâ</title>
<p>¼¹ö°¡ SSI¸¦ ó¸®ÇÏ·Á¸é <code>httpd.conf</code> ÆÄÀÏÀ̳ª
<code>.htaccess</code> ÆÄÀÏ¿¡¼ ´ÙÀ½ Áö½Ã¾î¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù.</p>
<example>
Options +Includes
</example>
<p>±×·¯¸é ¾ÆÆÄÄ¡´Â ÆÄÀÏ¿¡¼ SSI Áö½Ã¾î¸¦ ó¸®ÇÑ´Ù. ¼³Á¤¿¡´Â
º¸Åë ¿©·¯ <directive module="core">Options</directive> Áö½Ã¾î°¡
ÀÖ°í, ÀÌ Áö½Ã¾îµéÀº ¼·Î µ¤¾î½á¼ ¹«È¿·Î ¸¸µé´Ù. ±×·¡¼
Áö½Ã¾î¸¦ ¸Ç¸¶Áö¸·¿¡ ó¸®ÇϱâÀ§ÇØ º¸Åë SSI¸¦ ¿øÇϴ ƯÁ¤
µð·ºÅ丮¿¡¼ <code>Options</code>¸¦ »ç¿ëÇÑ´Ù.</p>
<p>¸ðµç ÆÄÀÏ¿¡¼ SSI Áö½Ã¾î¸¦ ó¸®ÇÏ´Â °ÍÀº ¾Æ´Ï´Ù. ¾ÆÆÄÄ¡¿¡°Ô
¾î¶² ÆÄÀÏÀ» ó¸®ÇÒÁö ¾Ë·ÁÁà¾ß ÇÑ´Ù. µÎ°¡Áö ¹æ¹ýÀÌ ÀÖ´Ù.
Çϳª´Â ´ÙÀ½°ú °°Àº Áö½Ã¾î·Î <code>.shtml</code>°ú °°Àº ƯÁ¤
ÆÄÀÏ È®ÀåÀÚ¸¦ °¡Áø ÆÄÀÏÀ» ó¸®ÇÏ´Â ¹æ¹ýÀÌ´Ù.</p>
<example>
AddType text/html .shtml<br />
AddOutputFilter INCLUDES .shtml
</example>
<p>ÀÌ ¹æ¹ýÀÇ ´ÜÁ¡Àº ÀÌ¹Ì ÀÖ´Â ÆäÀÌÁö¿¡ SSI Áö½Ã¾î¸¦ Ãß°¡ÇÏ´Â
°æ¿ì SSI Áö½Ã¾î¸¦ ó¸®ÇϱâÀ§ÇØ <code>.shtml</code> È®ÀåÀÚ¸¦
ºÎ¿©Çϱ⶧¹®¿¡ ÆÄÀϸí°ú ÀÌ ÆäÀÌÁöÀÇ ¸ðµç ¸µÅ©¸¦ º¯°æÇؾß
ÇÏ´Â Á¡ÀÌ´Ù.</p>
<p>´Ù¸¥ ¹æ¹ýÀº <directive module="mod_include">XBitHack</directive>
Áö½Ã¾î¸¦ »ç¿ëÇÏ´Â ¹æ¹ýÀÌ´Ù.</p>
<example>
XBitHack on
</example>
<p><directive module="mod_include">XBitHack</directive>´Â
½ÇÇà±ÇÇÑÀÌ ÀÖ´Â ÆÄÀÏ¿¡¼ SSI Áö½Ã¾î¸¦ ó¸®ÇÑ´Ù. ±×·¡¼ À̹Ì
ÀÖ´Â ÆäÀÌÁö¿¡ SSI Áö½Ã¾î¸¦ Ãß°¡ÇÑ´Ù¸é ÆÄÀϸíÀ» º¯°æÇÏÁö
¾Ê°í <code>chmod</code>·Î ÆÄÀÏ¿¡ ½ÇÇà±ÇÇÑÀ» ÁÖ¸é µÈ´Ù.</p>
<example>
chmod +x pagename.html
</example>
<p>ÇÏÁö ¸»¾Æ¾ß ÇÒ °Í Çϳª. °¡²û <code>.shtml</code> ÆÄÀÏ¸í¿¡
°ñÄ¡¸¦ ¾ÎÁö¸»°í ¸ðµç <code>.html</code> ÆÄÀÏÀ» SSI ó¸®Ç϶ó°í
Ãæ°íÇÏ´Â »ç¶÷ÀÌ ÀÖ´Ù. ÀÌ »ç¶÷µéÀº ¾Æ¸¶µµ <directive
module="mod_include">XBitHack</directive>¿¡ ´ëÇØ ¸ð¸£´Â
°Í °°´Ù. ¸í½ÉÇÒ Á¡Àº ÀÌ·¸°Ô ÇÏ¸é ¾ÆÆÄÄ¡´Â ÆÄÀÏ¿¡ SSI Áö½Ã¾î°¡
¾ø´õ¶óµµ Ŭ¶óÀ̾ðÆ®·Î º¸³»´Â ¸ðµç ÆÄÀÏÀ» »ìÆìºÁ¾ß ÇÑ´Ù´Â
°ÍÀÌ´Ù. ¼º´ÉÀÌ ¸Å¿ì ´À·ÁÁú ¼ö ÀÖÀ¸¸ç, ÁÁÀº »ý°¢ÀÌ ¾Æ´Ï´Ù.</p>
<p>¹°·Ð À©µµ¿ìÁî¿¡¼´Â ½ÇÇà±ÇÇÑÀ̶õ °ÍÀÌ ¾ø±â¶§¹®¿¡ ÈÄÀÚ¸¦
»ç¿ëÇÒ ¼ö ¾ø´Ù.</p>
<p>³»¿ëÀÌ µ¿ÀûÀÌ¿©¼ °è»êÇϱ⠾î·Æ±â¶§¹®¿¡ ¾ÆÆÄÄ¡ ±âº» ¼³Á¤Àº
SSI ÆäÀÌÁöÀÇ ÃÖ±Ù¼öÁ¤ÀÏ°ú content length HTTP Çì´õ¸¦ º¸³»Áö
¾Ê´Â´Ù. ±×·¡¼ ¹®¼¸¦ ij½¬ÇÏÁö ¸øÇÏ°í Ŭ¶óÀ̾ðÆ®°¡ ´À³¢´Â
¼º´ÉÀÌ ¶³¾îÁø´Ù. µÎ°¡Áö ÇØ°á¹æ¹ýÀÌ ÀÖ´Ù.</p>
<ol>
<li><code>XBitHack Full</code> ¼³Á¤Àº »ç¿ëÇÑ´Ù. ±×·¯¸é
¾ÆÆÄÄ¡´Â Æ÷ÇÔÇÏ´Â(include) ÆÄÀϵéÀÇ ¼öÁ¤ÀÏÀº ¹«½ÃÇÑü
¿ø·¡ ¿äûÇÑ ÆÄÀÏÀÇ ³¯Â¥¸¸ º¸°í ÃÖ±Ù¼öÁ¤ÀÏÀ» ¾Ë¾Æ³½´Ù.</li>
<li><module>mod_expires</module>¿¡ ÀÖ´Â Áö½Ã¾î¸¦ »ç¿ëÇÏ¿©
ÆÄÀÏ¿¡ Á÷Á¢ ¸¸±âÀÏÀ» ¼³Á¤ÇÏ¸é ºê¶ó¿ìÀú¿Í ÇÁ·Ï½Ã°¡ ¹®¼¸¦
ij½¬ÇÒ ¼ö ÀÖ´Ù.</li>
</ol>
</section>
<section id="basic"><title>±âº» SSI Áö½Ã¾î</title>
<p>SSI Áö½Ã¾îÀÇ »ç¿ë¹ýÀº ´ÙÀ½°ú °°´Ù.</p>
<example>
<!--#element attribute=value attribute=value ... -->
</example>
<p>HTML ÁÖ¼®°°ÀÌ »ý°å±â¶§¹®¿¡ SSI ±â´ÉÀ» °¡µ¿ÇÏÁö ¾Ê¾Æµµ
HTML ¼Ò½º¿¡´Â ³ª¿ÀÁö¸¸ ºê¶ó¿ìÀú´Â ¹«½ÃÇÑ´Ù. SSI¸¦ ¿Ã¹Ù·Î
¼³Á¤Çϸé Áö½Ã¾î¸¦ °á°ú°ªÀ¸·Î ¹Ù²Û´Ù.</p>
<p>element´Â ´ÙÀ½Áß Çϳª´Ù. ´ÙÀ½ ȸ¿¡ ´õ ÀÚ¼¼È÷ ¼³¸íÇÒ °ÍÀÌ´Ù.
Áö±ÝÀº SSI·Î ÇÒ ¼ö ÀÖ´Â ¸î°¡Áö ¿¹¸¦ º¸ÀδÙ</p>
<section id="todaysdate"><title>¿À´Ã ³¯Â¥</title>
<example>
<!--#echo var="DATE_LOCAL" -->
</example>
<p><code>echo</code> element´Â º¯¼ö°ªÀ» ±×´ë·Î Ãâ·ÂÇÑ´Ù.
CGI ÇÁ·Î±×·¥¿¡ Á¦°øÇϴ ȯ°æº¯¼öµé ¿Ü¿¡µµ ¿©·¯ Ç¥ÁØ º¯¼ö°¡
ÀÖ´Ù. ¶Ç, <code>set</code> element¸¦ »ç¿ëÇÏ¿© Á÷Á¢ º¯¼ö¸¦
Á¤ÀÇÇÒ ¼öµµ ÀÖ´Ù.</p>
<p>³¯Â¥ Ãâ·Â Çü½ÄÀÌ ¸¶À½¿¡ µéÁö ¾Ê´Â´Ù¸é, ´ÙÀ½°ú °°ÀÌ
<code>config</code> elementÀÇ <code>timefmt</code> attribute¸¦
»ç¿ëÇÑ´Ù.</p>
<example>
<!--#config timefmt="%A %B %d, %Y" --><br />
Today is <!--#echo var="DATE_LOCAL" -->
</example>
</section>
<section id="lastmodified"><title>ÆÄÀÏÀÇ ¼öÁ¤ÀÏ</title>
<example>
ÀÌ ¹®¼´Â <!--#flastmod file="index.html" -->¿¡ ¸¶Áö¸·À¸·Î ¼öÁ¤µÇ¾ú´Ù
</example>
<p>ÀÌ elementµµ <code>timefmt</code> Çü½Ä ¼³Á¤¿¡ ´Þ·È´Ù.</p>
</section>
<section id="cgi"><title>CGI ÇÁ·Î±×·¥ °á°ú¸¦ Æ÷ÇÔÇϱâ</title>
<p>ÀϹÝÀûÀÎ SSI »ç¿ë¹ýÁß Çϳª·Î, ¸¹ÀÌµé ¾Ö¿ëÇÏ´Â ``¹æ¹®¼ö
Ä«¿îÅÍ'' °°Àº CGI ÇÁ·Î±×·¥ °á°ú¸¦ Ãâ·ÂÇÑ´Ù.</p>
<example>
<!--#include virtual="/cgi-bin/counter.pl" -->
</example>
</section>
</section>
<section id="additionalexamples">
<title>Ãß°¡ ¿¹Á¦</title>
<p>´ÙÀ½Àº HTML ¹®¼¿¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸î°¡Áö SSI ¿¹Á¦´Ù.</p>
<section id="docmodified"><title>ÀÌ ¹®¼°¡ ¾ðÁ¦ ¸¶Áö¸·À¸·Î
¼öÁ¤µÇ¾ú³ª?</title>
<p>¾Õ¿¡¼ SSI¸¦ »ç¿ëÇÏ¿© »ç¿ëÀÚ¿¡°Ô ¹®¼ÀÇ ÃÖ±Ù¼öÁ¤ÀÏÀ»
¾Ë¸± ¼ö ÀÖ´Ù°í ¸»Çß´Ù. ±×·¯³ª ½ÇÁ¦ ¹æ¹ýÀº ¾Ë·ÁÁÖÁö ¾Ê¾Ò´Ù.
´ÙÀ½ Äڵ带 HTML ¹®¼¿¡ »ç¿ëÇϸé ÆäÀÌÁö¿¡ ½Ã°£ ±â·ÏÀ» ³²±ä´Ù.
¹°·Ð À§¿¡¼ ¼³¸íÇÑ´ë·Î SSI°¡ ¿Ã¹Ù·Î ÀÛµ¿ÇØ¾ß ÇÑ´Ù.</p>
<example>
<!--#config timefmt="%A %B %d, %Y" --><br />
ÀÌ ¹®¼´Â <!--#flastmod file="ssi.shtml" -->¿¡ ¸¶Áö¸·À¸·Î ¼öÁ¤µÇ¾ú´Ù;
</example>
<p>¹°·Ð <code>ssi.shtml</code>´ë½Å ¿øÇÏ´Â ½ÇÁ¦ ÆÄÀϸíÀ»
»ç¿ëÇÑ´Ù. ¾Æ¹« ÆäÀÌÁö¿¡¶óµµ ºÙ¿©³ÖÀ» ¼ö ÀÖ´Â ¹ü¿ëÄڵ带
¿øÇÑ´Ù¸é, ÆÄÀÏ¸í ´ë½Å <code>LAST_MODIFIED</code> º¯¼ö¸¦
»ç¿ëÇÑ´Ù.</p>
<example>
<!--#config timefmt="%D" --><br />
This file last modified <!--#echo var="LAST_MODIFIED" -->
</example>
<p><code>timefmt</code> Çü½Ä¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ Á¤º¸´Â °Ë»ö¿£Áø¿¡¼
<code>strftime</code>À» ã¾ÆºÁ¶ó. ¹®¹ýÀº °°´Ù.</p>
</section>
<section id="standard-footer">
<title>Ç¥ÁØ ÆäÀÌÁö ÇÏ´ÜÀ» Æ÷ÇÔÇϱâ</title>
<p>¿©·¯ ÆäÀÌÁö°¡ ÀÖ´Â »çÀÌÆ®¸¦ °ü¸®ÇÑ´Ù¸é ÆäÀÌÁö Àüü¸¦
¼öÁ¤ÇÏ´Â °ÍÀº, ƯÈ÷ ÆäÀÌÁöµéÀÌ Ç¥ÁØ ¿Ü°üÀ» °¡Áöµµ·Ï ¼öÁ¤ÇÏ´Â
°ÍÀº Á¤¸»·Î ±«·Ó´Ù.</p>
<p>ÆäÀÌÁö »ó´Ü(header)°ú ÇÏ´Ü(footer)À» ÆÄÀÏ·Î Æ÷ÇÔÇÏ¿©
ÀÌ·± ¼öÁ¤ÀÇ ºÎ´ãÀ» ´ú ¼ö ÀÖ´Ù. ¸ðµç ÆäÀÌÁö¿¡¼
<code>include</code> SSI ¸í·É¾î¸¦ »ç¿ëÇÏ¿© ÆäÀÌÁö ÇÏ´Ü ÆÄÀÏ
Çϳª¸¦ Æ÷ÇÔÇÏ¸é µÈ´Ù. <code>include</code> elementÀÇ
<code>file</code> attribute³ª <code>virtual</code> attribute·Î
Æ÷ÇÔÇÒ ÆÄÀÏÀ» ÁöÁ¤ÇÑ´Ù. <code>file</code> attribute´Â <em>ÇöÀç
µð·ºÅ丮¿¡ »ó´ëÀûÀÎ</em> ÆÄÀÏ°æ·Î´Ù. Áï, (/·Î ½ÃÀÛÇÏ´Â)
Àý´ëÆÄÀÏ°æ·Î³ª °æ·Î ¾È¿¡ ../¸¦ »ç¿ëÇÒ ¼ö ¾ø´Ù. ¾Æ¸¶µµ ¼ºñ½ºÇÏ´Â
¹®¼ÀÇ »ó´ë URLÀ» ÁöÁ¤ÇÒ ¼ö ÀÖ´Â <code>virtual</code> attribute°¡
´õ À¯¿ëÇÒ °ÍÀÌ´Ù. °æ·Î¸¦ /·Î ½ÃÀÛÇÒ ¼ö ÀÖÁö¸¸, Æ÷ÇÔÇÏ·Á´Â
ÆÄÀÏÀÌ ¼ºñ½ºÇÏ´Â ÆÄÀÏ°ú °°Àº ¼¹ö¿¡ ÀÖ¾î¾ß ÇÑ´Ù.</p>
<example>
<!--#include virtual="/footer.html" -->
</example>
<p>³ª´Â º¸Åë ÀÌ µÎ°¡Áö¸¦ ÇÕÃļ Æ÷ÇÔÇÒ ÆäÀÌÁö ÇÏ´Ü ÆÄÀÏ¿¡
<code>LAST_MODIFIED</code> Áö½Ã¾î¸¦ ³Ö´Â´Ù. Æ÷ÇÔÇÏ·Á´Â ÆÄÀÏ¿¡µµ
SSI Áö½Ã¾î°¡ ³ª¿Ã ¼ö ÀÖÀ¸¸ç, ÀÌ·¸°Ô Æ÷ÇÔÇÑ ÆÄÀÏÀÌ ´Ù¸¥ ÆÄÀÏÀ»
Æ÷ÇÔÇÏ´Â ½ÄÀ¸·Î ¿©·¯¹ø °è¼Ó Æ÷ÇÔÇÒ ¼öµµ ÀÖ´Ù.</p>
</section>
</section>
<section id="config">
<title>ÀÌ¿Ü¿¡ ¼³Á¤ÇÒ ¼ö ÀÖ´Â °ÍÀº?</title>
<p>½Ã°£ Çü½Ä <code>config</code>(¼³Á¤) ¿Ü¿¡ µÎ°¡Áö¸¦ ´õ
<code>config</code>(¼³Á¤)ÇÒ ¼ö ÀÖ´Ù.</p>
<p>º¸Åë SSI Áö½Ã¾î°¡ À߸øµÇ¸é ´ÙÀ½°ú °°Àº ¹®±¸°¡ ³ª¿Â´Ù</p>
<example>
[an error occurred while processing this directive]
</example>
<p>ÀÌ ¹®±¸¸¦ º¯°æÇÏ°í ½Í´Ù¸é <code>config</code> elementÀÇ
<code>errmsg</code> attribute¸¦ »ç¿ëÇÏ¿© º¯°æÇÑ´Ù.</p>
<example>
<!--#config errmsg="[It appears that you don't know how to use SSI]" -->
</example>
<p>»çÀÌÆ®¸¦ ¼ºñ½ºÇϱâ Àü¿¡ ¸ðµç SSI Áö½Ã¾î ¹®Á¦¸¦ ÇØ°áÇÏ¿©
»ç¿ëÀÚ°¡ ÀÌ·± ¹®±¸¸¦ º¸Áö ¾Ê±æ ¹Ù¶õ´Ù. (±×·¸Áö?)</p>
<p>±×¸®°í <code>sizefmt</code> attribute°¡ ¹ÝȯÇÏ´Â ÆÄÀÏÅ©±â
Çü½ÄÀ» <code>config</code>(¼³Á¤)ÇÒ ¼ö ÀÖ´Ù. ¹ÙÀÌÆ®·Î Å©±â¸¦
º¸¿©ÁÖ·Á¸é <code>bytes</code>, ÀûÀýÈ÷ Kb³ª Mb·Î Å©±â¸¦
º¸¿©ÁÖ·Á¸é <code>abbrev</code>¸¦ »ç¿ëÇÑ´Ù.</p>
</section>
<section id="exec">
<title>¸í·É¾î ½ÇÇàÇϱâ</title>
<p>³ª´Â ´ÙÀ½ ´Þ¿¡ ÀÛÀº CGI ÇÁ·Î±×·¥°ú SSI¸¦ °°ÀÌ »ç¿ëÇÏ´Â
±ÛÀ» ¾µ ¿¹Á¤ÀÌ´Ù. Áö±ÝÀº <code>exec</code> element·Î ÇÒ
¼ö ÀÖ´Â ´Ù¸¥ °ÍµéÀ» ¼³¸íÇÒ °ÍÀÌ´Ù. SSI´Â ½ÇÁ¦ ½©À» (Á¤È®È÷´Â
<code>/bin/sh</code>³ª Win32¸¦ »ç¿ëÇÑ´Ù¸é DOS ½©) »ç¿ëÇÏ¿©
¸í·É¾î¸¦ ½ÇÇàÇÑ´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½Àº µð·ºÅ丮 ¸ñ·ÏÀ» º¸¿©ÁØ´Ù.</p>
<example>
<pre><br />
<!--#exec cmd="ls" --><br />
</pre>
</example>
<p>or, on Windows</p>
<example>
<pre><br />
<!--#exec cmd="dir" --><br />
</pre>
</example>
<p><code>dir</code> Ãâ·Â¿¡ ºê¶ó¿ìÀú°¡ È¥µ¿ÇÒ
``<<code>dir</code>>'' ¹®ÀÚ¿ÀÌ Æ÷ÇÔµÇÀֱ⶧¹®¿¡,
À©µµ¿ìÁî¿¡¼ ÀÌ Áö½Ã¾î¸¦ »ç¿ëÇÏ¸é °á°ú°¡ Á¶±Ý ÀÌ»óÇÒ °ÍÀÌ´Ù.</p>
<p>ÀÌ ±â´ÉÀº <code>exec</code> ű׿¡ »ç¿ëÇÑ ¾î¶² ¸í·É¾î¶óµµ
½ÇÇàÇÒ ¼ö Àֱ⶧¹®¿¡ ¸Å¿ì À§ÇèÇÏ´Ù. ``¹æ¸í·Ï''°ú °°ÀÌ »ç¿ëÀÚ°¡
À¥ÆäÀÌÁö ³»¿ëÀ» ¼öÁ¤ÇÒ ¼ö Àִ ȯ°æÀ̶ó¸é, ÀÌ ±â´ÉÀ» Àý´ë·Î
»ç¿ëÇؼ± ¾ÈµÈ´Ù. <code>Options</code> Áö½Ã¾î¿¡
<code>IncludesNOEXEC</code> ¾Æ±Ô¸ÕÆ®¸¦ »ç¿ëÇÏ¿© SSI¸¦ Çã¿ëÇÏÁö¸¸
<code>exec</code> ±â´ÉÀ» ¸·À» ¼ö ÀÖ´Ù.</p>
</section>
<section id="advanced">
<title>°í±Þ SSI ±â¹ý</title>
<p>³»¿ëÀ» Ãâ·ÂÇÏ´Â ±â´É ¿Ü¿¡ ¾ÆÆÄÄ¡ SSI´Â º¯¼ö ¼³Á¤ÀÌ °¡´ÉÇÏ°í,
ºñ±³¹®°ú Á¶°Ç¹®¿¡ ÀÌ º¯¼ö¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.</p>
<section id="caveat"><title>°æ°í</title>
<p>ÀÌ ±Û¿¡¼ ¼³¸íÇÏ´Â ´ëºÎºÐÀÇ ±â´ÉÀº ¾ÆÆÄÄ¡ 1.2 ÀÌÈĺÎÅÍ
»ç¿ëÇÒ ¼ö ÀÖ´Ù. ¹°·Ð, ¾ÆÆÄÄ¡ 1.2 ÀÌ»óÀ» »ç¿ëÇÏÁö ¾Ê´Â´Ù¸é
¾Æ¸¶µµ »¡¸® ¾÷±×·¹À̵åÇØ¾ß ÇÑ´Ù. Çضó. Áö±Ý Çضó. ±â´Ù¸±
°ÍÀÌ´Ù.</p>
</section>
<section id="variables"><title>º¯¼ö ¼³Á¤</title>
<p><code>set</code> Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© ³ªÁß¿¡ »ç¿ëÇÒ º¯¼ö¸¦
¼³Á¤ÇÒ ¼ö ÀÖ´Ù. ¾ÕÀ¸·Î º¯¼ö°¡ ÇÊ¿äÇϱ⶧¹®¿¡ ¸ÕÀú ¼³¸íÇÑ´Ù.
¹®¹ýÀº ´ÙÀ½°ú °°´Ù.</p>
<example>
<!--#set var="name" value="Rich" -->
</example>
<p>´ÙÀ½°ú °°ÀÌ °ªÀ» ¹®ÀÚ±×´ë·Î ¼³Á¤ÇÏÁö ¾Ê°í <a
href="../env.html">ȯ°æº¯¼ö</a>³ª À§¿¡¼ ¼³¸íÇÑ º¯¼ö(¿¹¸¦
µé¾î, <code>LAST_MODIFIED</code>)¿Í °°ÀÌ ´Ù¸¥ º¯¼ö¸¦ »ç¿ëÇÏ¿©
º¯¼ö°ªÀ» ¼³Á¤ÇÒ ¼öµµ ÀÖ´Ù. À̶§ º¯¼ö¸í ¾Õ¿¡ ´Þ·¯ Ç¥½Ã($)¸¦
ºÙ¿©¼ ¹®ÀÚ¿ÀÌ ¾Æ´Ñ º¯¼öÀÓÀ» Ç¥½ÃÇÑ´Ù.</p>
<example> <!--#set var="modified" value="$LAST_MODIFIED" -->
</example>
<p>º¯¼ö°ª¿¡ ´Þ·¯ ¹®ÀÚ¸¦ ±×´ë·Î ÀÔ·ÂÇÏ·Á¸é ´Þ·¯ Ç¥½Ã ¾Õ¿¡
¹é½½·¡½¬¸¦ »ç¿ëÇÑ´Ù.</p>
<example>
<!--#set var="cost" value="\$100" -->
</example>
<p>¸¶Áö¸·À¸·Î ±ä ¹®ÀÚ¿ Áß°£¿¡ º¯¼ö¸¦ »ç¿ëÇϴµ¥ µÚ¿¡ ÀÖ´Â
¹®ÀÚµµ º¯¼ö¸íÀ¸·Î ¿ÀÀÎÇÏ¿© È¥µ¿µÇ´Â °æ¿ì, º¯¼ö¸íÀ» ´ë°ýÈ£·Î
¹¾î¼ È®½ÇÈ÷ ÇÑ´Ù. (ÁÁÀº ¿¹¸¦ ã±â ÈûµéÁö¸¸, ¹«½¼ ¸»ÀÎÁö
ÀÌÇØÇÏ±æ ¹Ù¶õ´Ù.)</p>
<example>
<!--#set var="date" value="${DATE_LOCAL}_${DATE_GMT}" -->
</example>
</section>
<section id="conditional">
<title>Á¶°Ç Ç¥Çö½Ä</title>
<p>º¯¼ö¸¦ ¼³Á¤ÇÏ°í ºñ±³ÇÒ ¼ö ÀÖÀ¸´Ï Á¶°Ç¹®ÀÌ °¡´ÉÇÏ´Ù. ÀÌÁ¦
SSI°¡ ÀÏÁ¾ÀÇ °£´ÜÇÑ ÇÁ·Î±×·¡¹Ö¾ð¾î°¡ µÈ´Ù.
<module>mod_include</module>´Â Á¶°Ç¹®À» ¸¸µå´Â <code>if</code>,
<code>elif</code>, <code>else</code>, <code>endif</code>
±¸Á¶¸¦ Á¦°øÇÑ´Ù. ½ÇÁ¦ ÇÑ ÆäÀÌÁö·Î ¿©·¯ ³í¸®ÀûÀÎ ÆäÀÌÁö¸¦
¸¸µé ¼ö ÀÖ´Ù.</p>
<p>Á¶°Ç¹® ±¸Á¶´Â ´ÙÀ½°ú °°´Ù.</p>
<example>
<!--#if expr="test_condition" --><br />
<!--#elif expr="test_condition" --><br />
<!--#else --><br />
<!--#endif -->
</example>
<p><em>test_condition</em>¿¡´Â ¾î¶² ³í¸®ºñ±³¶óµµ »ç¿ëÇÒ
¼ö ÀÖ´Ù. °ªÀ» ´Ù¸¥ °ª°ú ºñ±³Çϰųª, ƯÁ¤ °ªÀÌ ``Âü''ÀÎÁö
°Ë»çÇÑ´Ù. (¹®ÀÚ¿ÀÌ ºñ¾îÀÖÁö ¾ÊÀ¸¸é ÂüÀÌ´Ù.) »ç¿ë°¡´ÉÇÑ
ºñ±³ ¿¬»êÀÚ¸¦ ¸ðµÎ º¸·Á¸é, <module>mod_include</module>
¹®¼¸¦ Âü°íÇ϶ó. ´ÙÀ½Àº Á¶°Ç¹®À» »ç¿ëÇÑ ¸î°¡Áö ¿¹Á¦´Ù.</p>
<p>¼³Á¤ÆÄÀÏ¿¡ ´ÙÀ½ ÁÙÀ» Ãß°¡ÇÑ´Ù.</p>
<example>
BrowserMatchNoCase macintosh Mac<br />
BrowserMatchNoCase MSIE InternetExplorer
</example>
<p>Ŭ¶óÀ̾ðÆ®°¡ ¸ÆŲÅä½Ã¿¡¼ ½ÇÇàÇÏ´Â Internet Explorer¶ó¸é
ȯ°æº¯¼ö ``Mac''°ú ``InternetExplorer'' ¸ðµÎ ÂüÀ¸·Î ¼³Á¤ÇÑ´Ù.</p>
<p>±×¸®°í SSI ¹®¼¿¡ ´ÙÀ½°ú °°ÀÌ Àû´Â´Ù.</p>
<example>
<!--#if expr="${Mac} && ${InternetExplorer}" --><br />
¿©±â¿¡ »ç°ú¹®°¡ ³ª¿Â´Ù<br />
<!--#else --><br />
¿©±â¿¡ ¸ÚÁø JavaScript Äڵ尡 ³ª¿Â´Ù<br />
<!--#endif -->
</example>
<p>³»°¡ ¸ÅŲÅä½Ã IE¿¡ ¹Ý°¨ÀÌ ÀÖ´Â °ÍÀº ¾Æ´Ï´Ù. ³ª´Â ´ÜÁö
Àú¹øÁÖ¿¡ ´Ù¸¥ °÷¿¡¼´Â ¹®Á¦°¡ ¾ø´Â JavaScript Äڵ尡 ¸ÅŲÅä½Ã
IE¿¡¼´Â µ¿ÀÛÇÏÁö ¾Ê¾Æ¼ ¸î½Ã°£À» °í»ýÇß´Ù. À§´Â ÀÓ½Ã
ÇØ°áÃ¥ÀÌ´Ù.</p>
<p>(Á÷Á¢ Á¤ÀÇÇÏ¿´°Ç ÀÏ¹Ý È¯°æº¯¼öÀÌ°Ç) ¾î¶² º¯¼ö¶óµµ Á¶°Ç¹®¿¡
»ç¿ëÇÒ ¼ö ÀÖ´Ù. ¾Æ¶óÄ¡´Â <code>SetEnvIf</code>³ª ´Ù¸¥ °ü·Ã
Áö½Ã¾î·Î ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÒ ¼ö Àֱ⶧¹®¿¡ CGI ¾øÀ̵µ ¸ÚÁö°Ô
µ¿ÀûÀÎ ³»¿ëÀ» ¸¸µé ¼ö ÀÖ´Ù.</p>
</section>
</section>
<section id="conclusion"><title>°á·Ð</title>
<p>SSI´Â È®½ÇÈ÷ CGI³ª µ¿ÀûÀÎ À¥ÆäÀÌÁö¸¦ »ý¼ºÇÏ´Â ´Ù¸¥ ±â¼úÀ»
´ëüÇÒ ¼ö ¾ø´Ù. ±×·¯³ª ¸¹Àº Ãß°¡ ÀÛ¾÷¾øÀÌ ÆäÀÌÁö¿¡ µ¿ÀûÀÎ
³»¿ëÀ» Á¶±Ý Ãß°¡Çϱ⿡´Â ÈǸ¢ÇÑ ¹æ¹ýÀÌ´Ù.</p>
</section>
</manualpage>
|