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
429
|
<?xml version="1.0" encoding="EUC-KR"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"><head><!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-->
<title>´ë·®ÀÇ °¡»óÈ£½ºÆ®¸¦ µ¿ÀûÀ¸·Î ¼³Á¤Çϱâ - Apache HTTP Server</title>
<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/">¸ðµâ</a> | <a href="../mod/directives.html">Áö½Ã¾îµé</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">¿ë¾î</a> | <a href="../sitemap.html">»çÀÌÆ®¸Ê</a></p>
<p class="apache">Apache HTTP Server Version 2.3</p>
<img alt="" src="../images/feather.gif" /></div>
<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
<div id="path">
<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.3</a> > <a href="./">°¡»óÈ£½ºÆ®</a></div><div id="page-content"><div id="preamble"><h1>´ë·®ÀÇ °¡»óÈ£½ºÆ®¸¦ µ¿ÀûÀ¸·Î ¼³Á¤Çϱâ</h1>
<div class="toplang">
<p><span>°¡´ÉÇÑ ¾ð¾î: </span><a href="../en/vhosts/mass.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/vhosts/mass.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
<a href="../ko/vhosts/mass.html" title="Korean"> ko </a> |
<a href="../tr/vhosts/mass.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a> |
<a href="../zh-cn/vhosts/mass.html" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p>
</div>
<div class="outofdate">ÀÌ ¹®¼´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù.
ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼¸¦ Âü°íÇϼ¼¿ä.</div>
<p>ÀÌ ¹®¼´Â ¾ÆÆÄÄ¡ 1.3¿¡¼ ´ë·®ÀÇ °¡»óÈ£½ºÆ®¸¦ È¿À²ÀûÀ¸·Î
¼ºñ½ºÇÏ´Â ¹æ¹ýÀ» ¼³¸íÇÑ´Ù.
</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#motivation">µ¿±â</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#overview">°³¿ä</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#simple">°£´ÜÇÑ µ¿Àû °¡»óÈ£½ºÆ®</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#homepages">°¡»óÀ¸·Î È£½ºÆ®Çϴ ȨÆäÀÌÁö ½Ã½ºÅÛ</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#combinations">ÇÑ ¼¹ö¿¡ ¿©·¯ °¡»óÈ£½ºÆ®
½Ã½ºÅÛ »ç¿ëÇϱâ</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#ipbased">´õ È¿À²ÀûÀÎ IP±â¹Ý °¡»óÈ£½ºÆ®</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#oldversion">¾ÆÆÄÄ¡ ÀÌÀü ¹öÀü »ç¿ëÇϱâ</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#simple.rewrite"><code>mod_rewrite</code>¸¦
»ç¿ëÇÑ °£´ÜÇÑ µ¿Àû °¡»óÈ£½ºÆ®</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#homepages.rewrite"><code>mod_rewrite</code>¸¦
»ç¿ëÇÑ È¨ÆäÀÌÁö ½Ã½ºÅÛ</a></li>
<li><img alt="" src="../images/down.gif" /> <a href="#xtra-conf">º°µµÀÇ °¡»óÈ£½ºÆ® ¼³Á¤ÆÄÀÏ
»ç¿ëÇϱâ</a></li>
</ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="motivation" id="motivation">µ¿±â</a></h2>
<p>´ç½ÅÀÇ <code>httpd.conf</code>¿¡ ´ÙÀ½°ú °°ÀÌ ¼·Î ºñ½ÁÇÑ
<code><VirtualHost></code> ¼½¼ÇµéÀ» ¸¹ÀÌ ÀÖ´Ù¸é ¿©±â¼
¼³¸íÇÏ´Â ¹æ¹ýÀÌ µµ¿òÀÌ µÉ °ÍÀÌ´Ù:</p>
<div class="example"><p><code>
NameVirtualHost 111.22.33.44<br />
<VirtualHost 111.22.33.44><br />
<span class="indent">
ServerName www.customer-1.com<br />
DocumentRoot /www/hosts/www.customer-1.com/docs<br />
ScriptAlias /cgi-bin/ /www/hosts/www.customer-1.com/cgi-bin<br />
</span>
</VirtualHost><br />
<VirtualHost 111.22.33.44><br />
<span class="indent">
ServerName www.customer-2.com<br />
DocumentRoot /www/hosts/www.customer-2.com/docs<br />
ScriptAlias /cgi-bin/ /www/hosts/www.customer-2.com/cgi-bin<br />
</span>
</VirtualHost><br />
# ¹Ùº¸ ¹Ùº¸ ¹Ùº¸<br />
<VirtualHost 111.22.33.44><br />
<span class="indent">
ServerName www.customer-N.com<br />
DocumentRoot /www/hosts/www.customer-N.com/docs<br />
ScriptAlias /cgi-bin/ /www/hosts/www.customer-N.com/cgi-bin<br />
</span>
</VirtualHost>
</code></p></div>
<p>±âº» °³³äÀº Á¤ÀûÀÎ <code><VirtualHost></code>
¼³Á¤ ¸ðµÎ¸¦ µ¿ÀûÀ¸·Î ó¸®Çϵµ·Ï ´ëüÇÏ´Â °ÍÀÌ´Ù.
±×·¯¸é ¸¹Àº ÀåÁ¡ÀÌ ÀÖ´Ù:</p>
<ol>
<li>¼³Á¤ÆÄÀÏÀÌ ÀÛ¾ÆÁ®¼ ¾ÆÆÄÄ¡°¡ »¡¸® ½ÃÀÛÇÏ°í ¸Þ¸ð¸®¸¦
Àû°Ô »ç¿ëÇÑ´Ù.</li>
<li>°¡»óÈ£½ºÆ®¸¦ Ãß°¡ÇϱâÀ§ÇØ ÆÄÀϽýºÅÛ¿¡ Àû´çÇÑ
µð·ºÅ丮¸¦ ¸¸µé°í DNS¿¡ Ç׸ñÀ» Ãß°¡Çϱ⸸ ÇϸéµÈ´Ù. Áï,
¾ÆÆÄÄ¡¸¦ Àç¼³Á¤ÇÏ°í Àç½ÃÀÛÇÒ ÇÊ¿ä°¡ ¾ø´Ù.</li>
</ol>
<p>´ÜÁ¡Àº °¢ °¡»óÈ£½ºÆ®º°·Î ´Ù¸¥ ·Î±×ÆÄÀÏÀ» »ç¿ëÇÒ ¼ö ¾ø´Ù´Â
Á¡ÀÌ´Ù. ±×·¯³ª ¸Å¿ì ¸¹Àº °¡»óÈ£½ºÆ®¸¦ »ç¿ëÇÑ´Ù¸é ÆÄÀϱâ¼úÀÚ¸¦
´Ù ½á¹ö¸®±â¶§¹®¿¡ ¼·Î ´Ù¸¥ ·Î±×ÆÄÀÏÀ» »ç¿ëÇÒ ¼ö ¾ø´Ù. ÆÄÀÌÇÁ³ª
fifo·Î ·Î±×¸¦ º¸³»°í, ¹Þ´Â Æí¿¡¼ ·Î±×¸¦ ó¸®ÇÏ¿© ³ª´©´Â
¹æ¹ýÀÌ (Åë°è µîÀ» ¸ðÀ» ¼öµµ ÀÖ´Ù) ´õ ³´´Ù.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="overview" id="overview">°³¿ä</a></h2>
<p>°¡»óÈ£½ºÆ®´Â IP ÁÖ¼Ò¿Í HTTP ¿äûÀÇ <code>Host:</code>
Çì´õ Á¤º¸·Î Á¤ÀÇÇÑ´Ù. ±âº»ÀûÀ¸·Î ´ë·®ÀÇ
µ¿Àû °¡»óÈ£½ºÆ® ±â¼úÀº ÀÚµ¿À¸·Î °¡»óÈ£½ºÆ® Á¤º¸¸¦ ¿äûÀÇ
ÆÄÀÏ°æ·Î¿¡ Æ÷ÇÔÇÑ´Ù. ÀÌ´Â ´ëºÎºÐ <code class="module"><a href="../mod/mod_vhost_alias.html">mod_vhost_alias</a></code>¸¦
»ç¿ëÇÏ¿© ½±°Ô ÇØ°áÇÒ ¼ö ÀÖÁö¸¸, ¾ÆÆÄÄ¡ 1.3.6 ÀÌÇϸ¦ »ç¿ëÇÑ´Ù¸é
<code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>¸¦ »ç¿ëÇØ¾ß ÇÑ´Ù. ÀÌ µÎ ¸ðµâ
¸ðµÎ ±âº»ÀûÀ¸·Î ¼¹ö¿¡ Æ÷ÇÔµÇÁö ¾Ê´Â´Ù. ÀÌ ¹æ¹ýÀ» »ç¿ëÇÏ·Á¸é
¾ÆÆÄÄ¡¸¦ ±¸¼ºÇÏ°í ÄÄÆÄÀÏÇÒ¶§ Æ÷ÇÔÇØ¾ß ÇÑ´Ù.</p>
<p>µ¿Àû °¡»óÈ£½ºÆ®¸¦ ÀϹÝÀûÀÎ °¡»óÈ£½ºÆ®Ã³·³ º¸ÀÌ°ÔÇÏ·Á¸é
¿©·¯°¡Áö¸¦ `¼Ó¿©¾ß' ÇÑ´Ù. °¡Àå Áß¿äÇÑ °ÍÀº ¾ÆÆÄÄ¡°¡ ÀÚ±âÂüÁ¶
URL µîÀ» ¸¸µé¶§ »ç¿ëÇÒ ¼¹ö¸íÀÌ´Ù. ¼¹ö¸íÀº
<code>ServerName</code> Áö½Ã¾î·Î ¼³Á¤Çϸç, CGI¿¡´Â
<code>SERVER_NAME</code> ȯ°æº¯¼ö·Î ÁÖ¾îÁø´Ù. ½ÇÇàÁß ½ÇÁ¦
¼¹ö¸íÀº <code class="directive"><a href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code> ¼³Á¤¿¡ ´Þ·È´Ù.
<code>UseCanonicalName Off</code>ÀÌ¸é ¿äûÀÇ <code>Host:</code>
Çì´õ ³»¿ëÀÌ ¼¹ö¸íÀÌ µÈ´Ù. <code>UseCanonicalName DNS</code>À̸é
°¡»óÈ£½ºÆ®ÀÇ IP ÁÖ¼Ò¸¦ ¿ªDNS °Ë»öÇÏ¿© ¼¹ö¸íÀ» ¾Ë¾Æ³½´Ù.
ÀüÀÚ´Â À̸§±â¹Ý µ¿Àû °¡»óÈ£½ºÆ®¿¡¼ »ç¿ëÇÏ°í, ÈÄÀÚ´Â IP±â¹Ý
°¡»óÈ£½ºÆ®¿¡¼ »ç¿ëÇÑ´Ù. <code>Host:</code> Çì´õ°¡ ¾ø°Å³ª
DNS °Ë»öÀÌ ½ÇÆÐÇÏ¿© ¾ÆÆÄÄ¡°¡ ¼¹ö¸íÀ» ¾Ë¾Æ³»Áö ¸øÇϸé
<code>ServerName</code>À¸·Î ¼³Á¤ÇÑ °ªÀ» ´ë½Å »ç¿ëÇÑ´Ù.</p>
<p>´Ù¸¥ `¼ÓÀÏ' °ÍÀº (<code>DocumentRoot</code>·Î ¼³Á¤Çϸç,
CGI¿¡´Â <code>DOCUMENT_ROOT</code> ȯ°æº¯¼ö·Î ÁÖ¾îÁö´Â)
¹®¼·çÆ®ÀÌ´Ù. ÀϹÝÀûÀÎ °æ¿ì core ¸ðµâÀÌ ÀÌ ¼³Á¤À» »ç¿ëÇÏ¿©
URI¿¡ ÇØ´çÇÏ´Â ÆÄÀϸíÀ» ãÁö¸¸, ¼¹ö¸¦ µ¿Àû °¡»óÈ£½ºÆÃÀ» ÇÒ¶§´Â ´Ù¸¥
¸ðµâÀÌ (<code>mod_vhost_alias</code>³ª <code>mod_rewrite</code>)
´Ù¸¥ ¹æ¹ýÀ¸·Î ÀÌ·± ÀÛ¾÷À» ÇÑ´Ù. µÎ ¸ðµâ ¸ðµÎ
<code>DOCUMENT_ROOT</code> ȯ°æº¯¼ö¸¦ »ç¿ëÇÏÁö ¾ÊÀ¸¹Ç·Î
CGI³ª SSI ¹®¼°¡ ÀÌ °ªÀ» »ç¿ëÇÑ´Ù¸é À߸øµÈ °á°ú¸¦ ¾òÀ» ¼ö
ÀÖ´Ù.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="simple" id="simple">°£´ÜÇÑ µ¿Àû °¡»óÈ£½ºÆ®</a></h2>
<p>À§ <a href="#motivation">µ¿±â</a> ÀýÀÇ °¡»óÈ£½ºÆ®
¼³Á¤À» <code>mod_vhost_alias</code>¸¦ »ç¿ëÇÏ¿© ´õ ÀϹÝÀûÀ¸·Î
±¸ÇöÇß´Ù.</p>
<div class="example"><p><code>
# Host: Çì´õ¿¡¼ ¼¹ö¸íÀ» ¾Ë¾Æ³½´Ù<br />
UseCanonicalName Off<br />
<br />
# ù¹ø° Çʵ带 »ç¿ëÇÏ¿© ÀÌ ·Î±×¸¦ °¡»óÈ£½ºÆ®º°·Î ³ª´ ¼ö ÀÖ´Ù<br />
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon<br />
CustomLog logs/access_log vcommon<br />
<br />
# ¿äûÀ» ó¸®ÇϱâÀ§ÇØ ÆÄÀÏ¸í¿¡ ¼¹ö¸íÀ» Æ÷ÇÔÇÑ´Ù<br />
VirtualDocumentRoot /www/hosts/%0/docs<br />
VirtualScriptAlias /www/hosts/%0/cgi-bin
</code></p></div>
<p>ÀÌ ¼³Á¤¿¡¼ <code>UseCanonicalName Off</code>¸¦
<code>UseCanonicalName DNS</code>·Î º¯°æÇϱ⸸ Çϸé IP±â¹Ý
°¡»óÈ£½ºÆ®°¡ µÈ´Ù. °¡»óÈ£½ºÆ®ÀÇ IP ÁÖ¼Ò¸¦ °¡Áö°í
ÆÄÀÏ¸í¿¡ Ãß°¡ÇÒ ¼¹ö¸íÀ» ¾Ë ¼ö ÀÖ´Ù.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="homepages" id="homepages">°¡»óÀ¸·Î È£½ºÆ®Çϴ ȨÆäÀÌÁö ½Ã½ºÅÛ</a></h2>
<p>ISP ȨÆäÀÌÁö ¼¹ö¸¦ À§ÇØ À§ÀÇ ¼³Á¤À» ¼öÁ¤Çß´Ù. Á¶±Ý ´õ
º¹ÀâÇÑ ¼³Á¤À» »ç¿ëÇϸé <code>www.user.isp.com</code>ÀÇ ¹®¼¸¦
<code>/home/user/</code>¿¡ µÎ´Â ½ÄÀ¸·Î ¼¹ö¸íÀÇ ÀϺθ¦ °¡Áö°í
ÆÄÀϸíÀ» ¸¸µé ¼ö ÀÖ´Ù. ÀÌ ¼³Á¤Àº
<code>cgi-bin</code>À» °¢ °¡»óÈ£½ºÆ®°¡ µû·Î °¡ÁöÁö¾Ê°í
¸ðµç °¡»óÈ£½ºÆ®°¡ °°ÀÌ »ç¿ëÇÑ´Ù.</p>
<div class="example"><p><code>
# ±âº»ÀûÀÎ ³»¿ëÀº À§¿Í °°´Ù. ±×¸®°í<br />
<br />
# ÆÄÀÏ¸í¿¡ ¼¹ö¸íÀÇ ÀϺθ¦ Æ÷ÇÔÇÑ´Ù<br />
VirtualDocumentRoot /www/hosts/%2/docs<br />
<br />
# ÇϳªÀÇ cgi-bin µð·ºÅ丮<br />
ScriptAlias /cgi-bin/ /www/std-cgi/<br />
</code></p></div>
<p><code class="module"><a href="../mod/mod_vhost_alias.html">mod_vhost_alias</a></code> ¹®¼¿¡´Â ´õ º¹ÀâÇÑ
<code>VirtualDocumentRoot</code> ¼³Á¤ÀÇ ¿¹°¡ ÀÖ´Ù.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="combinations" id="combinations">ÇÑ ¼¹ö¿¡ ¿©·¯ °¡»óÈ£½ºÆ®
½Ã½ºÅÛ »ç¿ëÇϱâ</a></h2>
<p>´õ º¹ÀâÇÑ ¼³Á¤ÀÇ ¿¹·Î ¾ÆÆÄÄ¡ÀÇ ÀϹÝÀûÀÎ
<code><VirtualHost></code> Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© ¿©·¯
°¡»óÈ£½ºÆ® ¼³Á¤ÀÇ ¹üÀ§¸¦ Á¶ÀýÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½°ú
°°Àº ¼³Á¤Àº ȨÆäÀÌÁö °í°´¿¡ IP ÁÖ¼Ò ÇÑ°³, »ó¾÷ÀûÀÎ
°í°´¿¡°Ô ´Ù¸¥ IP ÁÖ¼Ò ÇÑ°³¸¦ ºÎ¿©ÇÑ´Ù. ¹°·Ð ÀÌÀüó·³
<code><VirtualHost></code> ¼³Á¤ ¼½¼Ç¿¡ ¸ðµÎ ¹À» ¼öµµ
ÀÖ´Ù.</p>
<div class="example"><p><code>
UseCanonicalName Off<br />
<br />
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon<br />
<br />
<Directory /www/commercial><br />
<span class="indent">
Options FollowSymLinks<br />
AllowOverride All<br />
</span>
</Directory><br />
<br />
<Directory /www/homepages><br />
<span class="indent">
Options FollowSymLinks<br />
AllowOverride None<br />
</span>
</Directory><br />
<br />
<VirtualHost 111.22.33.44><br />
<span class="indent">
ServerName www.commercial.isp.com<br />
<br />
CustomLog logs/access_log.commercial vcommon<br />
<br />
VirtualDocumentRoot /www/commercial/%0/docs<br />
VirtualScriptAlias /www/commercial/%0/cgi-bin<br />
</span>
</VirtualHost><br />
<br />
<VirtualHost 111.22.33.45><br />
<span class="indent">
ServerName www.homepages.isp.com<br />
<br />
CustomLog logs/access_log.homepages vcommon<br />
<br />
VirtualDocumentRoot /www/homepages/%0/docs<br />
ScriptAlias /cgi-bin/ /www/std-cgi/<br />
</span>
</VirtualHost>
</code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="ipbased" id="ipbased">´õ È¿À²ÀûÀÎ IP±â¹Ý °¡»óÈ£½ºÆ®</a></h2>
<p><a href="#simple">ù¹ø° ¿¹</a>¿¡¼ ³ª´Â ¼³Á¤À» °£´ÜÈ÷
IP±â¹Ý °¡»óÈ£½ºÆ®·Î ¹Ù²Ü ¼ö ÀÖ´Ù°í ¸»Çß´Ù. ºÒÇàÈ÷µµ
±×·± ¼³Á¤Àº ¸Å ¿äû¸¶´Ù DNS¸¦ ã¾Æ¾ßÇϹǷΠ¸Å¿ì ºñÈ¿À²ÀûÀÌ´Ù.
À̸§´ë½Å IP ÁÖ¼Ò·Î ÆÄÀϽýºÅÛÀ» ±¸¼ºÇÏ°í °°Àº ¹æ½ÄÀ¸·Î
·Î±×¸¦ ¼öÁ¤ÇÏ¸é ¹®Á¦¸¦ ÇØ°áÇÒ ¼ö ÀÖ´Ù. ¾ÆÆÄÄ¡´Â ¼¹ö¸íÀ»
´Ù·ê ÇÊ¿ä°¡ ¾ø¾îÁö°í, DNS °Ë»öµµ ÇÏÁö ¾Ê°Ô µÈ´Ù.</p>
<div class="example"><p><code>
# IP ÁÖ¼Ò¸¦ ¿ªDNS °Ë»öÇÏ¿© ¼¹ö¸íÀ» ¾Ë¾Æ³½´Ù<br />
UseCanonicalName DNS<br />
<br />
# ·Î±×¸¦ ³ª´ ¼ö ÀÖµµ·Ï IP ÁÖ¼Ò¸¦ Æ÷ÇÔÇÑ´Ù<br />
LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon<br />
CustomLog logs/access_log vcommon<br />
<br />
# ÆÄÀÏ¸í¿¡ IP ÁÖ¼Ò¸¦ Æ÷ÇÔÇÑ´Ù<br />
VirtualDocumentRootIP /www/hosts/%0/docs<br />
VirtualScriptAliasIP /www/hosts/%0/cgi-bin<br />
</code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="oldversion" id="oldversion">¾ÆÆÄÄ¡ ÀÌÀü ¹öÀü »ç¿ëÇϱâ</a></h2>
<p>À§ ¿¹µéÀº ¾ÆÆÄÄ¡ ¹öÀü 1.3.6 ÀÌÈÄ¿¡ Æ÷ÇÔµÈ
<code>mod_vhost_alias</code>À» »ç¿ëÇÑ´Ù.
<code>mod_vhost_alias</code>°¡ ¾ø´Â ¾ÆÆÄÄ¡ ¹öÀüÀ» »ç¿ëÇÑ´Ù¸é
ÀÌ¹Ì ¸»ÇßµíÀÌ <code>mod_rewrite</code>¸¦ »ç¿ëÇÏ¿©, ´Ü
Host:-Çì´õ±â¹Ý °¡»óÈ£½ºÆ®¸¸À», ±¸ÇöÇÒ ¼ö ÀÖ´Ù.</p>
<p>¶Ç ·Î±×¿¡ °üÇÏ¿© ÁÖÀÇÇÒ Á¡ÀÌ ÀÖ´Ù. ¾ÆÆÄÄ¡ 1.3.6¿¡¼
·Î±×Çü½Ä Áö½Ã¾î <code>%V</code>°¡ Æ÷ÇԵǾú°í, ¹öÀü 1.3.0
- 1.3.3¿¡¼ ÀÌ ±â´ÉÀ» <code>%v</code> ¿É¼ÇÀÌ ´ë½Å Çß´Ù. ±×·¯³ª
¹öÀü 1.3.4¿¡´Â ÀÌ·± ±â´ÉÀÌ ¾ø´Ù. ¾î¶² ¾ÆÆÄÄ¡ ¹öÀü¿¡¼µµ
<code>.htaccess</code> ÆÄÀÏ¿¡¼ <code>UseCanonicalName</code>
Áö½Ã¾î¸¦ »ç¿ëÇÒ ¼ö ÀÖÀ¸¹Ç·Î ·Î±×¿¡ ÀÌ»óÇÑ ³»¿ëÀÌ ±â·ÏµÉ ¼ö ÀÖ´Ù.
±×·¯¹Ç·Î °¡Àå ÁÁÀº ¹æ¹ýÀº <code>%{Host}i</code> Áö½Ã¾î¸¦
»ç¿ëÇÏ¿© <code>Host:</code> Çì´õ¸¦ Á÷Á¢ ·Î±×¿¡ ³²±â´Â °ÍÀÌ´Ù.
¶Ç, ÀÌ ¹æ¹ýÀº <code>%V</code>´Â Æ÷ÇÔÇÏÁö¾Ê´Â <code>:port</code>¸¦
µÚ¿¡ Ãß°¡ÇÒ ¼ö ÀÖ´Ù.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="simple.rewrite" id="simple.rewrite"><code>mod_rewrite</code>¸¦
»ç¿ëÇÑ °£´ÜÇÑ µ¿Àû °¡»óÈ£½ºÆ®</a></h2>
<p>´ÙÀ½Àº <a href="#simple">ù¹ø° ¿¹</a>¿Í °°Àº ÀÏÀ» ÇÏ´Â
<code>httpd.conf</code> ¿¹ÀÌ´Ù. óÀ½ Àý¹ÝÀº ù¹ø° ¿¹¿Í
°ÅÀÇ ºñ½ÁÇÏÁö¸¸, ÀÌÀü ¹öÀü°úÀÇ È£È¯¼º°ú <code>mod_rewrite</code>ÀÇ
ÀûÀýÇÑ µ¿ÀÛÀ» À§ÇØ ¼öÁ¤µÇ¾ú´Ù. ³ª¸ÓÁö Àý¹ÝÀº ½ÇÁ¦ ÀÛ¾÷À»
ÇÏ´Â <code>mod_rewrite</code>¸¦ ¼³Á¤ÇÑ´Ù.</p>
<p>Ưº°È÷ ÁÖÀÇÇØ¾ß ÇÒ »çÇ×ÀÌ ÀÖ´Ù. ±âº»ÀûÀ¸·Î
<code>mod_rewrite</code>´Â (<code>mod_alias</code> µî) ´Ù¸¥
URI ¹ø¿ª ¸ðµâ ÀÌÀü¿¡ ½ÇÇàµÈ´Ù. ±×·¡¼ ´Ù¸¥ URI ¹ø¿ª ¸ðµâµé°ú
°°ÀÌ µ¿ÀÛÇÒ °ÍÀ» °í·ÁÇÏ¿© <code>mod_rewrite</code>¸¦ ¼³Á¤ÇØ¾ß ÇÑ´Ù.
¶Ç, µ¿Àû °¡»óÈ£½ºÆ®¿¡¼ <code>ScriptAlias</code>°ú °°Àº
±â´ÉÀ» À§Çؼ´Â Ưº°ÇÑ ÀÛ¾÷ÀÌ ÇÊ¿äÇÏ´Ù.</p>
<div class="example"><p><code>
# Host: Çì´õ¿¡¼ ¼¹ö¸íÀ» ¾ò´Â´Ù<br />
UseCanonicalName Off<br />
<br />
# splittable logs<br />
LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon<br />
CustomLog logs/access_log vcommon<br />
<br />
<Directory /www/hosts><br />
<span class="indent">
# ScriptAlias ½ÄÀ¸·Î CGI ½ÇÇàÀ» °Á¦ÇÒ ¼ö ¾ø±â¶§¹®¿¡<br />
# ¿©±â¿¡ ExecCGI¸¦ »ç¿ëÇÑ´Ù<br />
Options FollowSymLinks ExecCGI<br />
</span>
</Directory><br />
<br />
# ÀÌÁ¦ ¾î·Á¿î ºÎºÐÀÌ´Ù<br />
<br />
RewriteEngine On<br />
<br />
# Host: Çì´õ¿¡¼ °¡Á®¿Â ¼¹ö¸í¿¡´Â ´ë¼Ò¹®ÀÚ°¡ µÚ¼¯¿©ÀÖÀ» ¼ö ÀÖ´Ù<br />
RewriteMap lowercase int:tolower<br />
<br />
## ÀÏ¹Ý ¹®¼¸¦ ¸ÕÀú ó¸®ÇÑ´Ù:<br />
# Alias /icons/ °¡ µ¿ÀÛÇϵµ·Ï - ´Ù¸¥ alias¿¡ ´ëÇؼµµ ¹Ýº¹<br />
RewriteCond %{REQUEST_URI} !^/icons/<br />
# CGI°¡ µ¿ÀÛÇϵµ·Ï<br />
RewriteCond %{REQUEST_URI} !^/cgi-bin/<br />
# Ưº°ÇÑ ÀÛ¾÷<br />
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1<br />
<br />
## ÀÌÁ¦ CGI¸¦ ó¸®ÇÑ´Ù - MIME typeÀ» °Á¦ÇØ¾ß ÇÑ´Ù<br />
RewriteCond %{REQUEST_URI} ^/cgi-bin/<br />
RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [T=application/x-httpd-cgi]<br />
<br />
# ³¡!
</code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="homepages.rewrite" id="homepages.rewrite"><code>mod_rewrite</code>¸¦
»ç¿ëÇÑ È¨ÆäÀÌÁö ½Ã½ºÅÛ</a></h2>
<p>´ÙÀ½Àº <a href="#homepages">µÎ¹ø° ¿¹</a>¿Í °°Àº ÀÏÀ»
ÇÑ´Ù.</p>
<div class="example"><p><code>
RewriteEngine on<br />
<br />
RewriteMap lowercase int:tolower<br />
<br />
# CGI°¡ µ¿ÀÛÇϵµ·Ï<br />
RewriteCond %{REQUEST_URI} !^/cgi-bin/<br />
<br />
# RewriteRuleÀÌ µ¿ÀÛÇϵµ·Ï È£½ºÆ®¸íÀÌ ¿Ã¹Ù¸¥Áö °Ë»çÇÑ´Ù<br />
RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.[a-z-]+\.isp\.com$<br />
<br />
# °¡»óÈ£½ºÆ®¸íÀ» URI ¾Õ¿¡ ºÙÀδÙ<br />
# [C]´Â ÀÌ °á°ú¸¦ °¡Áö°í ´ÙÀ½ ÀçÀÛ¼ºÀ» ¼öÇàÇÔÀ» ¶æÇÑ´Ù<br />
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]<br />
<br />
# ÀÌÁ¦ ½ÇÁ¦ ÆÄÀϸíÀ» ¸¸µç´Ù<br />
RewriteRule ^www\.([a-z-]+)\.isp\.com/(.*) /home/$1/$2<br />
<br />
# Àüü CGI µð·ºÅ丮¸¦ Á¤ÀÇÇÑ´Ù<br />
ScriptAlias /cgi-bin/ /www/std-cgi/
</code></p></div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="xtra-conf" id="xtra-conf">º°µµÀÇ °¡»óÈ£½ºÆ® ¼³Á¤ÆÄÀÏ
»ç¿ëÇϱâ</a></h2>
<p>´ÙÀ½Àº <code>mod_rewrite</code>ÀÇ °í±Þ ±â´ÉÀ» »ç¿ëÇÏ¿©
º°µµÀÇ ¼³Á¤ÆÄÀÏÀ» °¡Áö°í °¡»óÈ£½ºÆ®ÀÇ ¹®¼·çÆ®¸¦ ¾Ë¾Æ³½´Ù.
´õ À¯¿¬ÇÏÁö¸¸ ´õ º¹ÀâÇÑ ¼³Á¤ÀÌ ÇÊ¿äÇÏ´Ù.</p>
<p><code>vhost.map</code> ÆÄÀÏÀº ´ÙÀ½°ú °°´Ù:</p>
<div class="example"><p><code>
www.customer-1.com /www/customers/1<br />
www.customer-2.com /www/customers/2<br />
# ...<br />
www.customer-N.com /www/customers/N<br />
</code></p></div>
<p><code>http.conf</code>´Â ´ÙÀ½°ú °°´Ù:</p>
<div class="example"><p><code>
RewriteEngine on<br />
<br />
RewriteMap lowercase int:tolower<br />
<br />
# ´ëÀÀÆÄÀÏÀ» Á¤ÀÇÇÑ´Ù<br />
RewriteMap vhost txt:/www/conf/vhost.map<br />
<br />
# À§¿Í °°ÀÌ aliasµéÀ» ó¸®ÇÑ´Ù<br />
RewriteCond %{REQUEST_URI} !^/icons/<br />
RewriteCond %{REQUEST_URI} !^/cgi-bin/<br />
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$<br />
# ÆÄÀÏ ³»¿ëÀ» °¡Áö°í ã´Â´Ù<br />
RewriteCond ${vhost:%1} ^(/.*)$<br />
RewriteRule ^/(.*)$ %1/docs/$1<br />
<br />
RewriteCond %{REQUEST_URI} ^/cgi-bin/<br />
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$<br />
RewriteCond ${vhost:%1} ^(/.*)$<br />
RewriteRule ^/(.*)$ %1/cgi-bin/$1
</code></p></div>
</div></div>
<div class="bottomlang">
<p><span>°¡´ÉÇÑ ¾ð¾î: </span><a href="../en/vhosts/mass.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../fr/vhosts/mass.html" hreflang="fr" rel="alternate" title="Français"> fr </a> |
<a href="../ko/vhosts/mass.html" title="Korean"> ko </a> |
<a href="../tr/vhosts/mass.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a> |
<a href="../zh-cn/vhosts/mass.html" hreflang="zh-cn" rel="alternate" title="Simplified Chinese"> zh-cn </a></p>
</div><div id="footer">
<p class="apache">Copyright 2011 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="../mod/">¸ðµâ</a> | <a href="../mod/directives.html">Áö½Ã¾îµé</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">¿ë¾î</a> | <a href="../sitemap.html">»çÀÌÆ®¸Ê</a></p></div>
</body></html>
|