½ÇÁ¦ ÆÄÀÏ ¼Ò½º ÄÚµå | ºê¶ó¿ìÀú¿¡¼ ¹ÞÀº ÄÚµå | |
<h2>SSIÀÇ ¿¹</H2>
|
<h2>SSIÀÇ ¿¹</H2>
| |
|
¸ðµç ¼¹öµéÀÌ SSI¸¦ Áö¿øÇÏ´Â °ÍÀº ¾Æ´Ï´Ù. ¶ÇÇÑ ¼¹öÀÇ Á¾·ù¿Í ¹öÀü¿¡ µû¶ó
±× ¹®¹ýÀÌ ´Ù¸¦ ¼ö ÀÖ´Ù. µû¶ó¼ ÀÚ½ÅÀÌ »ç¿ëÇÏ´Â HTTPdÀÇ
SSI ¹®¹ý¿¡ ÀûÇÕÇÏ°Ô ¸¸µé¾î¾ß ÇÑ´Ù. ±×·¯³ª ¼¹ö¸¶´Ù ±× ¹®¹ýÀÌ
Å©°Ô ´Ù¸£Áö´Â ¾Ê´Ù. ¿©±â¼´Â NCSA HTTPD (¹öÀü 1.4ÀÌ»ó)À» ±âÁØÀ¸·Î
¼³¸íÇÑ´Ù.
SSI¸¦ »ç¿ëÇϱâ À§Çؼ´Â HTTPdÀÇ conf ÆÄÀÏÀ» ¼öÁ¤ÇÏ¿©¾ß
ÇÑ´Ù. access.confÀÇ
Options
directive¿¡¼ Includes ¶Ç´Â IncludesNOEXEC¸¦
ÁöÁ¤ÇÏ¿©¾ß ÇÑ´Ù. ±×¸®°í srm.conf¿¡
AddType
directive¸¦ »ç¿ëÇÏ¿© ´ÙÀ½°ú °°ÀÌ MIME typeÀ» µî·ÏÇÏ¿©¾ß ÇÑ´Ù.
AddType text/x-server-parsed-html .shtml
ÀÌ·¸°Ô Çϸé SSI¸¦ »ç¿ëÇÏ°íÀÚ ÇÏ´Â ÆÄÀÏÀÇ È®ÀåÀÚ¸¦ .shtml·Î Á¦ÇÑÇÏ°Ô µÈ´Ù.
¸¸¾à ¸ðµç HTML ¹®¼¿¡¼ SSI¸¦ »ç¿ëÇÏ°íÀÚ ÇÑ´Ù¸é ´ÙÀ½°ú °°ÀÌ ÇÏ¿©¾ß ÇÑ´Ù.
AddType text/x-server-parsed-html .html
SSI¿¡¼ »ç¿ëµÇ´Â ÇüÅ´ ´ÙÀ½°ú °°À¸¸ç, À̶§ ´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏ¿©¾ß ÇÑ´Ù.
<!--#command tag1="value1" ......-->
<!--#config
[errmsg="string"]
[timefmt="time_format"]
[sizefmt="bytes"|"abbrev"]-->
SSI Ãâ·ÂÇü½Ä¿¡ °üÇÑ Çü½ÄÀ» ÁöÁ¤/º¯°æÇÑ´Ù.<!--#include [virtual="virtural_path"] [file="relative_path"]-->
errmsg SSI 󸮰úÁ¤¿¡¼ ¿¡·¯°¡ ¹ß»ýÇÑ °æ¿ì(¿¹¸¦ µé¸é, includeÇÒ ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê´Â´Ù°Å³ª)¿¡ Ãâ·ÂµÉ ¿¡·¯ ¸Þ½ÃÁöÀÇ ³»¿ëÀ» ÁöÁ¤ÇÑ´Ù.
timefmt <!--#flastmod ... --> µî°ú °°Àº ½Ã°£ Ãâ·Â¿¡ »õ Çü½ÄÀ» ÁöÁ¤ÇÑ´Ù. À̶§ ±× Çü½ÄÀº C library ÇÔ¼öÀÎ strftimeÀÇ specifiers¿Í °°´Ù. sizefmt <!--#fsize ... -->¿¡¼ ÆÄÀÏ Å©±â Ãâ·ÂÇü½ÄÀ» Á¤ÇÑ´Ù. "bytes"´Â byte ´ÜÀ§, "abbrev"´Â Kbyte´ÜÀ§·Î Ãâ·ÂÇÑ´Ù. ±âº»°ª(default)Àº "abbrev"ÀÌ´Ù.
ÁöÁ¤µÈ ÆÄÀÏÀ» »ðÀÔÇÑ´Ù.<!--#echo var="enviroment_variable"-->
virtual virtual path; anchor¿¡¼ ÁöÁ¤ÇÏ´Â path¿Í °°´Ù. "/index.html" , "/~someone/intro.html"°ú °°Àº Àý´ë path·Î ÁöÁ¤ÇÑ´Ù. file ÇöÀç ¹®¼¿¡ ´ëÇÑ »ó´ë path·Î ÁöÁ¤µÈ´Ù. ´Ü, »óÀ§µð·ºÅ丮(../filename.html)´Â ÁöÁ¤ÇÒ ¼ö ¾ø´Ù.
ȯ°æº¯¼ö(enviroment variable)ÀÇ °ªÀ» Ãâ·ÂÇÑ´Ù. CGIȯ°æ º¯¼ö ¹× ´ÙÀ½ º¯¼öµéÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.<!--#fsize [virtual="virtural_path"] [file="relative_path"]-->
DOCUMENT_NAME ÇöÀç ÆÄÀÏÀÇ À̸§ DOCUMENT_URI ÇöÀç ÆÄÀÏÀÇ virtual path QUERY_STRING_UNESCAPED The unescaped version of any search query the client sent, with all shell-special characters escaped with \. DATE_LOCAL ÇöÁö ½Ã°¢ (configÀÇ timefmt°¡ ÁöÁ¤µÇ¸é ±× Çü½ÄÀ¸·Î Ãâ·Â) DATE_GMT GMT Ç¥ÁØ ½Ã°¢ (cofngÀÇ timefmt°¡ ÁöÁ¤µÇ¸é ±× Çü½ÄÀ¸·Î Ãâ·Â) LAST_MODIFIED ÇöÀç ÆÄÀÏÀÇ ³»¿ëÀÌ ÃÖ±Ù º¯°æµÈ ½Ã°£ (cofngÀÇ timefmt°¡ ÁöÁ¤µÇ¸é ±× Çü½ÄÀ¸·Î Ãâ·Â)
ÆÄÀÏÀÇ Å©±â¸¦ Ãâ·Â. virtual°ú fileÀº include¿¡¼¿Í µ¿ÀÏÇÏ°Ô »ç¿ëµÈ´Ù. configÀÇ sizefmt¿¡ µû¸¥´Ù.<!--#flastmod [virtual="virtural_path"] [file="relative_path"]-->
ÆÄÀÏÀÇ ÃÖ±Ù º¯°æ ½Ã°¢ Ãâ·Â. virtual°ú fileÀº include¿¡¼¿Í µ¿ÀÏÇÏ°Ô »ç¿ëµÈ´Ù. configÀÇ timefmt¿¡ µû¸¥´Ù.<!--#exec [cmd=shell_command] [cgi=cgi_script]-->
Ä¿¸Çµå³ª CGI script¸¦ ½ÇÇàÇÏ¿© ±× °á°ú¸¦ Ãâ·ÂÇÑ´Ù. À̶§ Ä¿¸Çµå¿¡ Àμö(argument)¸¦ Àü´ÞÇÒ ¼ö´Â ÀÖÀ¸³ª, CGI¿¡ Äõ¸®(query)¸¦ Àü´ÞÇÒ ¼ö´Â ¾ø´Ù.
<!--#exec cmd="finger gang@phya.yonsei.ac.kr"--> ¡Û <!--#exec cgi="/cgi-bin/finger?gang@phya.yonsei.ac.kr"--> ¡¿
[¼¹öÀÇ ¼Ò½ºÄÚµå]<title>SSI Ex</title> <h1 align=center>Server Side Include</h1> <p>configurating time format <!--#config timefmt="The time is %A. %I:%M %p %Z"--> <P>file size<br> <!--#fsize file="ssi.html"--> <!--#config sizefmt="bytes"--> <!--#fsize file="ssi.html"--> <p>last modified time<br> <!--#flastmod file="ssi.html"--> <br>/index.html <!--#flastmod virtual="/index.html"--> <br>/~gang/index.html <!--#flastmod virtual="/~gang/index.html"--> <p>execution<br> <!--#exec cmd="who am i"--> <p>echo document name<br> <!--#echo var="DOCUMENT_NAME"-->[ºê¶ó¿ìÀú¿¡¼ ¹ÞÀº ¼Ò½ºÄÚµå]<title>SSI Ex</title> <h1 align=center>Server Side Include</h1> <p>configurating time format <P>file size<br> 1K 540 <p>last modified time<br> The time is Thursday. 09:52 AM KST <br>/index.html The time is Tuesday. 05:08 PM KST <br>/~gang/index.html The time is Friday. 10:32 PM KST <p>execution<br> nobody tty?? Mar 7 09:52 <p>echo document name<br> ssiex.html