1 <?xml version="1.0" encoding="EUC-KR" ?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
4 <!-- English Revision: 1.13 -->
7 Copyright 2004 The Apache Software Foundation
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
13 http://www.apache.org/licenses/LICENSE-2.0
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
22 <modulesynopsis metafile="mod_setenvif.xml.meta">
24 <name>mod_setenvif</name>
25 <description>¿äûÀÇ ¼º°Ý¿¡ µû¶ó ȯ°æº¯¼ö ¼³Á¤À» º¯°æÇÑ´Ù</description>
27 <sourcefile>mod_setenvif.c</sourcefile>
28 <identifier>setenvif_module</identifier>
33 <p><module>mod_setenvif</module> ¸ðµâÀº ¿äûÀÇ ¼º°ÝÀÌ
34 Á¤±ÔÇ¥Çö½Ä¿¡ ÇØ´çÇÏ´ÂÁö ¿©ºÎ·Î ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÑ´Ù. ¼¹öÀÇ
35 ´Ù¸¥ ºÎºÐÀÌ ÇൿÀ» °áÁ¤ÇÒ¶§ ÀÌ È¯°æº¯¼ö¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.</p>
37 <p>¼³Á¤ÆÄÀÏ¿¡ ³ª¿À´Â ¼ø¼´ë·Î Áö½Ã¾î¸¦ ó¸®ÇÑ´Ù. ±×·¡¼
38 ºê¶ó¿ìÀú°¡ MSIE°¡ ¾Æ´Ï¶ó mozillaÀÎ °æ¿ì <code>netscape</code>¸¦
39 ¼³Á¤ÇÏ´Â ¾Æ·¡ ¿¹¿Í °°ÀÌ ¿©·¯ Áö½Ã¾î¸¦ ÇÔ²² »ç¿ëÇÒ ¼ö ÀÖ´Ù.</p>
42 BrowserMatch ^Mozilla netscape<br />
43 BrowserMatch MSIE !netscape<br />
47 <seealso><a href="../env.html">¾ÆÆÄÄ¡ÀÇ È¯°æº¯¼ö</a></seealso>
50 <name>BrowserMatch</name>
51 <description>HTTP User-Agent¿¡ µû¶ó ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÑ´Ù</description>
52 <syntax>BrowserMatch <em>regex [!]env-variable</em>[=<em>value</em>]
53 [[!]<em>env-variable</em>[=<em>value</em>]] ...</syntax>
54 <contextlist><context>server config</context>
55 <context>virtual host</context><context>directory</context>
56 <context>.htaccess</context></contextlist>
57 <override>FileInfo</override>
60 <p><directive>BrowserMatch</directive>´Â <directive
61 module="mod_setenvif">SetEnvIf</directive> Áö½Ã¾îÀÇ Æ¯º°ÇÑ
62 °æ¿ì·Î, HTTP ¿äû Çì´õ <code>User-Agent</code>¿¡ µû¶ó ȯ°æº¯¼ö¸¦
63 ¼³Á¤ÇÑ´Ù. ´ÙÀ½ µÎ ÁÙÀº °°´Ù:</p>
65 BrowserMatchNoCase Robot is_a_robot<br />
66 SetEnvIfNoCase User-Agent Robot is_a_robot<br />
71 BrowserMatch ^Mozilla forms jpeg=yes browser=netscape<br />
72 BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript<br />
73 BrowserMatch MSIE !javascript<br />
79 <name>BrowserMatchNoCase</name>
80 <description>´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏÁö¾Ê°í User-Agent¿¡ µû¶ó ȯ°æº¯¼ö¸¦
81 ¼³Á¤ÇÑ´Ù</description>
82 <syntax>BrowserMatchNoCase <em>regex [!]env-variable</em>[=<em>value</em>]
83 [[!]<em>env-variable</em>[=<em>value</em>]] ...</syntax>
84 <contextlist><context>server config</context>
85 <context>virtual host</context><context>directory</context>
86 <context>.htaccess</context></contextlist>
87 <override>FileInfo</override>
88 <compatibility>¾ÆÆÄÄ¡ 1.2 ÀÌ»ó (¾ÆÆÄÄ¡ 1.2¿¡¼ ÀÌ Áö½Ã¾î´Â ÇöÀç
89 ¾ø¾îÁø mod_browser ¸ðµâ¿¡ ÀÖ¾ú´Ù)</compatibility>
93 <p><directive>BrowserMatchNoCase</directive> Áö½Ã¾î´Â <directive
94 module="mod_setenvif">BrowserMatch</directive> Áö½Ã¾î¿Í
95 ÀÇ¹Ì»ó °°´Ù. ±×·¯³ª ÀÌ Áö½Ã¾î´Â ´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏÁö¾Ê´Â´Ù.
98 BrowserMatchNoCase mac platform=macintosh<br />
99 BrowserMatchNoCase win platform=windows<br />
102 <p><directive>BrowserMatch</directive>¿Í
103 <directive>BrowserMatchNoCase</directive> Áö½Ã¾î´Â
104 <directive module="mod_setenvif">SetEnvIf</directive>¿Í
105 <directive module="mod_setenvif">SetEnvIfNoCase</directive>
106 Áö½Ã¾îÀÇ Æ¯º°ÇÑ °æ¿ì´Ù. ´ÙÀ½ ÁÖ ÁÙÀº °°´Ù:</p>
108 BrowserMatchNoCase Robot is_a_robot<br />
109 SetEnvIfNoCase User-Agent Robot is_a_robot<br />
115 <name>SetEnvIf</name>
116 <description>¿äûÀÇ ¼ºÁú¿¡ µû¶ó ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÑ´Ù</description>
117 <syntax>SetEnvIf <em>attribute
118 regex [!]env-variable</em>[=<em>value</em>]
119 [[!]<em>env-variable</em>[=<em>value</em>]] ...</syntax>
120 <contextlist><context>server config</context>
121 <context>virtual host</context><context>directory</context>
122 <context>.htaccess</context></contextlist>
123 <override>FileInfo</override>
126 <p><directive>SetEnvIf</directive> Áö½Ã¾î´Â ¿äûÀÇ ¼ºÁú¿¡
127 µû¶ó ȯ°æº¯¼ö¸¦ Á¤ÀÇÇÑ´Ù. ù¹ø° ¾Æ±Ô¸ÕÆ® <em>attribute</em>´Â
128 ´ÙÀ½ ¼¼°¡ÁöÁß Çϳª´Ù:</p>
131 <li>HTTP ¿äû Çì´õ (´õ ÀÚ¼¼ÇÑ Á¤º¸´Â <a
132 href="http://www.rfc-editor.org/rfc/rfc2616.txt">RFC2616</a>
133 Âü°í); ¿¹¸¦ µé¾î: <code>Host</code>, <code>User-Agent</code>,
134 <code>Referer</code>, <code>Accept-Language</code>. Á¤±ÔÇ¥Çö½ÄÀ»
135 »ç¿ëÇÏ¿© ¿©·¯ ¿äû Çì´õ¸¦ ÁöĪÇÒ ¼ö ÀÖ´Ù.</li>
137 <li>¿äûÀÇ ´ÙÀ½ ¼ºÁúÁß Çϳª:
139 <li><code>Remote_Host</code> - (ÀÖ´Ù¸é) ¿äûÇϴ Ŭ¶óÀ̾ðÆ®ÀÇ
142 <li><code>Remote_Addr</code> - ¿äûÇϴ Ŭ¶óÀ̾ðÆ®ÀÇ IP ÁÖ¼Ò</li>
144 <li><code>Server_Addr</code> - ¿äûÀ» ¹Þ´Â ¼¹öÀÇ IP ÁÖ¼Ò
145 (2.0.43 ¹öÀü ÀÌÈÄ¿¡¸¸)</li>
147 <li><code>Request_Method</code> - »ç¿ëÇÑ ¸Þ½áµå À̸§
148 (<code>GET</code>, <code>POST</code>, <em>µîµî</em>)</li>
150 <li><code>Request_Protocol</code> - ¿äûÀÇ ÇÁ·ÎÅäÄÝ À̸§°ú
151 ¹öÀü (<em>¿¹¸¦ µé¾î</em>, "HTTP/0.9", "HTTP/1.1", <em>µî.</em>)</li>
153 <li><code>Request_URI</code> - HTTP ¿äû¿¡¼ ¿äûÇÑ ÀÚ¿ø
154 -- ÀϹÝÀûÀ¸·Î URL¿¡¼ ÁúÀǹ®ÀÚ¿À» Á¦¿ÜÇÑ ½ºÅ´(scheme)°ú
155 È£½ºÆ® ÀÌÈÄ ºÎºÐ</li>
159 <li>¿äû°ú ¿¬°üµÈ ȯ°æº¯¼ö À̸§. ±×·¡¼ <directive>SetEnvIf</directive>
160 Áö½Ã¾î´Â ÀÌÀü Áö½Ã¾îÀÇ °á°ú¸¦ °Ë»çÇÒ ¼ö ÀÖ´Ù. ÀÌÀü¿¡
161 <code>SetEnvIf[NoCase]</code> Áö½Ã¾î·Î Á¤ÀÇÇÑ È¯°æº¯¼ö¸¸À»
162 °Ë»çÇÒ ¼ö ÀÖ´Ù. 'ÀÌÀü'À̶õ (¼¹öÀü¿ª°ú °°ÀÌ) ´õ ³ÐÀº ¿µ¿ª ȤÀº
163 Áö½Ã¾îÀÇ ÇöÀç ¿µ¿ª ÀÌÀüÀ» ¶æÇÑ´Ù. ¿äû ¼ºÁúÀÌ ¾Æ´Ï°í Á¤±ÔÇ¥Çö½ÄÀÌ
164 ¾Æ´Ñ <em>attribute</em>´Â ȯ°æº¯¼ö·Î Ãë±ÞÇÑ´Ù.</li>
167 <p>µÎ¹ø° ¾Æ±Ô¸ÕÆ®´Â (<em>regex</em>) <a
168 href="http://www.pcre.org/">Perl ȣȯ Á¤±ÔÇ¥Çö½Ä</a>ÀÌ´Ù.
169 ÀÌ´Â POSIX.2 egrepÀÇ Á¤±ÔÇ¥Çö½Ä°ú ºñ½ÁÇÏ´Ù. <em>regex</em>°¡
170 <em>attribute</em>¿¡ ´ëÀÀÇÏ¸é ³ª¸ÓÁö ¾Æ±Ô¸ÕÆ®¸¦ ó¸®ÇÑ´Ù.</p>
172 <p>³ª¸ÓÁö ¾Æ±Ô¸ÕÆ®´Â ¼³Á¤ÇÒ º¯¼ö¸í°ú (¼±ÅÃÀûÀÎ) ¼³Á¤°ªµéÀÌ´Ù.
173 ´ÙÀ½°ú °°Àº Çü½ÄÀÌ´Ù</p>
176 <li><code><em>varname</em></code>, ȤÀº</li>
178 <li><code>!<em>varname</em></code>, ȤÀº</li>
180 <li><code><em>varname</em>=<em>value</em></code></li>
183 <p>ù¹ø° ÇüÅ´ °ªÀ¸·Î "1"À» »ç¿ëÇÑ´Ù. µÎ¹ø° ÇüÅ´ º¯¼ö°¡
184 ÀÌ¹Ì Á¤ÀÇµÈ °æ¿ì º¯¼ö¸¦ Á¦°ÅÇÏ°í, ¼¼¹ø°´Â º¯¼öÀÇ °ªÀ¸·Î
185 <code><em>value</em></code>¸¦ ¼³Á¤ÇÑ´Ù. ¾ÆÆÄÄ¡ 2.1ºÎÅÍ
186 <var>value</var>¿¡ ÀÖ´Â <code>$1</code>..<code>$9</code>¸¦
187 <var>regex</var>ÀÇ °ýȣģ ÇÏÀ§Ç¥Çö½ÄÀ¸·Î ´ëüÇÑ´Ù.</p>
191 SetEnvIf Request_URI "\.gif$" object_is_image=gif<br />
192 SetEnvIf Request_URI "\.jpg$" object_is_image=jpg<br />
193 SetEnvIf Request_URI "\.xbm$" object_is_image=xbm<br />
195 SetEnvIf Referer www\.mydomain\.com intra_site_referral<br />
197 SetEnvIf object_is_image xbm XBIT_PROCESSING=1<br />
199 SetEnvIf ^TS* ^[a-z].* HAVE_TS<br />
202 <p>óÀ½ ¼¼ ÁÙÀº À̹ÌÁö ÆÄÀÏÀ» ¿äûÇÑ °æ¿ì ȯ°æº¯¼ö
203 <code>object_is_image</code>¸¦ ¼³Á¤ÇÑ´Ù. ³×¹ø° ÁÙÀº ÆäÀÌÁö¸¦
204 <code>www.mydomain.com</code> À¥»çÀÌÆ®¿¡¼ ÂüÁ¶ÇÑ °æ¿ì
205 <code>intra_site_referral</code>À» ¼³Á¤ÇÑ´Ù.</p>
207 <p>¸¶Áö¸· ¿¹´Â ¿äû¿¡ À̸§¿¡ "TS"·Î ½ÃÀÛÇÏ°í °ªÀÌ [a-z]
208 Áß Çϳª·Î ½ÃÀÛÇÏ´Â Çì´õ°¡ ÀÖ´Â °æ¿ì ȯ°æº¯¼ö
209 <code>HAVE_TS</code>¸¦ ¼³Á¤ÇÑ´Ù.</p>
212 <seealso><a href="../env.html">¾ÆÆÄÄ¡ÀÇ È¯°æº¯¼ö</a>¿¡ ´õ ¸¹Àº
218 <name>SetEnvIfNoCase</name>
219 <description>´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏÁö¾Ê°í ¿äûÀÇ ¼ºÁú¿¡ µû¶ó ȯ°æº¯¼ö¸¦
220 ¼³Á¤ÇÑ´Ù</description>
221 <syntax>SetEnvIfNoCase <em>attribute regex
222 [!]env-variable</em>[=<em>value</em>]
223 [[!]<em>env-variable</em>[=<em>value</em>]] ...</syntax>
224 <contextlist><context>server config</context>
225 <context>virtual host</context><context>directory</context>
226 <context>.htaccess</context></contextlist>
227 <override>FileInfo</override>
228 <compatibility>¾ÆÆÄÄ¡ 1.3 ÀÌÈÄ</compatibility>
232 <p><directive>SetEnvIfNoCase</directive>´Â Àǹ̻ó <directive
233 module="mod_setenvif">SetEnvIf</directive> Áö½Ã¾î¿Í °°Áö¸¸,
234 ´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏÁö¾Ê°í Á¤±ÔÇ¥Çö½ÄÀ» ã´Â´Ù. ¿¹¸¦ µé¾î:</p>
236 SetEnvIfNoCase Host Apache\.Org site=apache
239 <p>ÀÌ °æ¿ì HTTP ¿äû Çì´õ <code>Host:</code>°¡
240 <code>Apache.Org</code>, <code>apache.org</code> µîÀ» Æ÷ÇÔÇϸé
241 <code>site</code> ȯ°æº¯¼ö¸¦ "<code>apache</code>"·Î ¼³Á¤ÇÑ´Ù.</p>