ÀÌ È¯°æ º¯¼ö(configuration parameters)µéÀº ÁÖ¿ä ¾ÆÆÄÄ¡ ±â´É(features)À» Á¦¾îÇÕ´Ï´Ù. ±×¸®°í Ưº°ÇÑ ¸ðµâ¾øÀÌ Ç×»ó °¡´ÉÇÑ ¼±¾ðµé ÀÔ´Ï´Ù.
AccessConfig conf/access.conf
¾×¼½º(Á¢±Ù)À»
Á¦¾îÇϱâ À§ÇÑ È¯°æ¼³Á¤ÆÄÀÏÀ» ÁöÁ¤ÇÕ´Ï´Ù .
¼¹ö´Â
ResourceConfig ÆÄÀÏÀ» ÀÐ¾î µéÀÎ ÈÄ¿¡
À̰÷¿¡¼ ÁöÁ¤ÇÑ ÆÄÀÏÀ» ÀÐ¾î µéÀÔ´Ï´Ù.Filename Àº ServerRoot
¿¡ »ó´ëÀûÀÎ °æ·Î ÀÔ´Ï´Ù. ÀÌ ±â´ÉÀº ´ÙÀ½°ú °°ÀÌ ÇÏ¿©
»ç¿ëÇÏÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù.(win32¿¡¼´Â ÇØ´ç ¾øÀ½)
AccessConfig /dev/null
ÀÌ ÆÄÀÏÀº ´ÜÁö <Directory> ¼½¼Ç¿¡
Æ÷ÇԵ˴ϴÙ. ½ÇÁ¦·Î server config context ¿¡¼ Çã¿ëµÈ
¾î¶² ¼¹ö ¼±¾ð(µð·ºÆ¼ºê)¿¡µµ Æ÷Ç﵃ ¼ö ÀÖ½À´Ï´Ù.AccessFileName .htaccess
ÇØ´ç µð·ºÅ丮¿¡ À§Ä¡ÇÏ¿© ¹®¼¿¡ ´ëÇÑ Á¢±ÙÀ» Á¦¾î ÇÏ´Â ÆÄÀÏ¿¡ ´ëÇÑ ¼±¾ðÀÔ´Ï´Ù. ´ÙÀ½°ú °°ÀÌ »ç¿ëÇÏ¸é µð·ºÅ丮¿¡ ´ëÇÑ »ç¿ëÀÚ Á¢±Ù(Access)¸¦ Á¦¾îÇÒ ÆÄÀÏÀ» ÁöÁ¤ ÇÒ ¼ö ÀÖ½À´Ï´Ù.
AccessFileName .acl
¹®¼( /usr/local/web/index.html ¿¡ À§Ä¡) ¸¦ º¸³»ÁÖ±â Àü¿¡,
¼¹ö´Â /.acl, /usr/.acl, /usr/local/.acl ±×¸®°í /usr/local/web/.acl
ÆÄÀÏÀ» ÀÐ¾î µéÀÌ°Ô µË´Ï´Ù. ¸¸¾à ÀÌ ±â´ÉÀ» »ç¿ëÇÏ°í ½ÍÁö
¾Ê´Ù¸é ´ÙÀ½°ú °°ÀÌ ¼±¾ðÀ» ÇØÁÝ´Ï´Ù.
<Directory />
AllowOverride None
</Directory>
win32 ¿¡¼´Â .À¸·Î ½ÃÀÛÇÏ´Â ÆÄÀÏÀ̸§À¸·Î »õ·Î¸¸µé±â¸¦ ÇÒ ¼ö ¾ø½À´Ï´Ù. _acl À̳ª ´Ù¸¥ À̸§À» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
AddDefaultCharset Off
ÀÌ ¼±¾ðÀº ¹®ÀÚÁýÇÕÀÇ ±âº»°ªÀ» ÁöÁ¤ÇÕ´Ï´Ù. ÀÌ ¹®ÀÚ
ÁýÇÕÀº HTTP headers ¾ÈÀÇ ¹®¼ Çü½Ä¿¡¼ ¾î¶² ¸Å°³º¯¼öµµ °®°í
ÀÖÁö ¾ÊÀº ÀÀ´ä¿¡ Ãß°¡µË´Ï´Ù. À̰ÍÀº META
tag ¸¦
°æÀ¯Çؼ ¹®¼ÀÇ body ¿¡¼ ÁöÁ¤µÈ ¹®ÀÚÁýÇÕÀÌ ÀÖÀ» °æ¿ì ±×
°ªÀ¸·Î ´þ¾î¾º¾î(Override) Áý´Ï´Ù. AddDefaultCharset Off
·Î ¼ÂÆÃÇϸé ÀÌ ±â´ÉÀº »ç¿ëÇÏÁö ¾ÊÀ¸¸ç, AddDefaultCharset On
À¸·Î ¼ÂÆÃÇÒ °æ¿ì ¾ÆÆÄÄ¡ ³»ºÎ ±âº»°ªÀÎ iso-8859-1
¹®ÀÚÁýÇÕÀ» »ç¿ëÇÕ´Ï´Ù.as required by the
directive. ¶ÇÇÑ ´Ù¸¥ ¾ð¾îÁýÇÕÀ» ÁöÁ¤ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ;
e.g. AddDefaultCharset utf-8 ,
AddDefaultCharset euc-kr.
¸ðµâÀ» Ãß°¡ÇÏ´Â ¼±¾ð. ¾ÆÆÄÄ¡ ¼¹ö´Â
Ȱ¼ºÈ µÇÁö ¾ÊÀº ä·Î ÄÄÆÄÀÏµÈ ¸ðµâÀ» °¡Áö°í ÀÖ½À´Ï´Ù.
ÀÌ ¼±¾ðÀº ±×·± ¸ðµâÀ» »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. ¼¹ö´Â
Ȱ¼ºÈµÈ ¸ðµâÀº ÀúÀý·Î ·ÎµåµÇ´Âµ¥ ÀÌ ¸®½ºÆ®´Â ClearModuleList
¼±¾ðÀ» »ç¿ëÇØ¼ Áö¿ï¼ö ÀÖ½À´Ï´Ù.
Âü°í) windows¿ë ¾ÆÆÄÄ¡¿¡ ÄÄÆÄÀϽà Æ÷ÇÔµÈ ¸ðµâ ( apache -l ·Î
È®ÀÎ °¡´É , ÀüºÎ ¸ðµâ·Î Ȱ¼ºÈ µÇ¾î ÀÖÀ½)
http_core.c mod_so.c mod_mime.c mod_access.c mod_auth.c mod_negotiation.c mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_userdir.c
mod_alias.c mod_env.c mod_log_config.c mod_asis.c mod_imap.c mod_actions.c mod_setenvif.c mod_isapi.c
AllowOverride All
¼¹ö°¡ µð·ºÅ丮º° ¾×¼½º¸¦ Á¦¾îÇÏ´Â .htaccess ÆÄÀÏ(AccessFileName ¿¡¼ ÁöÁ¤µÊ)ÀÌ ÀÖÀ» °æ¿ì, ÀÌ ÆÄÀÏ¿¡¼ ÁöÁ¤µÈ ¾×¼½º Á¤º¸¸¦ ±âÁ¸¿¡ ÁöÁ¤µÈ Á¤º¸¿Í ºñ±³ÇÏ¿© Àû¿ëµÇ¾îÁú °ÍÀÎÁö ¾Æ´ÑÁö¿¡ ´ëÇÑ ¼±¾ð ÀÔ´Ï´Ù.
´þ¾î¾²±â( Override ) ´Â None
À¸·Î ¼ÂÆÃÇÒ °æ¿ì ¼¹ö´Â ÀÌ ¾×¼½º Á¤º¸°¡ µé¾î
ÀÖ´Â ÆÄÀÏÀ» ÀÐÁö ¾Ê½À´Ï´Ù. All
·Î ¼ÂÆÃÇÒ
°æ¿ì¿¡´Â ¸ðµç ¼±¾ð¿¡ ´ëÇØ¼ Àоî Àû¿ë½Ã۸ç, ´ÙÀ½°ú °°ÀÌ
ºÎºÐÀûÀ¸·Î Àû¿ë ½Ãų ¼öµµ ÀÖ½À´Ï´Ù.
¡¡
ÀÎÁõÀ̸§(µµ¸ÞÀÎ) ¼±¾ð. ÀÌ ¼±¾ðÀº ¾î¶² µð·ºÅ丮¿¡ ´ëÇÑ ÀÎÁõ realm ÀÇ À̸§À» ÁöÁ¤ÇÕ´Ï´Ù. realm Àº »ç¿ëÀÚ À̸§°ú ÆÐ½º¿öµå¸¦ ¾Ë°í ÀÖ´Â »ç¿ëÀÚ(Ŭ¶óÀ̾ðÆ®) ¿¡°Ô ÁÖ¾îÁö´Â °ÍÀÔ´Ï´Ù(»b¾÷À¸·Î ÀÎÁõâÀÌ ¶°¿À¸¦¶§ Ç¥½ÃµÊ). AuthName Àº ÇϳªÀÇ Àμö·Î »ç¿ëÇÕ´Ï´Ù. ¸¸¾à À̰÷¿¡ °ø¶õ(Space)ÀÌ µé¾î °£´Ù¸é " (µû¿ÈÇ¥) ¸¦ »ç¿ëÇÏ¿© ¹¾î ÁÖ¸é µË´Ï´Ù. ÀÌ ¼±¾ðÀº ¹Þµå½Ã AuthType ¿Í require ¼±¾ðÀ» µ¿¹ÝÇÕ´Ï´Ù. ±×¸®°í AuthUserFile À̳ª AuthGroupFile °ú °°Àº ¼±¾ðÀ» ÅëÇØ ÀÛµ¿ ÇÕ´Ï´Ù.
ÀÎÁõÇü½Ä ÁöÁ¤. ÀÌ ¼±¾ðÀº
µð·ºÅ丮º° »ç¿ëÀÚ ÀÎÁõÀÇ Çü½ÄÀ» ¼±ÅÃÇÕ´Ï´Ù. Basic
°ú Digest
Áß Çϳª¸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù.
¹Ýµå½Ã AuthName
°ú
require ¼±¾ðÀ» ¼ö¹ÝÇϸç,
AuthUserFile °ú
AuthGroupFile ¿Í °°Àº ¼±¾ðÀ»
ÅëÇØ ÀÛµ¿ÇÕ´Ï´Ù.
BindAddress *
À¯´Ð½º http ¼¹ö ¿¡¼ ÇØ´ç µÇ´Â »çÇ×ÀÔ´Ï´Ù.
A Unix® http server can either listen for connections to every IP address of the server machine, or just one IP address of the server machine. Saddr can be
BindAddress
¼±¾ðÀº ´ÜÁö ÇϳªÀÇ IP¿¡ ´ëÇØ¼¸¸
»ç¿ëµÉ ¼ö ÀÖ½À´Ï´Ù. ¾ÆÆÄÄ¡°¡ ÁÖÀǸ¦ ±â¿ïÀÏ ÁÖ¼Ò³ª Æ÷Æ®
°¡ ¸¹´Ù¸é ´ë½Å Listen
¼±¾ðÀ»
»ç¿ëÇÏ¿© Á¦¾î Çϵµ·Ï ÇÕ´Ï´Ù. ( Only one can be used. For more
control over which address and ports Apache listens to, use the
Listen
directive instead of
BindAddress
. )
BindAddress
´Â virtual hosts(°¡»óÈ£½ºÆ®)¸¦
Áö¿øÇϱâ À§ÇØ »ç¿ëµË´Ï´Ù.(<VirtualHost>
¼½¼Ç(sections)À»
»ç¿ëÇÏ´Â ´ë½Å)
See Also:
DNS Issues
See Also:
Setting which addresses and ports Apache uses
BS2000Account
¼±¾ðÀº BS2000 hosts ¿¡¼¸¸ °¡´ÉÇÑ ¼±¾ð ÀÔ´Ï´Ù. It must be used to define the account number for the non-privileged
apache server user (which was configured using the
User directive).
This is required by the BS2000 POSIX subsystem (to change the underlying
BS2000 task environment by performing a sub-LOGON) to prevent CGI scripts
from accessing resources of the privileged account which started the
server, usually SYSROOT.
Only one BS2000Account
directive can be used.
See Also: Apache EBCDIC port
¸ðµâÀ» Áö¿ì´Â ¼±¾ð. ¼¹ö´Â ÄÄÆÄÀϽà Ȱ¼ºÈµÈ ¸ðµâµéÀ» °¡Áö°í ÀÖ½À´Ï´Ù. ÀÌ ¼±¾ðÀº ±×·¯ÇÑ ¸ðµâÀ» ÀüºÎ Áö¿ó´Ï´Ù. ÀÌ ¼±¾ðÀ» »ç¿ëÇÑ ´ÙÀ½¿¡´Â AddModule ¼±¾ðÀ» »ç¿ëÇØ¼ ÇÊ¿äÇÑ ¸ðµâÀº ´Ù½Ã Ãß°¡ÇØ ÁÖ¾î¾ß ÇÕ´Ï´Ù.
ContentDigest off
ÀÌ ¼±¾ðÀº Content-MD5
Çì´õ¸¦ »ý¼ºÇÕ´Ï´Ù. ÀÌ Content-MD5
Çì´õ´Â RFC1864, RFC2068.¿¡¼ °¢°¢ Á¤ÀÇ µÇ¾ú½À´Ï´Ù.
MD5 ´Â ÀÓÀÇÀÇ ±æÀ̸¦ °®´Â DATAÀÇ "message digest"("fingerprint",Áö¹®À̶ó ºÒ¸®±âµµ ÇÔ) ¸¦ ÄÄÇ»ÆÃ Çϱâ À§ÇÑ ¾Ë°í¸®Áò ÀÔ´Ï´Ù. ¾î¶² DATA ÀÇ º¯°æÀº 'message digest.'ÀÇ º¯°æ¿¡ ¹Ý¿µ µË´Ï´Ù.
Content-MD5
header ´Â End-To-End
MIC(message
integrity check)Á¦°øÇÕ´Ï´Ù. ÇÁ¶ô½Ã³ª Ŭ¶óÀÌ¾ðÆ®´Â Àüü
³»¿ëÀÌ Àü¼ÛµÇ´Â µ¿¾È ÀϾ¼ö ÀÖ´Â ¼öÁ¤»çÇ׿¡ ´ëÇØ¼
°¨ÁöÇϱâ À§ÇØ ÀÌ Çì´õ¸¦ üũÇÒ °ÍÀÔ´Ï´Ù. Çì´õÀÇ ¿¹¸¦
µé¸é ´ÙÀ½°ú °°½À´Ï´Ù.
Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
ÀÌ ±â´ÉÀº message digest °¡ ¸ðµç ¿äû¿¡ ´ëÇØ °è»ê(compute)ÇÒ ¶§ ±îÁö ÆÛÆ÷¸Õ½º(¼öÇà´É·Â) ¹®Á¦¸¦ ÀÏÀ¸Å³¼ö ÀÖ½À´Ï´Ù. ( ÀÌ °ªÀº ij½¬µÇÁö ¾ÊÀ½ )
Content-MD5
´Â ¾ÆÆÄÄ¡ ÁÖ(core) ±â´É¿¡¸¸ Á¦°øµË´Ï´Ù(´Ù¸¥
¸ðµâ¿¡¼´Â ¼ºñ½ºµÇÁö ¾ÊÀ½). ¿¹¸¦ µé¸é SSI documents,
CGI scripts ·Î ºÎÅÍÀÇ Ãâ·Â, ±×¸®°í and ¹ÙÀÌÆ®(byte) ¹üÀ§ÀÇ
ÀÀ´ä¿¡ ´ëÇØ¼´Â ÀÌ Çì´õ¸¦ °®Áö ¾Ê½À´Ï´Ù.
¡¡
This controls the directory to which Apache attempts to switch before dumping core. The default is in the ServerRoot directory, however since this should not be writable by the user the server runs as, core dumps won't normally get written. If you want a core dump for debugging, you can use this directive to place it in a different location.
´ýÇÁ(dump) : ÆÄÀÏ ³»¿ëÀ» ´Ù¸¥ ÀåÄ¡ ¶Ç´Â ´Ù¸¥ ÆÄÀÏ·Î º¸³»´Â °ÍÀ» ¸»ÇÔ . ¸¸¾à µð¹ö±ëÀ» À§Çؼ ÄÚ¾î ´ýÇÁ¸¦ ¿øÇÑ´Ù¸é , ÀÌ ¼±¾ð¿¡¼ directory ¿¡ ´Ù¸¥ À§Ä¡¸¦ ÁöÁ¤ÇØ ÁÖ¸é µË´Ï´Ù.
¡¡
DefaultType text/html
±âº» ÄÁÅÙÃ÷ Çü½Ä ¼±¾ð. MIME Çü½Ä¿¡ ¸ÅÇεǾî ÀÖÁö ¾ÊÀº È®ÀåÀÚ¿¡ ´ëÇØ¼ ÁÖ¾îÁø ±âº»°ªÀ» »ç¿ëÇÕ´Ï´Ù.
¼¹ö´Â ¹®¼ÀÇ ÄÁÅÙÃ÷-Çü½ÄÀ»
¾Ë·ÁÁÖ°Ô µÇ¾î ÀÖ½À´Ï´Ù. ±×·¡¼ ¾Ë¼ö ¾ø´Â Çü½ÄÀÇ È®ÀåÀÚ¿¡
´ëÇØ¼´Â DefaultType
À» »ç¿ëÇÕ´Ï´Ù. ¿¹¸¦ µé¸é,
DefaultType image/gif
À̰ÍÀº gif À̹ÌÁö¸¸ ÀÖ´Â µð·ºÅ丮¿¡¼ .gif È®ÀåÀÚ¸¦ ¾²Áö
¾ÊÀº °æ¿ì¿¡µµ gif À̹ÌÁö¸¦ º¼¼ö ÀÖ½À´Ï´Ù. µð·ºÅ丮 ±â´É ¼±¾ð. <Directory> ¿Í </Directory> ´Â µð·ºÅ丮ÀÇ ±×·ìÀ» µÑ·¯½Î´Âµ¥ »ç¿ëµË´Ï´Ù. ¿©±â¼ ÁöÁ¤µÈ µð·ºÅ丮´Â ±× µð·ºÅ丮¿Í ÇÏÀ§ µð·ºÅ丮¿¡ Àû¿ëµË´Ï´Ù. directory context ·Î Çô¿ëµÇ´Â ¸ðµç ¼±¾ðÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. Directory ´Â µð·ºÅ丮ÀÇ Àüü°æ·Î(½ÇÁ¦µð·ºÅ丮)¸¦ ½áÁÖ¸ç, ¿ÍÀϵå Ä«µå¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿ÍÀϵå Ä«µå »ç¿ë¿¡ ÀÖ¾î¼, '?' ´Â ÇϳªÀÇ ¹®ÀÚ¿Í ¸ÅÄ¡µÇ°í '*' ´Â ¾î¶² ¹®Àڷεµ ´ëÄ¡µÉ ¼ö ÀÖ½À´Ï´Ù. Apache 1.3 À̻󿡼´Â `[]' ¹®ÀÚ¿À» »ç¿ëÇÒ ¼öµµ ÀÖÀ¸¸ç ¶ÇÇÑ ¿ÍÀϵå Ä«µå¾øÀÌ´Â `/' ¹®ÀÚ¿¡ ¸ÅÄ¡ µÇÁö ¾Ê½À´Ï´Ù. ¿¹¸¦ µé¸é:
<Directory /usr/local/httpd/htdocs> Options Indexes FollowSymLinks </Directory>
Apache 1.2 ¿Í ±×ÀÌ»ó:
È®ÀåµÈ regular expressions À» ~
¹®ÀÚ¿Í ÇÔ²² »ç¿ëµÉ
¼ö ÀÖ½À´Ï´Ù. . ¿¹¸¦ µé¸é:
<Directory ~ "^/www/.*/[0-9]{3}">À̰ÍÀº /www/ ÇÏÀ§¿¡ ÀÖ´Â µð·ºÅ丮Áß 3°³ÀÇ ¼ýÀÚ·Î ±¸¼ºµÈ µð·ºÅ丮¿Í ÀÏÄ¡ ÇÕ´Ï´Ù.
¸¸¾à º¹¼öÀÇ µð·ºÅ丮 ¼½¼Ç¿¡ÀÖ¾î¼(non-regular expression) Àû¿ëµÇ´Â ¼ø¼´Â ·çÆ®(°¡Àå ªÀº µð·ºÅ丮)°¡ °¡Àå ¸ÕÀú Àû¿ëµÇ¸ç ÇÏÀ§µð·ºÅ丮 ¿¡ ´ëÇÑ ¼±¾ðÀ̳ª ÇØ´çµð·ºÅ丮ÀÇ ¾×¼½º(Á¢±Ù)À» Á¦¾îÇÏ´Â ÆÄÀÏ(±âº»°ªÀº .htaccess) ¿¡ ÀÇÇØ¼ ´Ù½Ã Àû¿ëµË´Ï´Ù. ¾Æ·¡ÀÇ ¿¹¸¦ °¡Áö°í ¼³¸íÀ» ÇÏÀÚ¸é,
<Directory />
AllowOverride None
</Directory>
<Directory /home/*>
AllowOverride FileInfo
</Directory>
/home/web/dir/doc.html
¶ó´Â ¹®¼¿¡ ´ëÇØ¼:
AllowOverride None
ÀÌ Àû¿ë(disabling
.htaccess
ÆÄÀÏ¿¡ ÀÇÇØ¼ ¾×¼½º Á¦¾î°¡ ºÒ°¡).
AllowOverride FileInfo
°¡ Àû¿ë (directory
/home/web
¿¡ ´ëÇØ¼) .
/home/web/.htaccess
¿¡ ¼±¾ðµÈ ÆÄÀÏÁ¤º¸¿¡
´ëÇØ¼¸¸ Àû¿ëµÊ
Regular expression directory sections are handled slightly differently by Apache 1.2 and 1.3. In Apache 1.2 they are interspersed with the normal directory sections and applied in the order they appear in the configuration file. They are applied only once, and apply when the shortest match possible occurs. In Apache 1.3 regular expressions are not considered until after all of the normal sections have been applied. Then all of the regular expressions are tested in the order they appeared in the configuration file. For example, with
<Directory ~ abc$>
... directives here ...
</Directory>
Suppose that the filename being accessed is
/home/abc/public_html/abc/index.html
. The server
considers each of /
, /home
, /home/abc
,
/home/abc/public_html
, and /home/abc/public_html/abc
in that order. In Apache 1.2, when
/home/abc
is considered, the regular expression will match
and be applied. In Apache 1.3 the regular expression isn't considered
at all at that point in the tree. It won't be considered until after
all normal <Directory>s and .htaccess
files have
been applied. Then the regular expression will
match on /home/abc/public_html/abc
and be applied.
Note that the default Apache access for <Directory /> is Allow from All. This means that Apache will serve any file mapped from an URL. It is recommended that you change this with a block such as
¾ÆÆÄÄ¡´Â <Directory /> ¿¡¼ ¾×¼½º Á¦¾îÀÇ ±âº»°ªÀ» ¼±¾ð Çϰí ÀÖ½À´Ï´Ù. ¹èÆ÷µÇ´Â httpd.conf ¿¡¼ Allow from All À̶ó°í µÇ¾î Àִµ¥.. À̰ÍÀº ¾î¶² URL ¿¡ ¸ÅÇεǾî ÀÖ´Â ¾î¶² ÆÄÀϵµ Á¦°øÇÑ´Ù´Â °ÍÀ» ÀÇ¹Ì ÇÕ´Ï´Ù. º¸¾È»ó ÀÌ ºÎºÐÀ» ¾Æ·¡¿Í °°ÀÌ ¹Ù²Ù¾î ÁÖ±æ ±ÇÀå ÇÕ´Ï´Ù.
<Directory /> Order Deny,Allow Deny from All </Directory>
±×¸®°í ³ª¼ ¾×¼½º¸¦ Çã¿ëÇÏ´Â µð·ºÅ͸®¸¸ µû·Î ¾×¼½º¸¦ Çã¿ëÇϵµ·Ï ÇÕ´Ï´Ù. Security Tips ¿¡¼ ÀÚ¼¼ÇÑ ¼³¸íÀ» º¸½Ç ¼ö ÀÖ½À´Ï´Ù.
ÀÌ µð·ºÅ͸® ¼½¼ÇÀº ÀüÅëÀûÀ¸·Î access.conf ÆÄÀÏ¿¡¼ ¼±¾ð µË´Ï´Ù. ÇÏÁö¸¸ ¾î¶² ¼³Á¤ÆÄÀÏ¿¡¼µµ »ç¿ëÇÒ ¼ö´Â ÀÖ½À´Ï´Ù. <Directory> ¼±¾ðÀº ÁßÃ¸ÇØ¼ »ç¿ëÇÒ ¼ö ¾øÀ¸¸ç, <Limit> À̳ª <LimitExcept> ¼½¼Ç »çÀÌ¿¡¼´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
<DirectoryMatch> ¿Í </DirectoryMatch> ´Â <Directory>¿Í °°ÀÌ ÁöÁ¤µÈ µð·ºÅ͸®¿Í ±× ÇÏÀ§ µð·ºÅ͸®¿¡ Àû¿ëµÉ ¼±¾ðµéÀ» ±×·ìÁö¾î Áִµ¥ »ç¿ëÇÕ´Ï´Ù. ÀÌ ¼±¾ðÀº Á¤±ÔÇ¥ÇöÀ» Àμö(argument) ·Î »ç¿ëÇÕ´Ï´Ù. ¿¹¸¦ µé¸é,
<DirectoryMatch "^/www/.*/[0-9]{3}">
/www/ ¾Æ·¡¿¡ ÀÖ´Â 3°³ÀÇ ¼ýÀÚ·Î ±¸¼ºµÈ µð·ºÅ͸®¿¡ ¸ÅÄ¡µË´Ï´Ù.
See Also:
<Directory> ( Á¤±ÔÇ¥ÇöÀ» normal <Directory>¿¡¼
È¥ÇÕÇØ¼ »ç¿ëÇÏ´Â ¹æ¹ý¿¡ ´ëÇÑ ¿ä¾à )
See also: How Directory,
Location and Files sections work ( ¿äûÀÌ ÀÖÀ»¶§ ÀÌ ¼·Î´Ù¸¥
¼½¼ÇµéÀÌ ¾î¶»°Ô Á¶ÇÕÀÌ µÇ´ÂÁö¿¡ ´ëÇÑ ¼³¸í )
DocumentRoot
/usr/local/apache/htdocs
ÀÌ ¼±¾ðÀº ¾ÆÆÄÄ¡ À¥ ¼¹ö°¡ Á¦°øÇÒ ¹®¼ÀÇ ÃÖ»óÀ§µð·ºÅ丮¸¦ ÁöÁ¤ÇÕ´Ï´Ù. ¸¸¾à ´ÙÀ½°ú °°ÀÌ ¼±¾ð ÇÏ¿´À» °æ¿ì,
DocumentRoot d:/usr/web
http://www.my.host.com/index.html
¶ó´Â ÁÖ¼Ò·Î
Á¢¼ÓÇÏ´Â °ÍÀº d:/usr/web/index.html
¿¡ ÀÖ´Â
ÆÄÀÏÀ» º¸°Ô µÇ´Â °ÍÀÔ´Ï´Ù.
ÁÖÀÇ ÇÒ °ÍÀº DocumentRoot ¼±¾ð¿¡¼ ¸¶Áö¸·¿¡ µð·ºÅ丮¸¦
±¸ºÐÇÏ´Â ½½·¡½¬('/')¸¦ ¾²Áö ¾Ê´Â ´Ù´Â °ÍÀÔ´Ï´Ù. (i.e., "DocumentRoot
d:/usr/web/" ¿Í °°ÀÌ ¼±¾ð ÇÏ¿´À» °æ¿ì d:/usr/web//index.html
¸¦ ãÀ» ¼ö ¾ø±â ¶§¹®¿¡ ¹ö±× ó·³ º¸Àϼöµµ ÀÖ½À´Ï´Ù.)
¹®°¡ ÀÖ´Â °æ¿ì³ª ¿¡·¯°¡ ¹ß»ý ÇßÀ»¶§, ¾ÆÆÄÄ¡´Â ´ÙÀ½ ³×°¡Áö Áß ÀÇ Çϳª·Î ¼³Á¤µÉ ¼ö ÀÖ½À´Ï´Ù.
ù¹øÂ° ¿É¼ÇÀº ±âº»°ªÀ¸·Î, ¾Æ¹« ¼³Á¤µµ µÇ¾î ÀÖÁö ¾ÊÀ»
°æ¿ì ¾ÆÆÄÄ¡¿¡¼ Ãâ·ÂÇÏ°Ô µË´Ï´Ù. ³ª¸ÓÁö´Â ErrorDocument
¼±¾ðÀ» »ç¿ëÇØ¼ ¼³Á¤ ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ ¼±¾ð µÚ¿¡´Â HTTP response code
¿Í URL ÀÌ µû¶ó¿À°Ô µË´Ï´Ù. ¾ÆÆÄÄ¡´Â ¶§·Î ¹®Á¦/¿¡·¯ ¿¡
´ëÇØ¼ Ãß°¡ÀûÀÎ Á¤º¸¸¦ Á¦°øÇÒ ¼ö ÀÖ½À´Ï´Ù.
URL Àº ½½·¡½¬(/) ·Î ½ÃÀÛÇÏ¿© ·ÎÄÃ(³»ºÎ) ¹®¼¸¦ Âü°íÇϰųª. ¶Ç´Â Àüü URLÀ» »ç¿ëÇÒ ¼öµµ ÀÖ½À´Ï´Ù, ¹«·á È£½ºÆÃ ¼ºñ½º¸¦ Á¦°øÇÏ´Â ¾÷üÀÇ °æ¿ì ÆäÀÌÁö¸¦ ãÀ» ¼ö ¾ø´Â À߸øµÈ URL ¿äûÀ̳ª ¿À·ù¿¡ ´ëÇØ¼ ÀÚ»çÀÇ È¨ÆäÀÌÁö·Î ¼³Á¤À» ÇÏ´Â µîÀ¸·Î ÀÀ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹:
ErrorDocument 500 http://foo.example.com/cgi-bin/tester
ErrorDocument 404 /cgi-bin/bad_urls.pl
ErrorDocument 401 /subscription_info.html
ErrorDocument 403 "Sorry can't allow you access today"
¿ø°Ý(¿ÜºÎ) URL ·Î ¼³Á¤ÇÑ ErrorDocument
¸¦ ÁöÁ¤ÇÒ¶§(http·Î
½ÃÀÛ), ¾ÆÆÄÄ¡´Â Ŭ¶óÀÌ¾ðÆ®¿¡°Ô °°Àº ¼¹ö¿¡ Á¸ÀçÇÏ´Â
¹®¼°¡ ³¡³¯¶§ ±îÁö ¸®µð·ºÆ® µÉ ¹®¼¸¦ ãÀ» ¼ö ÀÖ´Â
À§Ä¡¸¦ ¾Ë·ÁÁÖ°í ÀÖ°Ô µË´Ï´Ù. À̰Ͱú °ü·ÃµÈ ¸î°¡Áö°¡
Àִµ¥ Áß¿äÇÑ °ÍÀº "ErrorDocument 401" ¿¡ ´ëÇØ¼´Â
¹Ýµå´Ï ³»ºÎ ¹®¼¸¦ ÂüÁ¶Çϵµ·Ï ÇØ¾ß ÇÑ´Ù´Â °ÍÀÔ´Ï´Ù.À̰ÍÀº HTTP basic authentication
schemeÀÇ º»Áú ¶§¹®ÀÔ´Ï´Ù.
Prior to version 2.0, messages were indicated by prefixing them with a single unmatched double quote character.
See Also: documentation of customizable responses.
syslog[:facility]
ErrorLog logs/error_log
(Unix)ErrorLog logs/error.log
(Windows and OS/2)¿¡·¯ ·Î±× ¸¦ ±â·ÏÇÏ´Â ÆÄÀÏÀÇ À̸§À» ÁöÁ¤ÇÏ´Â ¼±¾ðÀÔ´Ï´Ù. Àý´ë°æ·Î¸¦ ¾²Áö ¾Ê´Â °æ¿ì¿¡´Â ServerRoot ÀÇ »ó´ëÀûÀÎ °æ·Î ¿¡ ÀÖ´Â ÆÄÀÏ·Î °£ÁÖ µË´Ï´Ù. , ¸¸¾à ÆÄÀÏÀ̸§¿¡ pipe (|) ·Î ½ÃÀÛÇÏ´Â °æ¿ì ¿¡·¯ ·Î±×¸¦ spawn ¿¡¼ ó¸®Çϵµ·Ï ¸í·ÉÇÏ´Â °ÍÀ¸·Î °£ÁÖ µË´Ï´Ù.
Apache 1.3 and above:
Using syslog
instead of a filename enables logging via syslogd(8)
if the system supports it. The default is to use syslog facility
local7
, but you can override this by using the
syslog:
facility syntax where facility can be
one of the names usually documented in syslog(1).
SECURITY: See the security tips document for details on why your security could be compromised if the directory where logfiles are stored is writable by anyone other than the user that starts the server.
See also: LogLevel
The <Files> directive provides for access control by
filename. It is comparable to the <Directory> directive and
<Location> directives. It
should be matched with a </Files> directive. The
directives given within this section will be applied to any
object with a basename (last component of filename) matching
the specified filename.
<Files>
sections are processed in the
order they appear in the configuration file, after the
<Directory> sections and .htaccess
files are
read, but before <Location> sections. Note that
<Files> can be nested inside <Directory>
sections to restrict the portion of the filesystem they
apply to.
The filename argument should include a filename, or a
wild-card string, where `?' matches any single character, and `*' matches any
sequences of characters. Extended regular expressions can also be used,
with the addition of
the ~
character. For example:
<Files ~ "\.(gif|jpe?g|png)$">would match most common Internet graphics formats. In Apache 1.3 and later, <FilesMatch> is preferred, however.
Note that unlike <Directory>
and <Location>
sections,
<Files>
sections can be used inside .htaccess
files. This allows users to control access to their own files, at a
file-by-file level.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
The <FilesMatch> directive provides for access control by filename, just as the <Files> directive does. However, it accepts a regular expression. For example:
<FilesMatch "\.(gif|jpe?g|png)$">
would match most common Internet graphics formats.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is receivedGroup #-1
The Group directive sets the group under which the server will answer requests. In order to use this directive, the stand-alone server must be run initially as root. Unix-group is one of:
nobody
, but this is not always
possible or desirable.Note: if you start the server as a non-root user, it will fail to change to the specified group, and will instead continue to run as the group of the original user.
Special note: Use of this directive in <VirtualHost> requires a properly configured suEXEC wrapper. When used inside a <VirtualHost> in this manner, only the group that CGIs are run as is affected. Non-CGI requests are still processed as the group specified in the main Group directive.
SECURITY: See User for a discussion of the security considerations.
HostNameLookups off
double
available only in
Apache
1.3 and above.on
prior to
Apache 1.3.
This directive enables DNS lookups so that host names can be logged (and
passed to CGIs/SSIs in REMOTE_HOST
).
The value double
refers to doing double-reverse DNS.
That is, after a reverse lookup is performed, a forward lookup is then
performed on that result. At least one of the ip addresses in the forward
lookup must match the original address. (In "tcpwrappers" terminology
this is called PARANOID
.)
Regardless of the setting, when mod_access
is used for controlling access by hostname, a double reverse lookup
will be performed. This is necessary for security. Note that the
result of this double-reverse isn't generally available unless
you set HostnameLookups double
. For example, if only
HostnameLookups on
and a request is made to an object that
is protected by hostname restrictions, regardless of whether the
double-reverse fails or not, CGIs will still be passed the single-reverse
result in REMOTE_HOST
.
The default for this directive was previously on
in
versions of Apache prior to 1.3. It was changed to off
in order to save the network traffic for those sites that don't truly
need the reverse lookups done. It is also better for the end users
because they don't have to suffer the extra latency that a lookup
entails.
Heavily loaded sites should leave this directive off
, since DNS
lookups can take considerable amounts of time. The utility logresolve,
provided in the /support directory, can be used to look up host names
from logged IP addresses offline.
IdentityCheck off
This directive enables RFC1413-compliant logging of the remote user name
for each connection, where the client machine runs identd or something similar.
This information is logged in the access log. Boolean is either
on
or off
.
The information should not be trusted in any way except for rudimentary usage tracking.
Note that this can cause serious latency problems accessing your server since every request requires one of these lookups to be performed. When firewalls are involved each lookup might possibly fail and add 30 seconds of latency to each hit. So in general this is not very useful on public servers accessible from the Internet.
The <IfDefine test>...</IfDefine> section is used to mark directives that are conditional. The directives within an IfDefine section are only processed if the test is true. If test is false, everything between the start and end markers is ignored.
The test in the <IfDefine> section directive can be one of two forms:
!
parameter-name
In the former case, the directives between the start and end markers are only processed if the parameter named parameter-name is defined. The second format reverses the test, and only processes the directives if parameter-name is not defined.
The parameter-name argument is a define as given on the
httpd
command line via -D
parameter-, at the
time the server was started.
<IfDefine> sections are nest-able, which can be used to implement simple multiple-parameter tests. Example:
$ httpd -DReverseProxy ... # httpd.conf <IfDefine ReverseProxy> LoadModule rewrite_module libexec/mod_rewrite.so LoadModule proxy_module libexec/libproxy.so </IfDefine>
The <IfModule test>...</IfModule> section is used to mark directives that are conditional. The directives within an IfModule section are only processed if the test is true. If test is false, everything between the start and end markers is ignored.
The test in the <IfModule> section directive can be one of two forms:
In the former case, the directives between the start and end markers are only processed if the module named module name is compiled in to Apache. The second format reverses the test, and only processes the directives if module name is not compiled in.
The module name argument is a module name as given as the file
name of the module, at the time it was compiled. For example,
mod_rewrite.c
.
<IfModule> sections are nest-able, which can be used to implement simple multiple-module tests.
ÀÌ ¼±¾ðÀº C/C++ °ú °°Àº ¾ð¾î ¿¡¼ ó·³ ¼¹ö¼³Á¤ÆÄÀÏ ¾ÈÀ¸·Î ´Ù¸¥ ¼³Á¤ ÆÄÀÏÀ» Æ÷ÇÔÇÒ ¼ö ÀÖµµ·Ï ÇÏ´Â ¼±¾ð ÀÔ´Ï´Ù.
KeepAlive 5
KeepAlive On
ÀÌ ¼±¾ðÀº Keep-Alive Áö¿øÀ» °¡´ÉÇÏ°Ô ÇÏ´Â ¼±¾ð ÀÔ´Ï´Ù..
Apache 1.1: Set max-requests
to the maximum number of requests you want Apache to entertain per
request. A limit is imposed to prevent a client from hogging your
server resources. Set this to 0
to disable support.
Apache 1.2 and later: Set to "On" to enable persistent connections, "Off" to disable. See also the MaxKeepAliveRequests directive.
KeepAliveTimeout 15
ÀÌ ¼±¾ðÀº ¸î ÃÊ µ¿¾È Ä¿³Ø¼ÇÀ» ´Ý±â Àü¿¡ ÇÏÀ§ ¿äûÀ»
±â´Ù¸± °ÍÀÎÁö¿¡ ´ëÇÑ ¼±¾ð ÀÔ´Ï´Ù. Çѹø ¿äûÀÌ ¹Þ¾Æ µé¿©
Áö¸é Timeout
¼±¾ð¿¡¼ ÁöÁ¤µÈ
½Ã°£Á¦ÇÑ °ªÀÌ Àû¿ëµË´Ï´Ù.
º¸Åë ¾×¼½º Á¦¾î´Â ¸ðµç ¾×¼½º
¹æ¹ý(method )¿¡ ´ëÇÏ¿© Àû¿ë½Ãŵ´Ï´Ù. ÀÌ·±
ÀϹÝÀûÀÎ °æ¿ì¿¡´Â
<limit>
¼½¼Ç¿¡¼ ¾×¼½º Á¦¾î ¼±¾ðÀ» ÇÒ
Çʿ䰡 ¾ø½À´Ï´Ù.
<Limit> ¼±¾ðÀÇ ¸ñÀûÀº ÁöÁ¤µÈ(nominated) HTTP methods ¸¦ Á¦ÇÑÇϱâ À§ÇÑ °ÍÀÔ´Ï´Ù. <Limit> À¸·Î µÑ·¯½×ÀÎ ÇØ´ç methods µéÀº ¾Æ¹«·± È¿°ú¸¦ °®Áö ¸øÇÕ´Ï´Ù. ´ÙÀ½ÀÇ ¿¹´Â POST, PUT, ±×¸®°í DELETE ¶ó´Â ¸Þ½áµå¿¡ ´ëÇØ¼ valid-user ¿¡°Ô¸¸ Çã¿ëÇϸç, ´Ù¸¥ ¸Þ½áµåµéÀº º¸È£µÇÁö ¾ÊÀº ä·Î ³²°ÜÁ® ÀÖ°Ô µË´Ï´Ù.
¸Þ½áµå À̸§ ¸ñ·Ï : GET, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, and UNLOCK. Method name Àº ´ë¼Ò¹®ÀÚ¸¦ ±¸ºÐÇÕ´Ï´Ù. If ¸¸¾à GET ÀÌ »ç¿ëµÇ¾ú´Ù¸é ¶ÇÇÑ HEAD requests ¸¦ Á¦ÇÑ ÇÕ´Ï´Ù.
<Limit POST PUT DELETE>
require valid-user
</Limit>
<LimitExcept> and </LimitExcept> are used to enclose a group of access control directives which will then apply to any HTTP access method not listed in the arguments; i.e., it is the opposite of a <Limit> section and can be used to control both standard and nonstandard/unrecognized methods. See the documentation for <Limit> for more details.
LimitRequestBody 0
Number is a long integer from 0 (meaning unlimited) to 2147483647
(2GB). The default value is defined by the compile-time constant
DEFAULT_LIMIT_REQUEST_BODY
(0 as distributed).
The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource. CGI scripts typically use the message body for passing form information to the server. Implementations of the PUT method will require a value at least as large as any representation that the server wishes to accept for that resource.
This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.
LimitRequestFields 100
Number is an integer from 0 (meaning unlimited) to 32767.
The default value is defined by the compile-time constant
DEFAULT_LIMIT_REQUEST_FIELDS
(100 as distributed).
The LimitRequestFields directive allows the server administrator to modify the limit on the number of request header fields allowed in an HTTP request. A server needs this value to be larger than the number of fields that a normal client request might include. The number of request header fields used by a client rarely exceeds 20, but this may vary among different client implementations, often depending upon the extent to which a user has configured their browser to support detailed content negotiation. Optional HTTP extensions are often expressed using request header fields.
This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks. The value should be increased if normal clients see an error response from the server that indicates too many fields were sent in the request.
LimitRequestFieldsize 8190
Number is an integer size in bytes from 0 to the value of the
compile-time constant DEFAULT_LIMIT_REQUEST_FIELDSIZE
(8190 as distributed).
The LimitRequestFieldsize directive allows the server administrator to reduce the limit on the allowed size of an HTTP request header field below the normal input buffer size compiled with the server. A server needs this value to be large enough to hold any one header field from a normal client request. The size of a normal request header field will vary greatly among different client implementations, often depending upon the extent to which a user has configured their browser to support detailed content negotiation.
This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks. Under normal conditions, the value should not be changed from the default.
LimitRequestLine 8190
Number is an integer size in bytes from 0 to the value of the
compile-time constant DEFAULT_LIMIT_REQUEST_LINE
(8190 as distributed).
The LimitRequestLine directive allows the server administrator to reduce the limit on the allowed size of a client's HTTP request-line below the normal input buffer size compiled with the server. Since the request-line consists of the HTTP method, URI, and protocol version, the LimitRequestLine directive places a restriction on the length of a request-URI allowed for a request on the server. A server needs this value to be large enough to hold any of its resource names, including any information that might be passed in the query part of a GET request.
This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks. Under normal conditions, the value should not be changed from the default.
The Listen directive instructs Apache to listen to more than one IP
address or port; by default it responds to requests on all IP
interfaces, but only on the port given by the Port
directive.
Note that you may still require a Port directive so that URLs that Apache generates that point to your server still work.
Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.
For example, to make the server accept connections on both port 80 and port 8000, use:
Listen 80 Listen 8000To make the server accept connections on two specified interfaces and port numbers, use
Listen 192.170.2.1:80 Listen 192.170.2.5:8000
See Also:
DNS Issues
See Also:
Setting which addresses and ports Apache uses
See Also:
Known Bugs
ListenBacklog 511
The maximum length of the queue of pending connections. Generally no
tuning is needed or desired, however on some systems it is desirable
to increase this when under a TCP SYN flood attack. See
the backlog parameter to the listen(2)
system call.
This will often be limited to a smaller number by the operating system. This varies from OS to OS. Also note that many OSes do not use exactly what is specified as the backlog, but use a number based on (but normally larger than) what is set.
The <Location> ¼±¾ðÀº URL ¿¡ ´ëÇÑ ¾×¼½º¸¦
Á¦¾î ÇÕ´Ï´Ù. À̰ÍÀº <Directory> ¼±¾ð°ú À¯»çÇÕ´Ï´Ù. ±×¸®°í </Location>
directive(¼±¾ð) À¸·Î Á¾°á½Ãŵ´Ï´Ù. <Location>
¼½¼ÇÀº ¼³Á¤ÆÄÀÏ¿¡¼ ¾²À̸ç,
<Directory> sections °ú .htaccess
files À» ÀÐ¾î µéÀ̰í,
<Files> ¼½¼ÇÀ» ó¸®ÇÏ°í ³ ´ÙÀ½¿¡ ¼öÇàµË´Ï´Ù.
URL Àº ÆÄÀϽýºÅÛ°ú ÀüÇô »ó°üÀÌ ¾ø½À´Ï´Ù. À̰ÍÀº <Location> ¿¬»êÀÌ ¿ÏÀüÈ÷ ÆÄÀϽýºÅÛÀÇ ¿ÜºÎ¿¡¼ ÀÌ·ç¾î Áø´Ù´Â °ÍÀ» °Á¶ÇÕ´Ï´Ù.
¸ðµç ¿äûÀÇ ±â¿ø(non-proxy)¿¡¼, URLÀº /path/
·Î ºÎÅÍ ¸ÅÄ¡°¡ µË´Ï´Ù. ±×¸®°í ¾î¶² http://servername
Á¢µÎ»ç(prefix)¸¦ ¾µ ¼ö´Â ¾ø½À´Ï´Ù. ÇÁ¶ô½Ã ¿äû¿¡ ´ëÇØ¼ URL
˼ scheme://servername/path
¿Í °°Àº Çü½ÄÀ¸·Î
¸ÅÄ¡½Ãų¼ö ÀÖÀ¸¸ç ¹Ýµå½Ã prefix(Á¢µÎ»ç)¸¦ Æ÷ÇÔÇØ¾ß ÇÕ´Ï´Ù.
URL ¿¡´Â ¿ÍÀ̵éÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ? ´Â ÇϳªÀÇ ¹®ÀÚ¿¡ , * ´Â ÇϳªÀÌ»óÀÇ ¹®ÀÚ¿Í ¸ÅÄ¡ µË´Ï´Ù.
Apache 1.2 and above: ~ ¸¦ »ç¿ëÇØ¼ Á¤±Ô Ç¥Çö½ÄÀ¸·Î È®Àå ÇØ¼ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦µé¸é,
<Location ~ "/(extra|special)/data">
À̰ÍÀº "/extra/data" ¶Ç´Â "/special/data" À̶ó´Â URL°ú
¸ÅÄ¡ µË´Ï´Ù. Apache 1.3 À̻󿡼ÀÇ Á¤±ÔÇ¥Çö½ÄÀ»
»ç¿ëÇÒ¶§´Â <LocationMatch>
¼±¾ðÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.(
<Location>
ÀÇ Á¤±ÔÇ¥Çö ¹öÀü.)
The Location
functionality is especially useful when
combined with the SetHandler
directive. For example,
to enable status requests, but allow them only
from browsers at foo.com, you might use:
Location
±â´ÉÀº Ưº°È÷ SetHandler
¼±¾ð°ú °°ÀÌ
»ç¿ëÇÒ¶§ À¯¿ëÇÕ´Ï´Ù. ¿¹¸¦ µé¸é status ¿äû¿¡ ´ëÇÑ ¿¹¸¦
µé¸é, foo.com ¿¡¼ÀÇ ºê¶ó¿ì¡¿¡ ´ëÇØ¼¸¸ Çã¿ëÇÏ·Á°í
ÇÑ´Ù¸é, ´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÒ °ÍÀÔ´Ï´Ù.
<Location /status> SetHandler server-status order deny,allow deny from all allow from .foo.com </Location>
Apache 1.3 À̻󿡼 / (½½·¡½¬) ¿¡ ´ëÇÑ ÁÖÀÇ: The slash
character has special
meaning depending on where in a URL it appears. People may be used
to its behaviour in the filesystem where multiple adjacent slashes are
frequently collapsed to a single slash (i.e., /home///foo
is the same as /home/foo
). In URL-space this is not
necessarily true. The <LocationMatch>
directive
and the regex version of <Location>
require you
to explicitly specify multiple slashes if that is your intention.
For example, <LocationMatch ^/abc>
would match the
request URL /abc
but not the request URL //abc
.
The (non-regex) <Location>
directive behaves
similarly when used for proxy requests. But when (non-regex)
<Location>
is used for non-proxy requests it will
implicitly match multiple slashes with a single slash. For example,
if you specify <Location /abc/def>
and the request
is to /abc//def
then it will match.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is received
<LocationMatch> ¼±¾ðÀº URL ¿¡ ÀÇÇÑ ¾×¼½º Á¦¾î¸¦ Á¦°øÇϸç, <Location>°ú µ¿ÀÏÇÑ ¹Ú½Ä ÀÔ´Ï´Ù. ¾î°µç ÀÌ ¼±¾ðÀº ´Ü¼øÇÑ ¹®ÀÚ¿ ´ë½Å Á¤±ÔÇ¥Çö(regex) À» »ç¿ëÇØ¼ ¼±¾ðÇÕ´Ï´Ù. ¿¹¸¦ µé¸é:
<LocationMatch "/(extra|special)/data">
"/extra/data" À̳ª "/special/data" ¿¡ ¸ÅĪ µË´Ï´Ù.
See also: How Directory, Location and Files sections work for an explanation of how these different sections are combined when a request is receivedLockFile logs/accept.lock
The LockFile directive sets the path to the lockfile used when
Apache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be
left at its default value. The main reason for changing it is if
the logs
directory is NFS mounted, since the lockfile
must be stored on a local disk. The PID of the main
server process is automatically appended to the filename.
SECURITY: It is best to avoid putting this file in a
world writable directory such as /var/tmp
because someone
could create a denial of service attack and prevent the server from
starting by creating a lockfile with the same name as the one the
server will try to create.
LogLevel error
LogLevel adjusts the verbosity of the messages recorded in the error logs (see ErrorLog directive). The following levels are available, in order of decreasing significance:
Level | Description |
---|---|
Example | |
emerg
| Emergencies - system is unusable. |
"Child cannot open lock file. Exiting" | |
alert
| Action must be taken immediately. |
"getpwuid: couldn't determine user name from uid" | |
crit
| Critical Conditions. |
"socket: Failed to get a socket, exiting child" | |
error
| Error conditions. |
"Premature end of script headers" | |
warn
| Warning conditions. |
"child process 1234 did not exit, sending another SIGHUP" | |
notice
| Normal but significant condition. |
"httpd: caught SIGBUS, attempting to dump core in ..." | |
info
| Informational. |
"Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers)..." | |
debug
| Debug-level messages |
"Opening config file ..." |
When a particular level is specified, messages from all other levels
of higher significance will be reported as well. E.g., when
LogLevel info
is specified, then messages with log levels of
notice
and warn
will also be posted.
Using a level of at least crit
is recommended.
MaxClients 256
The MaxClients directive sets the limit on the number of simultaneous requests that can be supported; not more than this number of child server processes will be created. To configure more than 256 clients, you must edit the HARD_SERVER_LIMIT entry in httpd.h and recompile.
Any connection attempts over the MaxClients limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced.
MaxKeepAliveRequests 100
The MaxKeepAliveRequests directive limits the number of requests
allowed per connection when KeepAlive is
on. If it is set to "0
", unlimited requests will be
allowed. We recommend that this setting be kept to a high value for
maximum server performance.
MaxRequestsPerChild 0
The MaxRequestsPerChild directive sets the limit on the number of requests that an individual child server process will handle. After MaxRequestsPerChild requests, the child process will die. If MaxRequestsPerChild is 0, then the process will never expire.
Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
This directive has no effect on Win32.
NOTE: For KeepAlive requests, only the first request is counted towards this limit. In effect, it changes the behavior to limit the number of connections per child.
MaxSpareServers 10
The MaxSpareServers directive sets the desired maximum number of idle child server processes. An idle process is one which is not handling a request. If there are more than MaxSpareServers idle, then the parent process will kill off the excess processes.
Tuning of this parameter should only be necessary on very busy sites. Setting this parameter to a large number is almost always a bad idea.
This directive has no effect when used with the Apache Web server on a Microsoft Windows platform.
See also MinSpareServers and StartServers.
MinSpareServers 5
The MinSpareServers directive sets the desired minimum number of idle child server processes. An idle process is one which is not handling a request. If there are fewer than MinSpareServers idle, then the parent process creates new children at a maximum rate of 1 per second.
Tuning of this parameter should only be necessary on very busy sites. Setting this parameter to a large number is almost always a bad idea.
This directive has no effect on Microsoft Windows.
See also MaxSpareServers and StartServers.
The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts.
Although addr can be hostname it is recommended that you always use an IP address, e.g.
NameVirtualHost 111.22.33.44
With the NameVirtualHost directive you specify the address to which your
name-based virtual host names resolve. If you have multiple name-based
hosts on multiple addresses, repeat the directive for each address.Note: the "main server" and any _default_ servers will never be served for a request to a NameVirtualHost IP Address (unless for some reason you specify NameVirtualHost but then don't define any VirtualHosts for that address).
Optionally you can specify a port number on which the name-based virtual hosts should be used, e.g.
NameVirtualHost 111.22.33.44:8080
See also:
Apache Virtual Host documentation
ÀÌ Options ¼±¾ðÀº °¢°¢ÀÇ µð·ºÅ丮ÀÇ ±â´ÉÀ» Á¦¾îÇÕ´Ï´Ù.
option À» None
,À¸·Î ÁöÁ¤Çϸé, ¾Æ¹«±â´Éµµ
»ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù. ¾Æ·¡´Â ¿É¼ÇÀ¸·Î ÁÖ¾î Áú¼ö ÀÖ´Â °ªµé
À̸ç, +/- ¸¦ »ç¿ëÇÒ ¼ö ÀÖ°í, Áߺ¹Çؼ »ç¿ëÇÒ ¼ö µµ
ÀÖ½À´Ï´Ù.
<Directory>
sections ¿¡ ´ëÀÀÇÏ´Â °æ·Î´Â ¹Ù²îÁö ¾Ê½À´Ï´Ù..
Normally, if multiple Options
could apply to a directory,
then the most specific one is taken complete; the options are not
merged. However if all the options on the Options
directive are preceded by a + or - symbol, the options are
merged. Any options preceded by a + are added to the options
currently in force, and any options preceded by a - are removed from
the options currently in force.
+/- ±âÈ£¸¦ »ç¿ëÇÏÁö ¾ÊÀº ¿¹ÀÔ´Ï´Ù.:
<Directory /web/docs>
Options Indexes FollowSymLinks
</Directory>
<Directory /web/docs/spec>
Options Includes
</Directory>
ÀÌ·±°á¿ì ´ÜÁö Includes
±â´É¸¸ /web/docs/spec
µð·ºÅ͸®¿¡¼ ÁöÁ¤µÇ¾ú½À´Ï´Ù. ¾î°µç µÎ¹øÂ° ¼±¾ðµÇ´Â
¿É¼ÇÀº ´ÙÀ½ÀÇ ¿¹¿¡¼ ó·³ +/- ¸¦ »ç¿ëÇØ¾ß ÇÕ´Ï´Ù.:
<Directory /web/docs>
Options Indexes FollowSymLinks
</Directory>
<Directory /web/docs/spec>
Options +Includes -Indexes
</Directory>
À̰æ¿ì FollowSymLinks
¿Í Includes
±â´ÉÀÌ /web/docs/spec directory ¿¡ ÁÖ¾î Á³½À´Ï´Ù..
Note: Using -IncludesNOEXEC
³ª
-Includes
ÀÇ »ç¿ëÀº ºÒ°¡´É ÇÕ´Ï´Ù. SSI(server-side includes)´Â ÀÌÀüÀÇ
¼ÂÆÃ°ú´Â ¾Æ¹«·± »ó°üÀÌ ¾ø½À´Ï´Ù.
¾Æ¹«·± ¼±¾ðÀÌ ¾ø´Â
°æ¿ì, ±âº»°ªÀÎ All
·Î ¼ÂÆÃµÇ¾î Áö°Ô
µË´Ï´Ù.
PidFile logs/httpd.pid
ÀÌ ¼±¾ðÀº µ¥¸ó ÇÁ·Î±×·¥ÀÇ ÇÁ·Î¼¼½º ¾ÆÀ̵𸦠±â·ÏÇØ ³õ´Â ÆÄÀÏÀ» ÁöÁ¤ÇÏ´Â °ÍÀÔ´Ï´Ù.
The PidFile directive sets the file to which the server records the process id of the daemon. If the filename does not begin with a slash (/) then it is assumed to be relative to the ServerRoot. The PidFile is only used in standalone mode.
It is often useful to be able to send the server a signal, so that it closes and then reopens its ErrorLog and TransferLog, and re-reads its configuration files. This is done by sending a SIGHUP (kill -1) signal to the process id listed in the PidFile.
The PidFile is subject to the same warnings about log file placement and security.
Port 80
Number ´Â 0 ¿¡¼ 65535 ±îÁöÀÇ ¼ýÀÚ¸¦ »ç¿ëÇÒ ¼ö
ÀÖ½À´Ï´Ù.; 80 À» ±âº»°ªÀ¸·Î °®Áö¸¸ 1024 ¿Í °°ÀÌ Æ÷Æ®¹øÈ£¸¦
´Ù¸£°Ô ÇÒ ¼öµµ ÀÖ½À´Ï´Ù. c:\windows\services
ÆÄÀÏ(È®ÀåÀÚ
¾øÀ½)À» º¸¸é ¸î°¡Áö Á¤ÀÇµÈ Æ÷Æ®¹øÈ£°¡ ³ª¿µÇ¾î ÀÖ½À´Ï´Ù.
À̰÷¿¡ Á¤ÀÇµÈ Æ÷Æ®¹øÈ£¸¦ Á¦¿ÜÇϰí´Â ¾î´À ¹øÈ£¶óµµ »ç¿ë
°¡´ÉÇÕ´Ï´Ù.
The Port directive has two behaviors, the first of which is necessary for NCSA backwards compatibility (and which is confusing in the context of Apache).
:number
then Port has no effect on what address the server
listens at.
SERVER_PORT
environment variable (for
CGI and SSI),
and is used when the server must generate a URL that refers to itself
(for example when creating an external redirect to itself). This
behaviour is modified by
UseCanonicalName.
The primary behaviour of Port should be considered to be similar to that of the ServerName directive. The ServerName and Port together specify what you consider to be the canonical address of the server. (See also UseCanonicalName.)
Port 80 is one of Unix's special ports. All ports numbered below 1024 are reserved for system use, i.e., regular (non-root) users cannot make use of them; instead they can only use higher port numbers. To use port 80, you must start the server from the root account. After binding to the port and before accepting requests, Apache will change to a low privileged user as set by the User directive.
If you cannot use port 80, choose any other unused port. Non-root users will have to choose a port number higher than 1023, such as 8000.
SECURITY: if you do start the server as root, be sure not to set User to root. If you run the server as root whilst handling connections, your site may be open to a major security attack.
ÀÌ ¼±¾ðÀº µð·ºÅ丮¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Â ÀÎÁõµÈ »ç¿ëÀÚ¸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. :
´ÜÁö À̰÷¿¡ ÁöÁ¤µÈ À̸§À» °¡Áø »ç¿ëÀÚ¸¸ÀÌ ÇØ´ç µð·ºÅ丮¿¡ Á¢±Ù°¡´É ÇÕ´Ï´Ù.
¡¡
´ÜÁö À̰÷¿¡ ÁöÁ¤µÈ ±×·ì¿¡ ¼ÓÇÑ »ç¿ëÀÚ¸¸ÀÌ ÇØ´ç µð·ºÅ丮¿¡ Á¢±Ù °¡´ÉÇÕ´Ï´Ù..
Ÿ´çÇÑ »ç¿ëÀÚ¸¸ ÇØ´ç µð·ºÅ丮¿¡ Á¢±Ù °¡´ÉÇÕ´Ï´Ù.
Require Àº ¹Ýµå½Ã must be accompanied by AuthName °ú AuthType ¼±¾ðÀ» µ¿¹ÝÇØ¾ß ÇÕ´Ï´Ù., ±×¸®°í AuthUserFile °ú AuthGroupFile °ú °°Àº ¼±¾ðÀº(»ç¿ëÀÚ¿Í »ç¿ëÀÚ ±×·ìÀ» Á¤ÀÇ) Á¤È®ÇÏ°Ô ÀÛµ¿ÇÏ´Â ¼ø¼´ë·Î ¼±¾ð ÇÕ´Ï´Ù. ¿¹¸¦ µé¸é:
AuthType Basic
AuthName "Restricted Directory"
AuthUserFile /web/users
AuthGroupFile /web/groups
require group admin
Access controls which are applied in this way are effective for
all methods. This is what is normally
desired. If you wish to apply access controls only to
specific methods, while leaving other methods unprotected, then place
the require
statement into a <Limit> section
See also Satisfy and mod_access.
ResourceConfig conf/srm.conf
The server will read this file for more directives after reading the httpd.conf file. Filename is relative to the ServerRoot. This feature can be disabled using:
ResourceConfig /dev/null
Historically, this file contained most directives except for server
configuration directives and <Directory>
sections; in fact it can now contain any server directive allowed in the
server config context.See also AccessConfig.
Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. Raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.
This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.
CPU resource limits are expressed in seconds per process.
See also RLimitMEM or RLimitNPROC.
Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. Raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.
This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.
Memory resource limits are expressed in bytes per process.
See also RLimitCPU or RLimitNPROC.
Takes 1 or 2 parameters. The first parameter sets the soft resource limit for all processes and the second parameter sets the maximum resource limit. Either parameter can be a number, or max to indicate to the server that the limit should be set to the maximum allowed by the operating system configuration. Raising the maximum resource limit requires that the server is running as root, or in the initial startup phase.
This applies to processes forked off from Apache children servicing requests, not the Apache children themselves. This includes CGI scripts and SSI exec commands, but not any processes forked off from the Apache parent such as piped logs.
Process limits control the number of processes per user.
Note: If CGI processes are not running under userids other than the web server userid, this directive will limit the number of processes that the server itself can create. Evidence of this situation will be indicated by cannot fork messages in the error_log.
See also RLimitMEM or RLimitCPU.
Access policy if both allow and require used. The parameter can be either 'all' or 'any'. This directive is only useful if access to a particular area is being restricted by both username/password and client host address. In this case the default behavior ("all") is to require that the client passes the address access restriction and enters a valid username and password. With the "any" option the client will be granted access if they either pass the host restriction or enter a valid username and password. This can be used to password restrict an area, but to let clients from particular addresses in without prompting for a password.
See also require and mod_access.
ScoreBoardFile logs/apache_status
The ScoreBoardFile directive is required on some architectures to place a file that the server will use to communicate between its children and the parent. The easiest way to find out if your architecture requires a scoreboard file is to run Apache and see if it creates the file named by the directive. If your architecture requires it then you must ensure that this file is not used at the same time by more than one invocation of Apache.
If you have to use a ScoreBoardFile then you may see improved speed by placing it on a RAM disk. But be careful that you heed the same warnings about log file placement and security.
Apache 1.2 and above:
Linux 1.x users might be able to add
-DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD
to
the EXTRA_CFLAGS
in your Configuration
. This
might work with some 1.x installations, but won't work with all of
them. (Prior to 1.3b4, HAVE_SHMGET
would have sufficed.)
SVR4 users should consider adding
-DHAVE_SHMGET -DUSE_SHMGET_SCOREBOARD
to the
EXTRA_CFLAGS
in your Configuration
. This
is believed to work, but we were unable to test it in time for 1.2
release. (Prior to 1.3b4, HAVE_SHMGET
would have sufficed.)
See Also: Stopping and Restarting Apache
ScriptInterpreterSource script
This directive is used to control how Apache 1.3.5 and later finds the interpreter used to run CGI scripts. The default technique is to use the interpreter pointed to by the #! line in the script. Setting ScriptInterpreterSource registry will cause the Windows Registry to be searched using the script file extension (e.g., .pl) as a search key.
The server will set the TCP buffer size to the number of bytes specified. Very useful to increase past standard OS defaults on high speed high latency (i.e., 100ms or so, such as transcontinental fast pipes)
The ServerAdmin sets the e-mail address that the server includes in any error messages it returns to the client.
It may be worth setting up a dedicated address for this, e.g.
ServerAdmin www-admin@foo.bar.com
as users do not always mention that they are talking about the server!The ServerAlias directive sets the alternate names for a host, for use with name-based virtual hosts.
See also: Apache Virtual Host documentation
The ServerName directive sets the hostname of the server; this is used when creating redirection URLs. If it is not specified, then the server attempts to deduce it from its own IP address; however this may not work reliably, or may not return the preferred hostname. For example:
ServerName www.example.com
would be used if the canonical (main) name of the actual machine
were simple.example.com
.
If you are using name-based
virtual hosts, the ServerName
inside a
<VirtualHost>
section specifies what hostname must appear in the request's
Host:
header to match this virtual host.
See Also:
DNS Issues
Apache virtual host documentation
UseCanonicalName
NameVirtualHost
ServerAlias
The ServerPath directive sets the legacy URL pathname for a host, for use with name-based virtual hosts.
See also: Apache Virtual Host documentation
ServerRoot /usr/local/apache
The ServerRoot directive sets the directory in which the server lives.
Typically it will contain the subdirectories conf/
and
logs/
. Relative paths for other configuration files are taken
as relative to this directory.
See also the -d
option to httpd.
See also the security tips for information on how to properly set permissions on the ServerRoot.
ServerSignature Off
The ServerSignature directive allows the configuration of a trailing
footer line under server-generated documents (error messages,
mod_proxy ftp directory listings, mod_info output, ...). The reason
why you would want to enable such a footer line is that in a chain
of proxies, the user often has no possibility to tell which of the
chained servers actually produced a returned error message.
The Off setting, which is the default, suppresses the
error line (and is therefore compatible with the behavior of
Apache-1.2 and below). The On setting simply adds a
line with the server version number and ServerName of the serving virtual host, and
the EMail setting additionally creates a "mailto:"
reference to the ServerAdmin of the
referenced document.
ServerTokens Full
ProductOnly
keyword is
only available in versions later than 1.3.12
This directive controls whether Server response header field which is sent back to clients includes a description of the generic OS-type of the server as well as information about compiled-in modules.
ServerTokens Prod[uctOnly]
ServerTokens Min[imal]
ServerTokens OS
ServerTokens Full
(or not specified)
This setting applies to the entire server, and cannot be enabled or disabled on a virtualhost-by-virtualhost basis.
ServerType standalone
The ServerType directive sets how the server is executed by the system. Type is one of
/etc/inetd.conf
/etc/rc.local
or
/etc/rc3.d/...
.)
Standalone is the most common setting for ServerType since it is far more efficient. The server is started once, and services all subsequent connections. If you intend running Apache to serve a busy site, standalone will probably be your only option.
StartServers 5
The StartServers directive sets the number of child server processes created on startup. As the number of processes is dynamically controlled depending on the load, there is usually little reason to adjust this parameter.
When running under Microsoft Windows, this directive has no effect. There is always one child which handles all requests. Within the child requests are handled by separate threads. The ThreadsPerChild directive controls the maximum number of child threads handling requests, which will have a similar effect to the setting of StartServers on Unix.
See also MinSpareServers and MaxSpareServers.
ThreadsPerChild 50
This directive tells the server how many threads it should use. This is the maximum number of connections the server can handle at once; be sure and set this number high enough for your site if you get a lot of hits.
This directive has no effect on Unix systems. Unix users should look at StartServers and MaxRequestsPerChild.
ThreadStackSize 65536
This directive tells the server what stack size to use for each of the running threads. If you ever get a stack overflow you will need to bump this number to a higher setting.
This directive has no effect on other systems.
TimeOut 300
The TimeOut directive currently defines the amount of time Apache will wait for three things:
UseCanonicalName on
In many situations Apache has to construct a self-referential
URL. That is, a URL which refers back to the same server.
With UseCanonicalName on
(and in all versions prior to
1.3) Apache will use the ServerName and Port directives to construct a canonical name for the
server. This name is used in all self-referential URLs, and for the
values of SERVER_NAME
and SERVER_PORT
in CGIs.
With UseCanonicalName off
Apache will form
self-referential URLs using the hostname and port supplied
by the client if any are supplied (otherwise it will use the
canonical name). These values are the same that are used to
implement name based virtual
hosts, and are available with the same clients. The CGI variables
SERVER_NAME
and SERVER_PORT
will be constructed
from the client supplied values as well.
An example where this may be useful is on an intranet server where
you have users connecting to the machine using short names such as
www
. You'll notice that if the users type a shortname,
and a URL which is a directory, such as http://www/splat
,
without the trailing slash then Apache will redirect them to
http://www.domain.com/splat/
. If you have authentication
enabled, this will cause the user to have to reauthenticate twice (once
for www
and once again for www.domain.com
).
But if UseCanonicalName
is set off, then Apache will redirect
to http://www/splat/
.
There is a third option, UseCanonicalName DNS
, which
is intended for use with mass IP-based virtual hosting to support
ancient clients that do not provide a Host:
header. With
this option Apache does a reverse DNS lookup on the server IP address
that the client connected to in order to work out self-referential URLs.
Warning: if CGIs make assumptions about the values of
SERVER_NAME
they may be broken by this option. The client
is essentially free to give whatever value they want as a hostname.
But if the CGI is only using SERVER_NAME
to construct
self-referential URLs then it should be just fine.
See also: ServerName, Port
User #-1
The User directive sets the userid as which the server will answer requests. In order to use this directive, the standalone server must be run initially as root. Unix-userid is one of:
nobody
, but this is not always possible or desirable.
For example mod_proxy's cache, when enabled, must be accessible to this user
(see the CacheRoot
directive).Notes: If you start the server as a non-root user, it will fail to change to the lesser privileged user, and will instead continue to run as that original user. If you do start the server as root, then it is normal for the parent process to remain running as root.
Special note: Use of this directive in <VirtualHost> requires a properly configured suEXEC wrapper. When used inside a <VirtualHost> in this manner, only the user that CGIs are run as is affected. Non-CGI requests are still processed with the user specified in the main User directive.
SECURITY: Don't set User (or Group) to
root
unless you know exactly what you are doing, and what the
dangers are.
<VirtualHost> and </VirtualHost> are used to enclose a group of directives which will apply only to a particular virtual host. Any directive which is allowed in a virtual host context may be used. When the server receives a request for a document on a particular virtual host, it uses the configuration directives enclosed in the <VirtualHost> section. Addr can be
<VirtualHost 10.1.2.3>
ServerAdmin webmaster@host.foo.com
DocumentRoot /www/docs/host.foo.com
ServerName host.foo.com
ErrorLog logs/host.foo.com-error_log
TransferLog logs/host.foo.com-access_log
</VirtualHost>
Each VirtualHost must correspond to a different IP address, different port
number or a
different host name for the server, in the latter case the server
machine must be configured to accept IP packets for multiple
addresses. (If the machine does not have multiple network interfaces,
then this can be accomplished with the ifconfig alias
command (if your OS supports it), or with kernel patches like VIF (for SunOS(TM) 4.1.x)).
The special name _default_
can be specified in which case
this virtual host will match any IP address that is not explicitly listed
in another virtual host. In the absence of any _default_ virtual host
the "main" server config, consisting of all those definitions outside
any VirtualHost section, is used when no match occurs.
You can specify a :port
to change the port that is matched.
If unspecified then it defaults to the same port as the most recent
Port
statement of the main server. You
may also specify :*
to match all ports on that address.
(This is recommended when used with _default_
.)
SECURITY: See the security tips document for details on why your security could be compromised if the directory where logfiles are stored is writable by anyone other than the user that starts the server.
NOTE: The use of <VirtualHost> does not affect what addresses Apache listens on. You may need to ensure that Apache is listening on the correct addresses using either BindAddress or Listen.
See also:
Apache Virtual Host documentation
See also:
Warnings about DNS and Apache
See also:
Setting which addresses and ports Apache uses
See also: How Directory,
Location and Files sections work for an explanation of how these
different sections are combined when a request is received