¥É¥­¥å¥á¥ó¥È¤òÆɤޤʤ¤ÇÚ

·ëÏÀ: ¤°¤°¤ë¤Ê¡£¥É¥­¥å¥á¥ó¥È¤Ë½ñ¤¤¤Æ¤¢¤ë¤È¤ï¤«¤Ã¤Æ¤¤¤ë¤Î¤Ë¤Ê¤¼ google ¤ËÍê¤ë?

¥ï¥é¥¿£²¥Ã¥­¤ò¸«¤Æ¤°¤°¤Ã¤Æ¤ß¤¿¤ß¤Ê¤µ¤Þ¤³¤ó¤Ë¤Á¤Ï¡£¤³¤Î¥Ú¡¼¥¸¤Ï¾¤ËŬÀÚ¤ÊÄ´¤Ù¤«¤¿¤¬¤¢¤ë¤È¤­¤Ë¤Ç¤â°Â°×¤Ë¡Ö¤°¤°¤Ã¤Æ¤ß¤ë¡×¤³¤È¤Î´í¸±À­¤òÁʤ¨¤ë¥Ú¡¼¥¸¤Ç¤¹¡£

-->

¹«´Ö¤Ç¤è¤¯¸«¤é¤ì¤ë¡¢¤·¤«¤· Apache ¤ÎÇÛÉÛ¥¢¡¼¥«¥¤¥Ö°ì¼°¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥É¥­¥å¥á¥ó¥È¤ò¤Á¤ã¤ó¤ÈÆɤó¤Ç¤¤¤ì¤Ðµ¯¤­¤Ê¤¤¤Ï¤º¤ÎÀßÄê¥ß¥¹¤ä¡¢¥ß¥¹¤Ç¤Ï¤Ê¤¤¤¬¤Õ¤·¤®¤ÊÀßÄê¤Ë¤Ä¤¤¤Æ¡£

Apache ¤Î¥É¥­¥å¥á¥ó¥È¤ÏÆüËܸì̤Ìõ¤Ê¤È¤³¤í¤¬°ìÉô»Ä¤Ã¤Æ¤¤¤ë¤±¤ì¤É¡¢Á´ÂΤȤ·¤ÆÈó¾ï¤Ë¤è¤¯¤Þ¤È¤Þ¤Ã¤¿¾ðÊ󸻤Ǥ¢¤ë¡£¾¯¤Ê¤¯¤È¤â¡¢¡Ö¤³¤Î¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤ò¤É¤¦ÀßÄꤹ¤ë¤È¤É¤¦Æ°¤¯¤«¡×¤Ë¤Ä¤¤¤Æ¤Ï¤³¤ì¤Ë¾¡¤ë¥É¥­¥å¥á¥ó¥È¤Ï¤Ê¤¤¡£¤·¤«¤·¡¢¥É¥­¥å¥á¥ó¥È¤ËÀµ¤·¤¤ÊýË¡¤¬½ñ¤¤¤Æ¤¢¤ë¤Î¤Ï³Î¼Â¤Ê¤Î¤Ë¡¢¤¢¤¨¤Æ google ¤¢¤¿¤ê¤ÇÉå¤Ã¤¿Ã챤ò»ÅÆþ¤ì¤Æ¤­¤¿¤¢¤²¤¯¤Ë¡¢¤½¤ì¤ò¤½¤Î¤Þ¤Þ¼«Ê¬¤Î Web ¥µ¥¤¥È¤Ë¼Ì¤·¤Æ¸í²ò¤Î³ÈÂçºÆÀ¸»º¤ËÅؤá¤ë¿Í¤¬¤¤¤ë¡£¤Ê¤ó¤Ç?


<Limit> ¤Î´í¸±

¤°¤°¤Ã¤Æ¤ß¤ë¤È°Ê²¼¤Î¤è¤¦¤ÊÀßÄê¤ò¤·¤è¤¦¡¢¤È½ñ¤«¤ì¤Æ¤¤¤ë¤³¤È¤¬Â¿¤¤¡£

AuthType Basic
AuthName ...
AuthUserFile ...
AuthGroupFile /dev/null
<Limit GET>
    require valid-user
</Limit>

require ¤Î¤«¤ï¤ê¤Ë order/allow/deny ¤Ë¤Ê¤Ã¤Æ¤ë¤³¤È¤â¤¢¤ë¤¬¡¢¤³¤ì¤âƱÍÍ¡£

¤À¤¬¡¢ÆäËÍýͳ¤¬¤Ê¤±¤ì¤Ð¡¢<Limit> ¤ò»È¤¦É¬ÍפϤʤ¤¡£¤¦¤«¤Ä¤Ë»È¤¦¤È¡¢¥¢¥¯¥»¥¹À©¸Â¤·¤¿¤Ä¤â¤ê¤Ç¤¹¤êÈ´¤±¤Æ¤·¤Þ¤¦´í¸±À­¤¬¤¢¤ë¡£¶ñÂÎŪ¤Ë¤É¤ó¤ÊÌäÂ꤬¤¢¤ë¤«¤Ë¤Ä¤¤¤Æ¤Ï¤³¤Á¤é¤ò»²¾È¤Î¤³¤È¡£

¥É¥­¥å¥á¥ó¥È¤«¤éÈ´¿è¡£

²¿Å٤Ǥâ½ñ¤¯¤¬¡¢¼«Ê¬¤¬²¿¤ò¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¤«Íý²ò¤·¤Æ¤¤¤Ê¤±¤ì¤Ð<Limit>¤ÎÃæ¤Ë¥¢¥¯¥»¥¹À©¸ÂÀßÄê¤ò½ñ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£¤µ¤â¤Ê¤¯¤Ð¡¢¤»¤Ã¤«¤¯¤Î¥¢¥¯¥»¥¹À©¸Â¤¬Ìµ°ÕÌ£¤Ë¤Ê¤ê¤«¤Í¤Ê¤¤¡£<Limit> ¤ò»È¤Ã¤Æ¤¤¤¤¤Î¤Ï NCSA HTTPd ¤Þ¤¿¤Ï Apache 0.8 ̤Ëþ¤ò¤¤¤Þ¤À¤Ë»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£

¤ª¤Þ¤±¡£Ç§¾Ú¤Ë´Ø¤·¤Æ¤Ï¡¢<Limit> ¤È¤ÏľÀܤδط¸¤Ï¤Ê¤¤¤¬¡¢AuthName ¤â´Ö°ã¤Ã¤¿°ÕÌ£¤Ç²òÀ⤵¤ì¤ë¤³¤È¤¬Â¿¤¤¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Ç¤¢¤ë¡£¤³¤ì¤Ï¤¢¤¯¤Þ¤Çǧ¾Ú¤ÎÎΰè(realm)¤ò»Ø¼¨¤¹¤ë¤â¤Î¤Ç¤¢¤Ã¤Æ¡¢¡Ö¥Ö¥é¥¦¥¶¤Îǧ¾Ú¥À¥¤¥¢¥í¥°¤Ëɽ¼¨¤µ¤»¤ëʸ»úÎó¡×¤È¤¤¤¦¤Î¤ÏÉû¼¡Åª¤Ê¸ú²Ì¤Ç¤¢¤ë¡£ÆüËܸì¤ò»È¤¤¤¿¤¤¤È¤«¡¢ÅÓÃæ¤Ç²þ¹Ô¤·¤¿¤¤¤È¤«¡¢¤Ï¤Æ¤Ï HTML ¥¿¥°¤ò»È¤¤¤¿¤¤¤Ê¤ó¤Æ¼ÁÌä¤ò¤¿¤Þ¤Ë¸«¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢¥Ê¥ó¥»¥ó¥¹¤Ç¤¢¤ë¡£


AddDefaultCharset none ¤ÎÆæ

ï¤Ç¤¹¤«¡£¤³¤ó¤Ê¤¢¤ä¤·¤²¤Ê charset ¤ò¹­¤á¤¿¤Î¤Ï¡£

Apache ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤È¤­¤Î¤Þ¤Þ¤Î httpd.conf ¤Ç¤ÏÆüËܸì¤Ç½ñ¤«¤ì¤¿¥Ú¡¼¥¸¤¬²½¤±¤ë¤È¤¤¤¦¤Î¤Ï¤è¤¯ÃΤé¤ì¤¿ÏäǤ¢¤ë¡£¤³¤ì¤Ï AddDefaultCharset ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤ÎÃͤ¬¤½¤¦ÀßÄꤵ¤ì¤Æ¤¤¤ë(¥Ç¥Õ¥©¥ë¥ÈÃͤǤϤʤ¤¡£¥µ¥ó¥×¥ë¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë httpd.conf ¤Ç¥Ç¥Õ¥©¥ë¥È¤È°Û¤Ê¤ëÃͤòÍ¿¤¨¤Æ¤¤¤ë(*1))¤«¤é¤Ç¡¢²ò·è¤¹¤ë¤Ë¤Ï¤³¤ì¤ò¤¤¤¸¤Ã¤Æ¤ä¤ì¤Ð¤è¤¤¡£¤À¤¬¡¢¤¤¤¸¤ë¤È¤¤¤¦¤Î¤ÏÀµ¤·¤¤¤Î¤À¤¬¡¢¤É¤¦¤¤¤¦¤ï¤±¤«¡¢¤³¤ì¤ò none ¤ËÊѤ¨¤í¤È¤¤¤¦¥¦¥½¤ò½ñ¤¤¤¿¥µ¥¤¥È¤¬¤¢¤ë¡£¤¿¤È¤¨¤ÐITmedia ¥¨¥ó¥¿¡¼¥×¥é¥¤¥º¡§Linux Tips - Apache2.0¤Ç¥Ú¡¼¥¸¤¬Ê¸»ú²½¤±¤·¤Æ¤·¤Þ¤¦(¤¤¤Ä¤Î¤Þ¤Ë¤«½¤Àµ¤µ¤ì¤¿¤è¤¦¤À¤¬)¡£¤Û¤«¤Ë¤â¤°¤°¤Ã¤Æ¤ß¤ë¤È¤³¤ó¤Ê¤Ë¤¿¤¯¤µ¤ó¡£¸¡º÷ÂоݤòÆüËܸì¥Ú¡¼¥¸¤Ë¸ÂÄꤷ¤Æ¤â¤¿¤¤¤·¤Æ¿ô¤¬¸º¤é¤Ê¤¤¤Î¤Ç¡¢ÆüËܤǤÀ¤±Ì¢±ä¤·¤Æ¤ë¸½¾Ý¤é¤·¤¤(¤¬¡¢°ìÉôÍ¢½Ð¤â¤µ¤ì¤Æ¤¤¤ëÌÏÍÍ)¡£¿®¤¸¤é¤ì¤Ê¤¤¤³¤È¤Ë¡¢iso-8858-1 ¤ò»ØÄꤹ¤ë(8859 ¤Ç¤Ï¤Ê¤¯)¤Ê¤É¤È¤¤¤¦¹Óµ»¤â¤¢¤ë¤è¤¦¤À¡£

¤â¤Ã¤È¤ï¤±¤ï¤«¤ó¤Ê¤¤¤Î¤¬¡¢

AddDefaultCharset shift_jis
AddDefaultCharset EUC-JP
AddDefaultCharset none¤Î£³¤Ä¤òÄɲá£
¤È¤Ê¤Ã¤Æ¤ë¥µ¥¤¥È¡£¤¤¤ä¡¢¤Ò¤È¤Ä¤Ç¤¤¤¤¤Ã¤Æ¤Ð¡£¤³¤ì¤Ë¤Ä¤¤¤Æ¤Ï¡¢3¤Ä¤Î¤¦¤Á¤«¤é¤Ò¤È¤Ä¤òÁª¤ó¤ÇÄɲä·¤í¡¢¤È¤¤¤¦¼ç»Ý¤Î¤³¤È¤ò¤ï¤«¤ê¤Ë¤¯¤¯ÀâÌÀ¤ò¤·¤Æ¤¤¤ë¥µ¥¤¥È¤«¤éÅÁ¸À¥²¡¼¥à¤ò¤ä¤Ã¤Æ¤¤¤ë¤¦¤Á¤ËÏĤó¤Ç¤·¤Þ¤Ã¤¿¸í²ò¤Î¤è¤¦¤Ë»×¤¨¤ë¡£¤Û¤ó¤È¤¦¤Ë¤½¤¦¤«¤ÏÃΤé¤Ê¤¤¤¬¡£¤¤¤º¤ì¤Ë¤»¤è¡¢ÇÛÉÛ¸µ¤Î¥É¥­¥å¥á¥ó¥È¤òÆɤó¤Ç¤¤¤ì¤Ðµ¯¤­¤ë¤Ï¤º¤Î¤Ê¤¤´Ö°ã¤¤¤Ç¤¢¤ë¡£

¤¸¤ã¤¢ none ¤¸¤ã¤Ê¤¯¤Æ¤É¤¦ÀßÄꤹ¤ë¤Î¤¬Àµ¤·¤¤¤Î¤«¡£·¼Ìؤΰտޤ⤳¤á¤Æ¡¢¤³¤³¤Ç¤ÏÀµ²ò¤Ï½ñ¤«¤Ê¤¤¡£¸ø¼°¥É¥­¥å¥á¥ó¥È¤Ø¤Î¥ê¥ó¥¯¤òÄ¥¤ë¤À¤±¡£

¤³¤Îµ­½Ò¤«¤é¤É¤¦¤·¤Æ none ¤È¤¤¤¦¥­¡¼¥ï¡¼¥É¤¬¤ï¤¤¤Æ¤­¤¿¤Î¤«¡¢¤Û¤ó¤È¤¦¤ËÍý²ò¤Ç¤­¤Ê¤¤¡£

¤¤¤Á¤ª¤¦Ê䭤Ȥ·¤Æ¡¢AddDefaultCharset none ¤ò»ØÄꤷ¤¿¤È¤­¤Ë¤É¤ó¤Ê¸½¾Ý¤¬µ¯¤­¤ë¤Î¤«¤ò°Ê²¼¤Ë¼¨¤¹¡£¤³¤Î¥­¡¼¥ï¡¼¥É¤Ç google ¤Î¾å°Ì¤Ë¥Ò¥Ã¥È¤·¤¿¥Ú¡¼¥¸¤Î¤¦¤Á¡¢¤¤¤«¤Ë¤â¼«Â𥵡¼¥Ð¤Ã¤Ý¤¤¤È¤³¤í¤Ë¼ÂºÝ¤ËÀܳ¤·¤Æ HTTP ¤Î¥ì¥¹¥Ý¥ó¥¹¥Ø¥Ã¥À¤ò¸«¤Æ¤ß¤¿¡£

% w3m -dump_head http://Éð»Î¤Î¾ð¤±¤ÇÉú¤»¤ë.no-ip.com/
HTTP/1.1 200 OK
Date: Mon, 18 Oct 2004 03:55:02 GMT
Server: Apache/2.0.40 (Red Hat Linux)
Accept-Ranges: bytes
X-Powered-By: PHP/4.2.2
Connection: close
Content-Type: text/html; charset=none

AddDefaultCharset ¤Ç»ØÄꤷ¤¿ none ¤È¤¤¤¦Ê¸»úÎ󤬤½¤Î¤Þ¤Þ charset ¤È¤·¤Æ¤¯¤Ã¤Ä¤¤¤Æ¤¤¤ë¡£¥Ö¥é¥¦¥¶¤ÏÄ̾盧¤³¤Ç»ØÄꤵ¤ì¤¿Ê¸»ú¥³¡¼¥É¤Ç¥Ú¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë¤â¤Î¤È¤·¤ÆÆ°ºî¤¹¤ë¡£¤·¤«¤· none ¤Ê¤É¤È¤¤¤¦¤ª¤«¤·¤Êʸ»ú½¸¹ç¤ò¥Ö¥é¥¦¥¶¤¬ÃΤäƤ¤¤ë¤Ï¤º¤¬¤Ê¤¤¡£¤½¤¦¤¤¤¦¾ì¹ç¡¢¥Ö¥é¥¦¥¶¤Ï¤·¤«¤¿¤Ê¤¤¤Î¤Ç¥µ¡¼¥Ð¤«¤é¤Î±þÅú¤ò̵»ë¤·¤Æ¼«ÎϤÇʸ»ú¥³¡¼¥É¤òȽÊ̤褦¤È¤¹¤ë¡£¤³¤ì¤¬Àµ¤·¤¯È½Ê̤µ¤ì¤ì¤Ð¡¢Ê¸»ú²½¤±¤Ï²ò¾Ã¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢¥¨¥é¡¼¥ê¥«¥Ð¥ê¤Î¤Ï¤¿¤é¤«¤Ê¤¤·ÚÅÙ¤ÎÀßÄê¥ß¥¹¤«¤é¡¢¥ê¥«¥Ð¥ê¤Î¤Ï¤¿¤é¤¯¤º¤Ã¤È¤Ò¤É¤¤ÀßÄê¥ß¥¹¤ËÊѤï¤ê¡¢¤½¤Î¤ª¤«¤²¤Çʸ»ú²½¤±¤¬²ò¾Ã¤µ¤ì¤¿¤è¤¦¤Ë¸«¤¨¤ë¤À¤±¤Ç¤¢¤Ã¤Æ¡¢Àµ¤·¤¤ÀßÄ꤬¤µ¤ì¤¿¤æ¤¨¤Î·ë²Ì¤Ç¤Ï¤Ê¤¤¡£¤³¤¦¤¤¤¦¾ì¹ç¤Ë¼«Æ°È½Ê̤ò»î¤ß¤º¥Ç¥Õ¥©¥ë¥È¤Îʸ»ú¥³¡¼¥É¤È¤·¤Æ¼è¤ê°·¤¦¥Ö¥é¥¦¥¶(Safari ¤Ê¤É)¤â¤¢¤ê¡¢¤³¤Î¤è¤¦¤Ê¥Ö¥é¥¦¥¶¤Ç¤Ïʸ»ú²½¤±¤Ï²ò¾Ã¤µ¤ì¤Ê¤¤¡£

¤È¤³¤í¤Ç¡¢·ÐºÑ¤ÎÀ¤³¦¤ÇÍú¹Ô¤·¤Ê¤¯¤Á¤ã¤¤¤±¤Ê¤¤ºÄ̳¤òÍú¹Ô¤·¤Ê¤¤¤³¤È¤ò¥Ç¥Õ¥©¥ë¥È¤È¤¤¤¦¤è¤¦¤Ë¡¢ËÜÍè default ¤È¤Ï·çÀʤȤ«´þ¸¢¤È¤«¤ò°ÕÌ£¤¹¤ëñ¸ì¤Ç¤¢¤ë¡£in default of ... = ¡Á¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡£¤Ä¤Þ¤ê¡¢AddDefaultCharset ¤È¤¤¤¦¤Î¤Ï¡¢¡Ö¾¤Î¾ì½ê¤ÇÆäËÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¡×¤ËÉղ䵤ì¤ëʸ»ú¥³¡¼¥É¤Ç¤¢¤ë¡£Íפ¹¤ë¤Ë¡¢AddDefaultCharset ¤ò¤¤¤¸¤ë¤Î¤Ç¤Ï¤Ê¤¯¡Ö¾¤Î¾ì½ê¡×¤ÇÀßÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¢¤ë¡£¤¹¤Ê¤ï¤Á¡¢

AddType "text/html; charset=EUC-JP" .html
¤¢¤ë¤¤¤Ï¡¢³ÈÄ¥»Ò¤ò .html.euc-jp ¤Ë¤·¤Æ
Options +MultiViews
¤È¤«¡£EUC °Ê³°¤Ç¤âƱÍͤˡ£¤³¤Î¾ì¹ç¡¢Ê¸»ú¥³¡¼¥É¤òÉղ䷤ʤ¤¡¢¤È¤¤¤¦¤Î¤Ï̵Íý¤À¤¬¡£

(*1) Apache 2.0.53 ¤«¤é "setting a site-wide default does more harm than good" ¤È¤¤¤¦Íýͳ¤Ë¤è¤ê httpd-std.conf ¤«¤éºï½ü¤µ¤ì¤¿(CHANGES)¡£


LanguagePriority ¤Î°ÕÌ£

ʸ»ú²½¤±¤Î·ï¤Ç AddDefaultCharset ¤Ë¤Ä¤¤¤Æµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥µ¥¤¥È¤Î¿¤¯¤Ç¤¢¤ï¤»¤Æ¸ÀµÚ¤µ¤ì¤Æ¤¤¤ë¤Î¤¬¡¢LanguagePriority ¤Ç ja ¤òÀèƬ¤Ë¤â¤Ã¤Æ¤³¤¤¡¢¤È¤¤¤¦¤³¤È¡£

¼ç¤ËÆüËܸì¤Î¥³¥ó¥Æ¥ó¥Ä¤òÄ󶡤¹¤ë¥µ¡¼¥Ð¤Ë¤ª¤¤¤Æ¡¢¤³¤ÎÀßÄê¤Ï´Ö°ã¤Ã¤Æ¤Ï¤¤¤Ê¤¤¡£´Ö°ã¤Ã¤Æ¤Ï¤¤¤Ê¤¤¤¬¡¢*ʸ»ú²½¤±²ò¾Ã¤òÌÜŪ¤È¤¹¤ë¤Î¤Ç¤¢¤ì¤Ð*¡¢¤Þ¤Ã¤¿¤¯Ìµ´Ø·¸¤Ç¤¢¤ë¡£Ìµ°ÕÌ£¤Ç¤¢¤ë¡£¥É¥­¥å¥á¥ó¥È¤òÆɤó¤Ç¤â¤½¤ó¤Êµ­½Ò¤Ï¤Ê¤¤¡£¤³¤Î¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Ï¤½¤ì¤È¤Ï°Û¤Ê¤ë°Õ¿Þ¤Ç»È¤ï¤ì¤ë¤â¤Î¤À¤«¤é¤À¡£

¼ç¤ËÆüËܸì¤Î¥³¥ó¥Æ¥ó¥Ä¤òÄ󶡤¹¤ë¤¬¡¢ÆüËܸì°Ê³°¤Î¥³¥ó¥Æ¥ó¥Ä¤âƱ»þ¤ËÄ󶡤¹¤ë¥µ¡¼¥Ð¤Ê¤Î¤Ç¤¢¤ì¤Ð¤³¤ÎÀßÄê¤â°ÕÌ£¤¬¤¢¤í¤¦¡£¤·¤«¤·¤½¤¦¤Ç¤â¤Ê¤±¤ì¤ÐÊü¤Ã¤Æ¤ª¤¤¤Æ¤â¤¤¤¤¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Ç¤¢¤ë¡£¤³¤Î¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤òÄ󶡤¹¤ë¥â¥¸¥å¡¼¥ë¤Îµ¡Ç½¤ò¹Í¤¨¤ì¤Ð̵°ÕÌ£¤µ¤â¤ï¤«¤ë¤È¤¤¤¦¤â¤Î¤À¡£¤É¤ó¤Ê¤È¤­¤Ë»È¤ï¤ì¤ë¤«¤Ï°Ê²¼¤ò»²¾È¤Î¤³¤È¡£

¿¤¯¤Î¥µ¥¤¥È¤Ç¤¢¤¿¤«¤âʸ»ú²½¤±²ò¾Ã¤Ë¤Ïɬ¿Ü¤Î¤è¤¦¤Ë AddDefaultCharset ¤È LanguagePriority ¤ò¥»¥Ã¥È¤Ç²òÀ⤷¤Æ¤¤¤ë¤Î¤Ï¡¢¤ä¤Ï¤ê¥É¥­¥å¥á¥ó¥È¤òÆɤޤº¡¢¤è¤½¤Î¥µ¥¤¥È¤ò¤Ê¤ó¤È¤Ê¤¯¼Ì¤·¤Æ¤ë¤À¤±¤Ê¤Î¤Ç¤Ï¤Ê¤¤¤«¤È»×¤ï¤ì¤ë¡£¥³¥ó¥Æ¥ó¥Ä¤¬ÆüËܸì¤Ç¤¢¤ë¤³¤È¤òÌÀ¼¨¤·¤¿¤¤¤Î¤Ê¤é¤Ð¡¢LanguagePriority ¤Ç¤Ï¤Ê¤¯ DefaultLanguage¡¢AddLanguage ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤ò»È¤¦¤Î¤¬Å¬ÀÚ¤À¤í¤¦(¤¿¤À¤·¡¢Ê¸»ú²½¤±¤È¤Ï¤ä¤Ï¤ê̵´Ø·¸)¡£¤â¤·Ëü¤¬°ì LanguagePriority ¤ÎÀßÄê¤ò¤·¤¿¤¿¤á¤Ëʸ»ú²½¤±¤¬¤Ê¤ª¤Ã¤¿¡¢¤¢¤ë¤¤¤ÏÀßÄ꤬´Ö°ã¤Ã¤Æ¤¤¤¿¤¿¤á¤Ëʸ»ú²½¤±¤·¤¿¤È¤¤¤¦Î㤬¤¢¤ì¤Ð¶µ¤¨¤Æ¤Û¤·¤¤¡£Ê¸»ú²½¤±¤Ç¤Ï¤Ê¤¯¸À¸ì²½¤±¤Ê¤é¤¢¤ê¤¦¤ë¤À¤í¤¦¤¬¡£


±Æ¤ÎÇö¤¤ ScriptAlias

Q. /cgi-bin/ °Ê²¼¤Ë HTML ¤ä²èÁü¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤¿¤Î¤Ç¤¹¤¬¡¢¥¢¥¯¥»¥¹¤·¤Æ¤â¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£¤Ê¤¼¤Ç¤·¤ç¤¦¤«¡©

A. ScriptAlias ¤Î¸ú¤¤¤¿¾ì½ê¤Ë CGI °Ê³°¤Î¥Õ¥¡¥¤¥ë¤òÃÖ¤³¤¦¤È¤¤¤¦È¯ÁÛ¼«ÂΤ¬´Ö°ã¤¤¤Ç¤¹¡£

httpd.conf ¤ò¸«¤Ê¤¤¥¨¥ó¥É¥æ¡¼¥¶¤¬¤³¤ì¤Ë¤Ò¤Ã¤«¤«¤ë¤Î¤Ï¤·¤«¤¿¤Ê¤¤µ¤¤â¤¹¤ë¡£¤¬¡¢¼«Ê¬¤Ç Apache ¤òÀßÄꤹ¤ë¿Í¤¬¤³¤ì¤Ç¥Ï¥Þ¤ë¤Î¤Ê¤é¤ÐÉÔ¸«¼±¤â¤Ï¤Ê¤Ï¤À¤·¤¤¡£¼«Ê¬¤ÇÀßÄꤷ¤Ê¤¯¤Æ¤â¤Ï¤¸¤á¤«¤é¤½¤¦¤Ê¤Ã¤Æ¤¤¤ë¤ï¤±¤À¤¬¡¢¤ª¤«¤·¤¤¤È»×¤Ã¤¿¤é httpd.conf ¤òį¤á¤ì¤Ð²ø¤·¤½¤¦¤ÊÉôʬ¤Ï¤¹¤°¸«¤Ä¤«¤ë¤·¡¢¤½¤ì¤òÍê¤ê¤Ë¥É¥­¥å¥á¥ó¥È¤òÆɤá¤ÐÂнèÊýË¡¤â¤¹¤°¤Ë¤ï¤«¤ë¤Ï¤º¤À¡£google ¤Ç¸¡º÷¤¹¤ë¤È¤³¤Î¾É¾õ¤Ï¤¤¤í¤¤¤í¤Ò¤Ã¤«¤«¤ë¤¬¡¢ScriptAlias ¤Ë¤Þ¤Ç¸ÀµÚ¤µ¤ì¤Æ¤¤¤ë¤È¤³¤í¤Ï¤Û¤È¤ó¤É¤Ê¤¯¡¢¤³¤Î¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Î±Æ¤ÎÇö¤µ¤Ë¤ÏÎÞ¤òͶ¤ï¤ì¤ë¡£

¤Ê¤¼É½¼¨¤Ç¤­¤Ê¤¤¤«¤È¤¤¤¦¤È¡¢CGI ¤È¤·¤Æ¤Î¼Â¹Ô¤Ë¼ºÇÔ¤·¤Æ¤¤¤ë¤«¤é¤Ç¤¢¤ë¡£¤Ä¤Þ¤ê¡¢¼Â¹Ô¤Ç¤­¤ë¤â¤Î¤Ê¤é¤ÐÆ°¤¯¡£¤³¤ì¤ÏÆÃ¤Ë Windows ¤ÇÆ°¤¤¤Æ¤¤¤ë Apache ¤Ç¤Ï¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÌäÂê¤ò¾·¤¯²ÄǽÀ­¤¬¤¢¤ë¡£

¼ÂÎã¤òµó¤²¤ë¤È¡¢imgboard ¤È¤¤¤¦²èÁü¥¢¥Ã¥×¥í¡¼¥É CGI ¤Ï¡¢¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò cgi-bin °Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÊݸ¤¹¤ë¤³¤È¤òÁ°Äó¤Ëºî¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤ÎÌäÂ꤬ȯÀ¸¤·¤ä¤¹¤¤¡£ScriptInterpreterSource Registry ¤ÎÀßÄê¤Ç¡¢¤«¤Ä¡Ö²èÁü¤¬É½¼¨¤Ç¤­¤Ê¤¤¡×¾õÂ֤Πimgboard ¤Ë²èÁü¤ò¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤ä¤ë¤È¡¢¤½¤ì¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤Ç¥µ¡¼¥Ð¾å¤Ç²èÁü¥Õ¥¡¥¤¥ë¤Î³ÈÄ¥»Ò¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥Ó¥å¡¼¥ï¤¬µ¯Æ°¤¹¤ë(¤é¤·¤¤)¤Î¤Ç¡¢ÂçÎ̤˥¢¥¯¥»¥¹¤·¤Æ¤ä¤ì¤Ð DoS ¤Ë¤Ê¤ë¡£¤Þ¤¿ ScriptInterpreterSource Script ¤ÎÀßÄê(¥Ç¥Õ¥©¥ë¥È)¤À¤È³ÈÄ¥»Ò¤Ç¤Ï¤Ê¤¯ #! ¤ò²ò¼á¤¹¤ë¤Î¤Ç¡¢°­°Õ¤¢¤ë CGI ¤ò .jpg ¤Ê¤É¤Î³ÈÄ¥»Ò¤Çµ¶Áõ¤·¤Æ¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤ä¤ë¤È¡¢¤½¤ì¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤Ç¥µ¡¼¥Ð¤ò¥¯¥é¥Ã¥¯¤Ç¤­¤ë(¤À¤í¤¦)¡£¥É¥­¥å¥á¥ó¥È¤Ë¤ÏÁ°¼Ô¤Î¾ì¹ç¤Î´í¸±À­¤Ï·Ù¹ð¤µ¤ì¤Æ¤¤¤ë¤¬¡¢¸å¼Ô¤ÎÎã¤Ë¤Ï¿¨¤ì¤é¤ì¤Æ¤¤¤Ê¤¤¤Î¤ÇÃí°Õ¤Î¤³¤È¡£¤ï¤·¤Ï Windows ¤Ç Apache ¤ò¤¤¤¸¤ë¤³¤È¤Ï¤·¤Ê¤¤¤Î¤Ç³Îǧ¤·¤Æ¤Ê¤¤¤±¤É¥É¥­¥å¥á¥ó¥È¤ò¿®¤º¤ì¤Ð(¤½¤¦¤¤¤¦ÂÖÅÙ¤â¤É¤¦¤«¤È»×¤¦¤¬:-))¤½¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤Ï¤º¡£¤Ê¤ª¡¢UNIX ¤Ï¥ì¥¸¥¹¥È¥ê¤¬¤Ê¤¤¤Î¤Ç ScriptInterpreterSource Script ÁêÅö¤À¤¬¡¢Ä̾異¥Ã¥×¥í¡¼¥É¤·¤¿¤À¤±¤Ç¤Ï¼Â¹Ô¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬¤Ê¤¤¤Î¤Ç¤³¤Î¤è¤¦¤Ê¹¶·â¤Ï¤Ç¤­¤Ê¤¤¡£


SetEnvIf ... Lilith ¤ÎÉÔ»×µÄ

´Ö°ã¤Ã¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤Î¤À¤¬¡¢¤è¤½¤Î¥µ¥¤¥È¤ÎÀßÄê¤ò¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤·¤Æ¤ë¤À¤±¤È»×¤ï¤ì¤ëÎã¤ò¤â¤¦¤Ò¤È¤Ä¡£

HTTP ¤Î¥ê¥¯¥¨¥¹¥È¥Ø¥Ã¥À¤Ë¤è¤Ã¤Æ¥¢¥¯¥»¥¹À©¸Â¤ò¤«¤±¤ë¾ì¹ç(ŵ·¿Îã¤È¤·¤Æ¤Ï Referer ¤Ë¤è¤ë»²¾È¸µÀ©¸Â)¡¢(1)SetEnvIf ¤ÇŬÅö¤Ê´Ä¶­ÊÑ¿ô¤ò¥»¥Ã¥È¤·¡¢(2)¤½¤Î´Ä¶­ÊÑ¿ô¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¥¢¥¯¥»¥¹µñÈݤ¹¤ë¡¢¤È¤¤¤¦2Ãʹ½¤¨¤ÎÀßÄê¤Ë¤Ê¤ë¡£¤½¤ì¤ÏÀµ¤·¤¤¤Î¤À¤¬¡¢¤½¤Î¥»¥Ã¥È¤¹¤ë´Ä¶­ÊÑ¿ô¤Î̾Á°¤¬¡¢¤Ê¤¼¤« Lilith ¤È¤µ¤ì¤ë¤³¤È¤¬Â¿¤¤¡£

´Ä¶­ÊÑ¿ô̾¤ÏǤ°Õ¤Î¤â¤Î¤Ç¤¤¤¤¤Î¤Ç´Ö°ã¤Ã¤Æ¤Ï¤¤¤Ê¤¤¤·¡¢¤Á¤ã¤ó¤È˾¤ó¤À¤È¤ª¤ê¤ËÆ°ºî¤¹¤ë¡£¤À¤¬¡¢¤¤¤Ã¤¿¤¤¤É¤³¤«¤é Lilith ¤È¤¤¤¦Ê¸»úÎ󤬽ФƤ­¤¿¤Î¤«¡£¤³¤ÎÍÑÅÓ¤Çï¤â¤¬¼«Á³¤Ë»×¤¤É⤫¤Öñ¸ì¤Ç¤Ï¤Ê¤¤¤È»×¤¦¤Î¤À¤¬¡£

»²¹Í¤Þ¤Ç¤Ë¡¢Apache ¤ÎÇÛÉۥɥ­¥å¥á¥ó¥È¤ÎÎã¤Ç¤Ï local_referal ¤È¤¤¤¦´Ä¶­ÊÑ¿ô̾¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£

¤Ê¤ª¡¢Referer ¤Ï¤½¤â¤½¤âµ¶Â¤¤¬¤«¤ó¤¿¤ó¤Ë¤Ç¤­¤ë¤·¡¢¥×¥é¥¤¥Ð¥·¡¼¤Ê¤É¤ÎÍýͳ¤«¤é¤ï¤¶¤ÈÁ÷½Ð¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤ê½ñ¤­´¹¤¨¤¿¤ê¤¹¤ë¤³¤È¤â¤¢¤ë¤Î¤Ç¡¢¤³¤ì¤Ë¤è¤ë¥¢¥¯¥»¥¹À©¸Â¤Ï´°Á´¤Ç¤Ï¤Ê¤¤(¤½¤ì¤É¤³¤í¤«ÉûºîÍѤˤʤ뤳¤È¤â¤¢¤ë)¤Î¤À¤¬¡¢¤Þ¤¢¡¢¤½¤ÎÀ§Èó¤Ë¤Ä¤¤¤Æ¤Ï¤³¤³¤Ç¤Ï¿¼¤¯¿¨¤ì¤Ê¤¤¡£

¤È¤³¤í¤Ç¡¢¤³¤Î SetEnvIf ¤Ë¤è¤ë¥¢¥¯¥»¥¹À©¸Â¤ò Accept-Language ¥Ø¥Ã¥À¤ËÂФ·¤Æ¤ª¤³¤Ê¤¤¡¢¥¯¥é¥¤¥¢¥ó¥È¤Î¸À¸ì¥Á¥§¥Ã¥¯¤ò¤¹¤ë¤È¤¤¤¦¤³¤È¤â¤è¤¯¤ª¤³¤Ê¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¡£¤·¤«¤·¡¢403 Forbidden ¤òÊÖ¤·¤Æ¤·¤Þ¤¦¤³¤ÎÊýË¡¤è¤ê¤â¡¢¸À¸ì¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤Îµ¡Ç½¤ò»È¤Ã¤Æ 406 Not Acceptable ¤òÊÖ¤¹¤¬Å¬ÀÚ¤À¤í¤¦¡£¶ñÂÎŪ¤Ë¤Ï¡¢httpd.conf ¤« .htaccess ¤Ç

Options +MultiViews
# Apache 2 ¤Ç¤Ï°Ê²¼¤âÄɲÃ
# ForceLanguagePriority Prefer	# ¤Þ¤¿¤Ï None (Fallback ¤ò´Þ¤Þ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë)
# °Ê²¼¤ÏǤ°Õ¤Ç
# ErrorDocument 406 ...
¤È¤·¤Æ¥³¥ó¥Æ¥ó¥Ä¥Í¥´¥·¥¨¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤·¤¿¾å¤Ç¡¢¥Õ¥¡¥¤¥ë̾¤Î hoge.html ¤ò hoge.html.ja ¤ËÊѤ¨¤ë(HTML ¤«¤é¥ê¥ó¥¯¤¹¤ë URL ¤Ï hoge.html ¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¯)¡£¤³¤ì¤Ë¤è¤ê¡¢hoge.html ¤Ø¤Î¥¢¥¯¥»¥¹¤Î¤¦¤Á¡¢Accept-Language ¤Ë ja ¤¬´Þ¤Þ¤ì¤ë¥ê¥¯¥¨¥¹¥È¤Ë¤Ï hoge.html.ja ¤¬ÊÖ¤µ¤ì¡¢A-L ¤Ë ja ¤¬´Þ¤Þ¤ì¤Ê¤¤¥¯¥é¥¤¥¢¥ó¥È¤Ë¤Ï 406 Not Acceptable ¤Î¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤¬¤Ç¤­¤ë(406 ¤Î¥¨¥é¡¼²èÌÌ¤Ë hoge.html.ja ¤Ø¤Î¥ê¥ó¥¯¤¬´Þ¤Þ¤ì¤Æ¤·¤Þ¤¦¤Î¤Ç¡¢ErrorDocument ¤Ç¥¨¥é¡¼É½¼¨¤ò¥«¥¹¥¿¥Þ¥¤¥º¤·¤Æ¤ª¤¤¤¿Êý¤¬¤¤¤¤¤À¤í¤¦)¡£

google ¤Ê¤É¤Î¸¡º÷¥¨¥ó¥¸¥ó¤Ê¤É¤Ë¤è¤ê¡¢´Ö°ã¤Ã¤¿ÀßÄê¤Î³ÈÂçºÆÀ¸»º¤¬¤ª¤³¤Ê¤ï¤ì¤Æ¤¤¤ë¤È¤·¤«»×¤¨¤Ê¤¤¡£¤Þ¤¿¡¢¸í²ò¤ò¤Þ¤Í¤­¤ä¤¹¤¤ÀâÌÀ¤¬¤Ä¤¤¤Æ¤¤¤¿¤ê¡¢¤¢¤ëÆÃÄê¤ÎÌÜŪ¤Ç¤Î¤ßÀµ¤·¤¤ÀßÄê¤À¤Ã¤¿¤ê¤È¡¢¤«¤Ê¤é¤º¤·¤â´Ö°ã¤¤¤Ç¤Ï¤Ê¤¤ÀßÄê¤â¡¢¸¡º÷¥¨¥ó¥¸¥ó¤ò²ð¤·¤¿ÅÁ¸À¥²¡¼¥à¤ò·«¤êÊÖ¤¹¤¦¤Á¤ËÌÀÇò¤Ë´Ö°ã¤Ã¤¿ÀßÄê¤ËÊѲ½¤·¤Æ¤¤¤Ã¤Æ¤ë¤Î¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¤«¡£

google ¤ËÍê¤ë¤Ð¤«¤ê¤¸¤ã¤Ê¤¯¤Æ¡¢ÉÕ°¤Î¥É¥­¥å¥á¥ó¥È¤ò¤Á¤ã¤ó¤ÈÆɤ⤦¡£¤¢¤ë¤«¤É¤¦¤«¤ï¤«¤é¤Ê¤¤¤â¤Î¤ò google ¤Çõ¤¹¤è¤ê¤â¡¢¤¢¤ë¤È¤ï¤«¤Ã¤Æ¤¤¤ë¤â¤Î¤òÉÕ°¥É¥­¥å¥á¥ó¥È¤«¤éõ¤¹Êý¤¬¤º¤Ã¤È¥é¥¯¤À¤È»×¤¦¤ó¤À¤±¤É¡£¡Ö¥Þ¥Ë¥å¥¢¥ë¿Í´Ö¡×¡Ö¥Þ¥Ë¥å¥¢¥ëÀ¤Âå¡×¤Î¤è¤¦¤Ê¥Í¥¬¥Æ¥£¥Ö¥¤¥á¡¼¥¸¤Î¸ÀÍդ⤢¤ë¤±¤É¡¢¤³¤Î¸ÀÍÕ¤ÇÌäÂê¤Ë¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¥Þ¥Ë¥å¥¢¥ë¤Ë½ñ¤¤¤Æ¤¢¤ë¤³¤È¤·¤«¤Ç¤­¤Ê¤¤¤³¤È¡¢±þÍÑÎϤΤʤ¤¤³¤È¤Ç¤¢¤ë¡£¥Þ¥Ë¥å¥¢¥ë¤òÆɤߤµ¤¨¤·¤Ê¤¤¤Î¤Ï¡Ö¥Þ¥Ë¥å¥¢¥ë¿Í´Ö¡×¤Ë¤¹¤éµÚ¤Ð¤Ê¤¤¡£

¤Ê¤ª¡¢¤³¤Î¥Ú¡¼¥¸¼«ÂΤ⡢google ¤Ë¤Ò¤Ã¤«¤«¤ë¿¿µ¶¤ÎÄ꤫¤Ç¤Ê¤¤¤¢¤ä¤·¤²¤Ê¥Ú¡¼¥¸¤Î¤Ò¤È¤Ä¤Ç¤¢¤ë¡£¤³¤³¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤³¤È¤ò±­Æݤߤˤ»¤º¡¢¼«Ê¬¤Ç¥É¥­¥å¥á¥ó¥È¤òÄ´¤Ù¤Ê¤ª¤·¤Æ¤Û¤·¤¤¡£


¤â¤É¤ë
<[email protected]>