<-
Apache > HTTP Server > Documentation > Version 2.2 > ¸ðµâ

Please note

This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

¾ÆÆÄÄ¡ ¸ðµâ mod_authz_host

°¡´ÉÇÑ ¾ð¾î:  en  |  fr  |  ja  |  ko 

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.
¼³¸í:È£½ºÆ® (À̸§À̳ª IP ÁÖ¼Ò)¸¦ »ç¿ëÇÑ ±×·ì ±ÇÇѺο©
»óÅÂ:Base
¸ðµâ¸í:authz_host_module
¼Ò½ºÆÄÀÏ:mod_authz_host.c
Áö¿ø:¾ÆÆÄÄ¡ 2.1 ÀÌÈĺÎÅÍ

¿ä¾à

<Directory>, <Files>, <Location> ¼½¼Ç°ú .htaccess ÆÄÀÏ¿¡¼­ ¼­¹öÀÇ Æ¯Á¤ ºÎºÐÀÇ Á¢±ÙÀ» Á¦¾îÇϱâÀ§ÇØ mod_authz_host°¡ Á¦°øÇÏ´Â Áö½Ã¾î¸¦ »ç¿ëÇÑ´Ù. Ŭ¶óÀ̾ðÆ®ÀÇ È£½ºÆ®¸í, IP ÁÖ¼Ò, ȯ°æº¯¼ö¿¡ ±â·ÏµÈ ¿äûÀÇ Æ¯¼º¿¡ µû¶ó Á¢±ÙÀ» Á¦¾îÇÑ´Ù. Allow¿Í Deny Áö½Ã¾î´Â ¾î¶² Ŭ¶óÀ̾ðÆ®°¡ ¼­¹ö¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´ÂÁö¸¦ Áö½ÃÇÏ°í, Order Áö½Ã¾î´Â ±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã¿ëÇÒÁö °ÅºÎÇÒÁö ¿©ºÎ¿Í ¾î¶»°Ô Allow Áö½Ã¾î¿Í Deny Áö½Ã¾î°¡ ¼­·Î ¿µÇâÀ» ¹ÌÄ¡´ÂÁö °áÁ¤ÇÑ´Ù.

È£½ºÆ®±â¹Ý Á¢±ÙÁ¦ÇÑ°ú ¾ÏÈ£±â¹Ý ÀÎÁõÀ» µ¿½Ã¿¡ »ç¿ëÇÒ ¼öµµ ÀÖ´Ù. ÀÌ °æ¿ì Satisfy Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© ¾î¶»°Ô µÎ Á¦ÇÑÀÌ ¼­·Î ¿µÇâÀ» ¹ÌÄ¡´ÂÁö °áÁ¤ÇÑ´Ù.

ÀϹÝÀûÀ¸·Î Á¢±ÙÁ¦ÇÑ Áö½Ã¾î´Â (GET, PUT, POST µî) ¸ðµç ¸Þ¼­µå¿¡ Àû¿ëµÇ¸ç, ÀÌ ÇൿÀº ´ëºÎºÐÀÇ °æ¿ì ¹Ù¶÷Á÷ÇÏ´Ù. ±×·¯³ª <Limit> ¼½¼Ç¾È¿¡ Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© ƯÁ¤ ¸Þ¼­µå¿¡¸¸ Á¦ÇÑÇÒ ¼ö ÀÖ´Ù.

Áö½Ã¾îµé

Âü°í

top

Allow Áö½Ã¾î

¼³¸í:¼­¹öÀÇ ÀϺο¡ Á¢±ÙÇÒ ¼ö Àִ ȣ½ºÆ®¸¦ ÁöÁ¤ÇÑ´Ù
¹®¹ý: Allow from all|host|env=env-variable [host|env=env-variable] ...
»ç¿ëÀå¼Ò:directory, .htaccess
Override ¿É¼Ç:Limit
»óÅÂ:Base
¸ðµâ:mod_authz_host

Allow Áö½Ã¾î´Â ¾î¶² È£½ºÆ®°¡ ¼­¹öÀÇ ÀϺο¡ Á¢±ÙÇÒ ¼ö ÀÖ´ÂÁö Áö½ÃÇÑ´Ù. È£½ºÆ®¸í, IP ÁÖ¼Ò, IP ÁÖ¼Ò¿µ¿ª, ȯ°æº¯¼ö¿¡ ±â·ÏµÈ ´Ù¸¥ Ư¼º¿¡ µû¶ó Á¢±ÙÀ» Á¶ÀýÇÒ ¼ö ÀÖ´Ù.

ÀÌ Áö½Ã¾îÀÇ Ã¹¹ø° ¾Æ±Ô¸ÕÆ®´Â Ç×»ó fromÀÌ´Ù. ´ÙÀ½ ¾Æ±Ô¸ÕÆ®¿¡´Â ¼¼°¡Áö Çü½ÄÀÌ ÀÖ´Ù. Allow from allÀ» »ç¿ëÇϸé, ¾Æ·¡¿¡¼­ ¼³¸íÇÒ Deny¿Í Order Áö½Ã¾î ¼³Á¤¿¡ µû¶ó ¸ðµç È£½ºÆ®ÀÇ Á¢±ÙÀ» Çã°¡ÇÑ´Ù. ƯÁ¤ È£½ºÆ®¸¸ ¼­¹ö·Î Á¢±ÙÀ» Çã¿ëÇÏ·Á¸é ´ÙÀ½°ú °°Àº Çü½ÄÀ¸·Î host¸¦ Áö½ÃÇÒ ¼ö ÀÖ´Ù:

È£½ºÆ®¸í (ÀϺÎ)

¿¹Á¦:

Allow from apache.org

È£½ºÆ®¸íÀÌ ÀÌ ¹®ÀÚ¿­°ú °°°Å³ª ÀÌ ¹®ÀÚ¿­·Î ³¡³ª¸é Á¢±ÙÀ» Çã¿ëÇÑ´Ù. ±×·¡¼­ ÀÌ °æ¿ì foo.apache.org´Â ÇØ´çµÇ°í, fooapache.org´Â ÇØ´çµÇÁö ¾Ê´Â´Ù. ÀÌ ¼³Á¤À» »ç¿ëÇÏ¸é ¾ÆÆÄÄ¡´Â HostnameLookups Áö½Ã¾î ¼³Á¤°ú °ü°è¾øÀÌ Å¬¶óÀ̾ðÆ® IP ÁÖ¼Ò¸¦ °¡Áö°í Áߺ¹-¿ª DNS °Ë»öÀ» ÇÑ´Ù. Áï, È£½ºÆ®¸íÀ» ã±âÀ§ÇØ IP ÁÖ¼Ò¸¦ ¿ªDNS °Ë»öÀ» ÇÑ ÈÄ, ´Ù½Ã È£½ºÆ®¸íÀ¸·Î °Ë»öÇÏ¿© ¿ø·¡ IP ÁÖ¼Ò¿Í ÀÏÄ¡ÇÏ´ÂÁö È®ÀÎÇÑ´Ù. °á°ú°¡ °°°í È£½ºÆ®¸íÀÌ ¼³Á¤°ª¿¡ ÇØ´çÇϸé, Á¢±ÙÀ» Çã¿ëÇÑ´Ù.

IP ÁÖ¼Ò Àüü

¿¹Á¦:

Allow from 10.1.2.3

Á¢±ÙÀ» Çã°¡Çϴ ȣ½ºÆ®ÀÇ IP ÁÖ¼Ò

IP ÁÖ¼Ò ÀϺÎ

¿¹Á¦:

Allow from 10.1

¼­ºê³×Æ®¿öÅ©·Î Á¦ÇÑÇϱâÀ§ÇØ IP ÁÖ¼Ò ¾ÕÀÇ 1¿¡¼­ 3 ¹ÙÀÌÆ®.

³×Æ®¿öÅ©/³Ý¸Å½ºÅ© ½Ö

¿¹Á¦:

Allow from 10.1.0.0/255.255.0.0

³×Æ®¿öÅ© a.b.c.d¿Í ³Ý¸Å½ºÅ© w.x.y.z. ´õ ¼¼¹ÐÇÏ°Ô ¼­ºê³×Æ®¿öÅ©·Î Á¦ÇÑÇÒ¶§ »ç¿ëÇÑ´Ù.

³×Æ®¿öÅ©/nnn CIDR ±Ô¾à

¿¹Á¦:

Allow from 10.1.0.0/16

¾ÕÀÇ °æ¿ì¿Í °°Áö¸¸, »óÀ§ nnn°³ ºñÆ® °ªÀÌ 1ÀÎ ³Ý¸Å½ºÅ©¸¦ »ç¿ëÇÑ´Ù.

¸¶Áö¸· ¼¼°¡Áö ¿¹´Â Á¤È®È÷ µ¿ÀÏÇÑ È£½ºÆ®µéÀ» ÁöĪÇÑ´Ù.

´ÙÀ½°ú °°ÀÌ IPv6 ÁÖ¼Ò¿Í IPv6 ¼­ºê³×Æ®¿öÅ©¸¦ ÁöÁ¤ÇÒ ¼öµµ ÀÖ´Ù:

Allow from 2001:db8::a00:20ff:fea7:ccea
Allow from 2001:db8::a00:20ff:fea7:ccea/10

Allow Áö½Ã¾î ¾Æ±Ô¸ÕÆ®ÀÇ ¼¼¹ø° Çü½ÄÀº ȯ°æº¯¼ö À¯¹«¿¡ µû¶ó Á¢±ÙÀ» Á¦¾îÇÑ´Ù. Allow from env=env-variableÀ» »ç¿ëÇϸé, env-variable ȯ°æº¯¼ö°¡ Á¤ÀÇµÈ °æ¿ì Á¢±ÙÀ» Çã°¡ÇÑ´Ù. mod_setenvif°¡ Á¦°øÇÏ´Â Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© Ŭ¶óÀ̾ðÆ® ¿äûÀÇ Æ¯¼º¿¡ µû¶ó ÀÚÀ¯·Ó°Ô ȯ°æº¯¼ö¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. ±×·¯¹Ç·Î ÀÌ Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© Ŭ¶óÀ̾ðÆ® User-Agent (ºê¶ó¿ìÀú Á¾·ù), Referer, ´Ù¸¥ HTTP ¿äû Çì´õ¿¡ µû¶ó Á¢±ÙÀ» Çã°¡ÇÒ ¼ö ÀÖ´Ù.

¿¹Á¦:

SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in
<Directory /docroot>
Order Deny,Allow
Deny from all
Allow from env=let_me_in
</Directory>

ÀÌ °æ¿ì user-agent ¹®ÀÚ¿­ÀÌ KnockKnock/2.0À¸·Î ½ÃÀÛÇÏ´Â ºê¶ó¿ìÀúÀÇ Á¢±ÙÀº Çã¿ëÇÏ°í, ³ª¸ÓÁö´Â ¸ðµÎ °ÅºÎÇÑ´Ù.

top

Deny Áö½Ã¾î

¼³¸í:¼­¹ö Á¢±ÙÀ» °ÅºÎÇÒ È£½ºÆ®¸¦ ÁöÁ¤ÇÑ´Ù
¹®¹ý: Deny from all|host|env=env-variable [host|env=env-variable] ...
»ç¿ëÀå¼Ò:directory, .htaccess
Override ¿É¼Ç:Limit
»óÅÂ:Base
¸ðµâ:mod_authz_host

ÀÌ Áö½Ã¾î¸¦ »ç¿ëÇÏ¿© È£½ºÆ®¸í, IP ÁÖ¼Ò, ȯ°æº¯¼ö¿¡ µû¶ó ¼­¹ö Á¢±ÙÀ» Á¦ÇÑÇÒ ¼ö ÀÖ´Ù. Deny Áö½Ã¾îÀÇ ¾Æ±Ô¸ÕÆ®´Â Allow Áö½Ã¾î¿Í µ¿ÀÏÇÏ´Ù.

top

Order Áö½Ã¾î

¼³¸í:±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã¿ëÇÒÁö °ÅºÎÇÒÁö ¿©ºÎ¿Í Allow¿Í Deny 󸮼ø¼­¸¦ Á¤ÇÑ´Ù.
¹®¹ý: Order ordering
±âº»°ª:Order Deny,Allow
»ç¿ëÀå¼Ò:directory, .htaccess
Override ¿É¼Ç:Limit
»óÅÂ:Base
¸ðµâ:mod_authz_host

Order Áö½Ã¾î´Â ±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã¿ëÇÒÁö °ÅºÎÇÒÁö ¿©ºÎ¿Í Allow¿Í Deny Áö½Ã¾î 󸮼ø¼­¸¦ Á¤ÇÑ´Ù. orderingÀº ´ÙÀ½ Áß ÇϳªÀÌ´Ù

Deny,Allow
Deny Áö½Ã¾î¸¦ Allow Áö½Ã¾î º¸´Ù ¸ÕÀú »ìÆ캻´Ù. ±×¸®°í ±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã¿ëÇÑ´Ù. Deny³ª Allow Áö½Ã¾î¿¡ ÇØ´çµÇÁö ¾Ê´Â Ŭ¶óÀ̾ðÆ®ÀÇ Á¢±ÙÀ» Çã¿ëÇÑ´Ù.
Allow,Deny
Allow Áö½Ã¾î¸¦ Deny Áö½Ã¾î º¸´Ù ¸ÕÀú »ìÆ캻´Ù. ±×¸®°í ±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã¿ëÇÏÁö ¾Ê´Â´Ù. Deny³ª Allow Áö½Ã¾î¿¡ ÇØ´çµÇÁö ¾Ê´Â Ŭ¶óÀ̾ðÆ®ÀÇ Á¢±ÙÀ» °ÅºÎÇÑ´Ù.
Mutual-failure
Deny ¸ñ·Ï¿¡´Â ¾È³ª¿À°í Allow ¸ñ·Ï¿¡¸¸ ³ª¿À´Â È£½ºÆ®¸¸ Á¢±ÙÀ» Çã¿ëÇÑ´Ù. Order Allow,Deny¿Í °°Àº ÀÏÀ» Çϱ⶧¹®¿¡ »ç¿ëÇÏÁö ¾Ê´Â´Ù.

Å°¿öµå´Â ½°Ç¥·Î¸¸ ±¸ºÐÇÑ´Ù; »çÀÌ¿¡ °ø¹éÀÌ ÀÖÀ¸¸é ¾ÈµÈ´Ù. ¸ðµç °æ¿ì Allow¿Í Deny ¸ðµÎ »ìÆ캽À» ¸í½ÉÇ϶ó.

¾Æ·¡ ¿¹¿¡¼­ apache.org µµ¸ÞÀÎÀÇ ¸ðµç È£½ºÆ®ÀÇ Á¢±ÙÀº Çã¿ëÇÏÁö¸¸, ´Ù¸¥ È£½ºÆ®´Â ¸ðµÎ °ÅºÎÇÑ´Ù.

Order Deny,Allow
Deny from all
Allow from apache.org

¾Æ·¡ ¿¹¿¡¼­ foo.apache.org ÇÏÀ§µµ¸ÞÀο¡ Àִ ȣ½ºÆ®¸¸ °ÅºÎÇÏ°í, apache.org µµ¸ÞÀο¡ Àִ ȣ½ºÆ®´Â ¸ðµÎ Á¢±ÙÀ» Çã¿ëÇÑ´Ù. ±âº»ÀûÀ¸·Î Á¢±ÙÀ» °ÅºÎÇϱ⶧¹®¿¡ apache.org µµ¸ÞÀο¡ ¼ÓÇÏÁö ¾Ê´Â È£½ºÆ®´Â Á¢±ÙÀ» °ÅºÎÇÑ´Ù.

Order Allow,Deny
Allow from apache.org
Deny from foo.apache.org

¹Ý´ë·Î À§ÀÇ Order¸¦ Deny,Allow·Î º¯°æÇϸé, ¸ðµç È£½ºÆ®ÀÇ Á¢±ÙÀ» Çã¿ëÇÑ´Ù. ¼³Á¤ÆÄÀÏ¿¡¼­ Áö½Ã¾î°¡ ³ª¿À´Â ¼ø¼­¿Í °ü°è¾øÀÌ Allow from apache.org¸¦ Á¦ÀÏ ¸¶Áö¸·¿¡ ó¸®ÇÏ¿© Deny from foo.apache.orgÀÇ È¿°ú¸¦ ¹«½ÃÇϱ⠶§¹®ÀÌ´Ù. ¶Ç, ±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã°¡ÇϹǷΠapache.org µµ¸ÞÀο¡ ¼ÓÇÏÁö ¾Ê´Â È£½ºÆ®µµ ¸ðµÎ Á¢±ÙÀ» Çã°¡ÇÑ´Ù.

Order Áö½Ã¾î´Â ±âº»ÀûÀ¸·Î Á¢±ÙÀ» Çã¿ëÇÒÁö °ÅºÎÇÒÁö¸¦ Á¤Çϱ⶧¹®¿¡ Allow³ª Deny Áö½Ã¾î¸¦ »ç¿ëÇÏÁö ¾Ê¾Æµµ Á¢±Ù°¡´É ¿©ºÎ¿¡ ¿µÇâÀ» ÁØ´Ù. ¿¹¸¦ µé¾î,

<Directory /www>
Order Allow,Deny
</Directory>

´Â ±âº»ÀûÀ¸·Î Á¢±ÙÀ» °ÅºÎÇϱ⶧¹®¿¡ /www µð·ºÅ丮¿¡ ´ëÇÑ ¸ðµç Á¢±ÙÀ» °ÅºÎÇÑ´Ù.

Order Áö½Ã¾î°¡ Á¤ÇÏ´Â Á¢±Ù Áö½Ã¾î 󸮼ø¼­´Â ÇØ´ç ¼­¹ö¼³Á¤ 󸮴ܰ迡¸¸ ¿µÇâÀ» ÁØ´Ù. Áï, Order Áö½Ã¾î ¼³Á¤°ú °ü°è¾øÀÌ <Location> ¼½¼Ç ¾È¿¡ ÀÖ´Â Allow³ª Deny Áö½Ã¾î´Â <Directory> ¼½¼ÇÀ̳ª .htaccess ÆÄÀÏ¿¡ ÀÖ´Â Allow¿Í Deny Áö½Ã¾î¸¦ ¸ðµÎ ó¸®ÇÑ ÈÄ¿¡ ó¸®ÇÑ´Ù. ¼³Á¤ ¼½¼ÇµéÀÌ °áÇÕÇÏ´Â ¹æ¹ý¿¡ ´ëÇؼ­´Â ¾î¶»°Ô Directory, Location, Files ¼½¼ÇÀÌ µ¿ÀÛÇϳª ¹®¼­¸¦ Âü°íÇ϶ó.

°¡´ÉÇÑ ¾ð¾î:  en  |  fr  |  ja  |  ko 

top

Comments

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 again by our moderators 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 Freenode, or sent to our mailing lists.