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

¾ÆÆÄÄ¡ ¸ðµâ mod_example_hooks

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

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.
¼³¸í:¾ÆÆÄÄ¡ ¸ðµâ API¸¦ ¼³¸íÇÑ´Ù
»óÅÂ:Experimental
¸ðµâ¸í:example_hooks_module
¼Ò½ºÆÄÀÏ:mod_example_hooks.c

¿ä¾à

¾ÆÆÄÄ¡ ¹èÆ÷º» modules/examples µð·ºÅ丮¿¡ ÀÖ´Â ÆÄÀϵéÀº ¾ÆÆÄÄ¡ API¸¦ »ç¿ëÇÏ¿© ¸ðµâÀ» ÀÛ¼ºÇÏ·Á´Â »ç¶÷µéÀ» µ½±âÀ§ÇÑ ¿¹Á¦´Ù.

mod_example_hooks.c´Â ¸ðµç Äݹé(callback) ±¸Á¶¿Í È£Ãâ ¹®¹ýÀ» ¼³¸íÇÏ´Â ÆÄÀÏÀÌ´Ù. ´ç½ÅÀº ¸ðµâ¿¡ ÀÌ ¸ðµç ÄݹéÀ» ±¸ÇöÇÒ ÇÊ¿ä°¡ ¾ø´Ù. »ç½Ç Á¤¹Ý´ë´Ù!

example ¸ðµâÀº ½ÇÁ¦·Î µ¿ÀÛÇÏ´Â ¸ðµâÀÌ´Ù. ÀÌ ¸ðµâÀ» ¼­¹ö¿¡ ¿¬°áÇÏ°í ƯÁ¤ À§Ä¡¿¡ "example-hooks-handler" Çڵ鷯¸¦ ÇÒ´çÇÏ¿© ±×°÷À» ºê¶ó¿ì¡Çϸé example ¸ðµâÀÇ ¿©·¯ ÄݹéÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.

Support Apache!

ÁÖÁ¦

Áö½Ã¾îµé

Bugfix checklist

Âü°í

top

example ¸ðµâ ÄÄÆÄÀÏÇϱâ

¼­¹ö¿¡ example ¸ðµâÀ» Æ÷ÇÔÇÏ·Á¸é ´ÙÀ½ °úÁ¤À» °ÅÄ£´Ù:

  1. --enable-example-hooks ¿É¼Ç°ú ÇÔ²² configure¸¦ ½ÇÇàÇÑ´Ù.
  2. ¼­¹ö¸¦ ÄÄÆÄÀÏÇÑ´Ù ("make"¸¦ ½ÇÇàÇÑ´Ù).

ÀÚ½ÅÀÌ ¸¸µç ¸ðµâÀ» Ãß°¡ÇÏ·Á¸é:

  1. cp modules/examples/mod_example_hooks.c modules/new_module/mod_myexample.c
  2. ÆÄÀÏÀ» ¼öÁ¤ÇÑ´Ù.
  3. modules/new_module/config.m4 ÆÄÀÏÀ» ¸¸µç´Ù.
    1. APACHE_MODPATH_INIT(new_module)À» Ãß°¡ÇÑ´Ù.
    2. modules/examples/config.m4 ÆÄÀÏ¿¡¼­ "example_hooks"ÀÌ ÀÖ´Â APACHE_MODULE ÁÙÀ» º¹»çÇؿ´Ù.
    3. ù¹ø° ¾Æ±Ô¸ÕÆ® "example_hooks"À» myexample·Î º¯°æÇÑ´Ù.
    4. µÎ¹ø° ¾Æ±Ô¸ÕÆ® ÀÚ¸®¿¡ ÀÚ½ÅÀÌ ¸¸µç ¸ðµâ¿¡ ´ëÇÑ °£´ÜÇÑ ¼³¸íÀ» Àû´Â´Ù. configure --help¸¦ ½ÇÇàÇÏ¸é ¿©±â¿¡ ±â·ÏÇÑ ¼³¸íÀ» º¸¿©ÁØ´Ù.
    5. ¸ðµâÀ» ÄÄÆÄÀÏÇÒ¶§ Ưº°ÇÑ C ÄÄÆÄÀÏ·¯ ¿É¼Ç, ¸µÄ¿ ¿É¼Ç, ¶óÀ̺귯¸®°¡ ÇÊ¿äÇÏ¸é °¢°¢ CFLAGS, LDFLAGS, LIBS¿¡ Ãß°¡ÇÑ´Ù. modules µð·ºÅ丮¿¡ ÀÖ´Â ´Ù¸¥ config.m4 ÆÄÀϵéÀ» Âü°íÇ϶ó.
    6. APACHE_MODPATH_FINISH¸¦ Ãß°¡ÇÑ´Ù.
  4. module/new_module/Makefile.in ÆÄÀÏÀ» ¸¸µç´Ù. ¸ðµâÀ» ÄÄÆÄÀÏÇϴµ¥ Ưº°ÇÑ ¸í·É¾î°¡ ÇÊ¿ä¾ø´Ù¸é, ÆÄÀÏ¿¡ include $(top_srcdir)/build/special.mk¸¸ À־ µÈ´Ù.
  5. ÃÖ»óÀ§ µð·ºÅ丮¿¡¼­ ./buildconf ¸¦ ½ÇÇàÇÑ´Ù.
  6. --enable-myexample ¿É¼ÇÀ» »ç¿ëÇÏ¿© ¼­¹ö¸¦ ÄÄÆÄÀÏÇÑ´Ù
top

mod_example_hooks ¸ðµâ »ç¿ëÇϱâ

example ¸ðµâÀ» »ç¿ëÇÏ·Á¸é httpd.conf ÆÄÀÏ¿¡ ´ÙÀ½°ú °°Àº ¼³Á¤À» Ãß°¡Ç϶ó:

<Location /example-hooks-info>
SetHandler example-hooks-handler
</Location>

¾Æ´Ï¸é .htaccess ÆÄÀÏ¿¡ ´ÙÀ½°ú °°Àº ³»¿ëÀ» Ãß°¡ÇÏ°í, ±× À§Ä¡¿¡¼­ "test.example" °°Àº ÆÄÀÏÀ» ¿äûÇ϶ó:

AddHandler example-hooks-handler .example

¼­¹ö¸¦ Àç½ÃÀÛÇÑ ÈÄ ÀÌ À§Ä¡¸¦ ºê¶ó¿ì¡ÇÏ¸é ¾Õ¿¡¼­ ¸»ÇÑ ³»¿ëÀ» º¸°ÔµÉ °ÍÀÌ´Ù.

top

Example Áö½Ã¾î

¼³¸í:¾ÆÆÄÄ¡ ¸ðµâ API¸¦ ¼³¸íÇϱâÀ§ÇÑ ¿¹Á¦ Áö½Ã¾î
¹®¹ý:Example
»ç¿ëÀå¼Ò:ÁÖ¼­¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess
»óÅÂ:Experimental
¸ðµâ:mod_example_hooks

Example Áö½Ã¾î´Â example ¸ðµâÀÇ ³»¿ëÇڵ鷯°¡ °£´ÜÇÑ ¹®±¸¸¦ º¸ÀÏÁö ¿©ºÎ¸¦ ¼³Á¤ÇÑ´Ù. ÀÌ Áö½Ã¾î´Â ¾Æ±Ô¸ÕÆ®¸¦ ¹ÞÁö¾Ê´Â´Ù. example ³»¿ëÇڵ鷯¸¦ Àû¿ëÇÑ URL¿¡ Á¢¼ÓÇÏ¸é ¹®¼­ ¿äûÀ» ¼­ºñ½ºÇϱâÀ§ÇØ ¸ðµâ¾È¿¡ ÇÔ¼öµéÀÌ ¾î¶»°Ô ±×¸®°í ¾î¶² ¼ø¼­·Î ºÒ¸®´ÂÁö ¾Ë ¼ö ÀÖ´Ù. ÀÌ Áö½Ã¾îÀÇ È¿°ú´Â "Example directive declared here: YES/NO"·Î È®ÀÎÇÒ ¼ö ÀÖ´Ù.

°¡´ÉÇÑ ¾ð¾î:  en  |  fr  |  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.