<-
Apache > HTTP Server > Documentation > µâ

ÄÄ µâ mod_setenvif 1n5d6b

ƢÉÇÑ î:  tr 

ÀÌ Â ÃÖÅÇ ÀÌ ÕÏÙ. ÃÖÙ ¯ƩµÈ »ëÀ µî ¦ ÂüíÇÏä.
í: äûÀÇ Ý µûó ȯƩ¯ö ÁÀ» ¯ƩÇÑÙ
»óÅÂ: Base
惡: setenvif_module
ÒÄÀÏ: mod_setenvif.c

äà 2z375a

mod_setenvif µâÀ äûÀÇ ÝÀÌ ÁÔÇ¥ÇöÄ ÇçÇÏÂÁö ©ÎΠȯƩ¯ö¦ ÁÇÑÙ. öÀÇ Ù¥ ÎÀÌ ÇàµÀ» áÁÇÒҡ ÀÌ È¯Ʃ¯ö¦ »çëÇÒ ö ÀÖÙ.

ÁÄÀÏ À ëÎ ÁöÃî¦ ÃÇÑÙ. êóìÀúƢ MSIEƢ Ïó mozillaÀÎ Ʃì netscape¦ ÁÇÏÂ Í ơÀÌ ©¯ ÁöÃî¦ ÇÔ »çëÇÒ ö ÀÖÙ.

BrowserMatch ^Mozilla netscape
BrowserMatch MSIE !netscape

 Apache!

ÁöÃîµé 2l4o6j

Bugfix checklist 4i2533

Âüí 251y31

top

BrowserMatch ÁöÃî 4z3b32

í: HTTP -Agent µûó ȯƩ¯ö¦ ÁÇÑÙ
ý: BrowserMatch regex [!]env-variable[=value] [[!]env-variable[=value]] ...
»çëÀåÒ: ÁÖöÁ, Ƣ»óÈ£, directory, .htaccess
Override ÉÇ: FileInfo
»óÅÂ: Base
µâ: mod_setenvif

BrowserMatch SetEnvIf ÁöÃîÀÇ ¯ÇÑ ƩìÎ, HTTP äû Çìõ -Agent µûó ȯƩ¯ö¦ ÁÇÑÙ. ÙÀ µÎ ÁÙÀ ơƢÙ:

BrowserMatchNoCase Robot is_a_robot
SetEnvIfNoCase -Agent Robot is_a_robot

ÃƢ Á¦:

BrowserMatch ^Mozilla forms jpeg=yes browser=netscape
BrowserMatch "^Mozilla/[2-3]" tables agif frames javascript
BrowserMatch MSIE !javascript

top

BrowserMatchNoCase ÁöÃî 6282

í: ëÒÀÚ¦ ÇÏÁöÊí -Agent µûó ȯƩ¯ö¦ ÁÇÑÙ
ý: BrowserMatchNoCase regex [!]env-variable[=value] [[!]env-variable[=value]] ...
»çëÀåÒ: ÁÖöÁ, Ƣ»óÈ£, directory, .htaccess
Override ÉÇ: FileInfo
»óÅÂ: Base
µâ: mod_setenvif

BrowserMatchNoCase ÁöÃî BrowserMatch ÁöÃîÍ ÀÇÌ»ó ơƢÙ. ¯ ÀÌ ÁöÃî ëÒÀÚ¦ ÇÏÁöÊÂÙ. ¦ µéî:

BrowserMatchNoCase mac platform=macintosh
BrowserMatchNoCase win platform=windows

BrowserMatchÍ BrowserMatchNoCase ÁöÃî SetEnvIfNoCase ÁöÃîÀÇ ¯ÇÑ ƩìÙ. ÙÀ ÁÖ ÁÙÀ ơƢÙ:

BrowserMatchNoCase Robot is_a_robot
SetEnvIfNoCase -Agent Robot is_a_robot

top

SetEnvIf ÁöÃî h6l3y

í: äûÀÇ Áú µûó ȯƩ¯ö¦ ÁÇÑÙ
ý: SetEnvIf attribute regex [!]env-variable[=value] [[!]env-variable[=value]] ...
»çëÀåÒ: ÁÖöÁ, Ƣ»óÈ£, directory, .htaccess
Override ÉÇ: FileInfo
»óÅÂ: Base
µâ: mod_setenvif

SetEnvIf ÁöÃî äûÀÇ Áú µûó ȯƩ¯ö¦ ÁÀÇÇÑÙ. àÔÕ attribute ÙÀ ƢÁöÁ ÇÏÙ:

  1. HTTP äû Çìõ (õ ÀÚÇÑ Á RFC2616 Âüí); ¦ µéî: Host, -Agent, Referer, Accept-Language. ÁÔÇ¥ÇöÄÀ» »çëÇÏ© ©¯ äû Çìõ¦ ÁöÄÇÒ ö ÀÖÙ.
  2. äûÀÇ ÙÀ ÁúÁ ÇÏ:
    • Remote_Host - (ÀÖÙé) äûÇÏ ŬóÀÌÀÇ È£碬í
    • Remote_Addr - äûÇÏ ŬóÀÌÀÇ IP ÁÖÒ
    • Server_Addr - äûÀ»  öÀÇ IP ÁÖÒ (2.0.43 öÀü ÀÌÈÄ)
    • Request_Method - »çëÇÑ áµå ÀÌ (GET, POST, µîµî)
    • Request_Protocol - äûÀÇ ÇÁÎÅäÄÝ ÀÌסú öÀü (¦ µéî, "HTTP/0.9", "HTTP/1.1", µî.)
    • Request_URI - HTTP äû äûÇÑ ÀÚ -- ÀÏÝÀûÀÎ URL ÁúÀÇÀÚÀ» Á¦ÜÇÑ Å(scheme)ú È£ ÀÌÈÄ Î
  3. äûú ¬üµÈ ȯƩ¯ö ÀÌ. SetEnvIf ÁöÃî ÀÌÀü ÁöÃîÀÇ áú¦ Ë»çÇÒ ö ÀÖÙ. ÀÌÀü SetEnvIf[NoCase] ÁöÃîÎ ÁÀÇÇÑ È¯Ʃ¯öÀ» Ë»çÇÒ ö ÀÖÙ. 'ÀÌÀü'ÀÌõ (öÀüú ơÀÌ) õ À µ ÈÀ ÁöÃîÀÇ ÇöÀç µ ÀÌÀüÀ» ҩÇÑÙ. äû ÁúÀÌ Ïí ÁÔÇ¥ÇöÄÀÌ Ñ attribute ȯƩ¯öÎ ÃëÇÑÙ.

µÎ ÔÕ碥 (regex) Perl ȣȯ ÁÔÇ¥ÇöÄÀÌÙ. ÀÌ POSIX.2 egrepÀÇ ÁÔÇ¥ÇöÄú ñÁÇÏÙ. regexƢ attribute ëÀÀÇÏé ÓÁö ÔÕ碬¦ ÃÇÑÙ.

ÓÁö ÔÕ碥 ÁÇÒ ¯öíú (ÅÃÀûÀÎ) ÁƨµéÀÌÙ. ÙÀú ơÀ ÇüÄÀÌÙ

  1. varname, ÈÀ
  2. !varname, ÈÀ
  3. varname=value

àÇüÅ ƨÀÎ "1"À» »çëÇÑÙ. µÎ ÇüÅ ¯öƢ ÀÌÌ ÁÀÇµÈ Ʃì ¯ö¦ Á¦ÅÇÏí, ÂƢ ¯öÀÇ ƨÀÎ value¦ ÁÇÑÙ. ÄÄ 2.0.51ÎÅÍ value ÀÖ $1..$9¦ regexÀÇ ýȣģ ÇÏÀÇ¥ÇöÄÀÎ ëÃÇÑÙ.

Á¦: 403k11

SetEnvIf Request_URI "\.gif$" object_is_image=gif
SetEnvIf Request_URI "\.jpg$" object_is_image=jpg
SetEnvIf Request_URI "\.xbm$" object_is_image=xbm
:
SetEnvIf Referer www\.mydomain\.com intra_site_referral
:
SetEnvIf object_is_image xbm XBIT_PROCESSING=1
:
SetEnvIf ^TS* ^[a-z].* HAVE_TS

ÃÀ ÁÙÀ ÀÌÌÁö ÄÀÏÀ» äûÇÑ Ʃì ȯƩ¯ö object_is_image¦ ÁÇÑÙ.  ÁÙÀ äÀÌÁö¦ www.mydomain.com À¥»çÀÌ碯 ÂüÁÇÑ Ʃì intra_site_referralÀ» ÁÇÑÙ.

Áö  äû ÀÌע "TS"Î ÃÀÛÇÏí ƨÀÌ [a-z] Á ÇÏÎ ÃÀÛÇÏ ÇìõƢ ÀÖ Ʃì ȯƩ¯ö HAVE_TS¦ ÁÇÑÙ.

Âüí 251y31

top

SetEnvIfExpr ÁöÃî 1w6b4v

í: Sets environment variables based on an ap_expr expression
ý:
»çëÀåÒ: ÁÖöÁ, Ƣ»óÈ£, directory, .htaccess
»óÅÂ: Base
µâ: mod_setenvif

Documentation not yet translated. Please see English version of document.

top

SetEnvIfNoCase ÁöÃî e5y2b

í: ëÒÀÚ¦ ÇÏÁöÊí äûÀÇ Áú µûó ȯƩ¯ö¦ ÁÇÑÙ
ý: SetEnvIfNoCase attribute regex [!]env-variable[=value] [[!]env-variable[=value]] ...
»çëÀåÒ: ÁÖöÁ, Ƣ»óÈ£, directory, .htaccess
Override ÉÇ: FileInfo
»óÅÂ: Base
µâ: mod_setenvif

SetEnvIfNoCase ÀÇÌ»ó SetEnvIf ÁöÃîÍ ơÁö, ëÒÀÚ¦ ÇÏÁöÊí ÁÔÇ¥ÇöÄÀ» ãÂÙ. ¦ µéî:

SetEnvIfNoCase Host Apache\.Org site=apache

ÀÌ Ʃì HTTP äû Çìõ Host:Ƣ Apache.Org, apache.org µîÀ» ÇÔÇÏé site ȯƩ¯ö¦ "apache"Î ÁÇÑÙ.

ƢÉÇÑ î:  tr 

top

Comments 2p1l6j

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our s if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our mailing lists.