## ÀÌ ¹®¼´Â "¼¹ö°ü¸®ÀÚ¸¦ À§ÇÑ ¸®´ª½º ³×Æ®¿öÅ©-(Ãâ)º£½ºÆ®ºÏ" Ã¥¿¡ ´ëÇÑ µ¶ÀÚÀÇ
## Áú¹® Áß, ºñ±³Àû ºñÁßÀÌ ÀÖ´Â Áú¹®°ú ´äº¯À» Á¤¸®ÇÏ¿© ¿Å°Ü³õÀº °ÍÀÔ´Ï´Ù.
##
## µ¶ÀÚÀÇ °³ÀÎ Á¤º¸ º¸È£¿Í ½ºÆÔ¸ÞÀÏÀ» ¹æÁöÇϱâ À§Çؼ À̸§°ú ¸ÞÀÏÁÖ¼Ò´Â
## Á¦¿Ü½ÃÄ×½À´Ï´Ù.
##
## Ã¥¿¡ ´ëÇÑ Áú¹®Àº °¡´ÉÇÑ
## http://www.linuxchannel.net/board/?table=qna
## ¿¡¼ Áú¹®ÇØ ÁֽʽÿÀ.
[Á¦¸ñ] »ç¿ëÀÚ °èÁ¤¿¡ ¾ÆÆÄÄ¡ cgi-binÀ» Á¦°øÇÏ·Á°í Çϴµ¥?
>±Û¾´ÀÌ : ±èxxx
>ÀÛ¼ºÀÏ : 2001-10-16
>
>¾È³çÇϼ¼¿ä,
>¹ú½á ¸çĥ° °í»ýÁß ÀÔ´Ï´Ù.
>
>[¸®´ª½º ³×Æ®¿öÅ© -·¹ÆÛ·±½º ¹ÙÀ̺í] Ã¥ ±¸ÀÔÈÄ °øºÎÁß ÀÔ´Ï´Ù.
>
>¾ÆÆÄÄ¡ ¼³Á¤Áß ÇØ°á ¾ÈµÇ´Â ¹®Á¦°¡ À־ä.
>
>¹®Á¦´Â public_html/cgi-bin ¾È¿¡¼ .cgi ´Â ¹°·Ð .html .gif ÀüºÎµÈ´Ù´Â Á¡ÀÔ´Ï´Ù. ÀÌ·¯¸é Àǹ̰¡ ¾ø´Âµ¥...
>
>UserDir public_html
>
>
>Options ExecCGI
>AllowOverride None
>Order allow,deny
>Allow from all
>
>
>ÀÌ·¸°Ô Çؼ »ç¿ëÀÚ°èÁ¤¾È¿¡¼ cgi ½ÇÇà½Ã cgi-bin ¾È¿¡¼¸¸ ½ÇÇàÀÌ µÇµµ·Ï Çߴµ¥, µÇ±â´Â µË´Ï´Ù.
>
>/home/*/public_html/cgi-bin ¿¡¼ .html .gif µîÀÇ ´Ù¸¥ ÆÄÀϵµ ½ÇÇàÀÌ µÇ°í ÀÖ½À´Ï´Ù.
>
>
>µð·ºÅ丮 ¼³Á¤ÇϱâÀü ScriptAlais ¸¦ ÇÏ´Ï ±âº» µð·ºÅ丮 cgi-bin ±îÁö ¾ÈµÇ´õ¶ó°í¿ä..
>
>/home/*/public_html/cgi-bin ¿¡¼µµ,
>
>/var/www/cgi-bin ó·³ cgi-bin ¿¡¼´Â ¹«Á¶°Ç .cgi ³ª .pl µî¸¸ ½ÇÇàµÇµµ·Ï
>ÇÒ¼ö´Â ¾øÀ»±î¿ä? .gif .html µîÀº ¹«Á¶°Ç ¾ÈµÇ°í, ´Þ¶û .cgi .pl ¸¸ µÇµµ·Ï ¸»ÀÔ´Ï´Ù.
====================================================
ScriptAlias Áö½ÃÀÚ º¸´Ù´Â ScriptAliasMatch ÁöÁöÀÚ¸¦ È°¿ëÇÕ´Ï´Ù.
´ÙÀ½ÀÇ ±× ¿¹ÀÔ´Ï´Ù.
## httpd.conf
##
## Áß°£»ý·«
##
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
#
## ´ÙÀ½ ÇÑÁÙ Ãß°¡
ScriptAliasMatch ~(.+)/cgi-bin/(.+) "/home/$1/public_html/cgi-bin/$2"
#
#
## Áß°£ »ý·«
#
AllowOverride None
Options None
Order allow,deny
Allow from all
#
#
## ´ÙÀ½ 6ÁÙ Ãß°¡
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
#
## Áß°£»ý·«
#
AddHandler cgi-script .cgi .pl
#
## ÀÌÇÏ »ý·«
##
--------------------------------
À§¿Í °°ÀÌ ÆíÁýÇÏ°í
¾ÆÆÄÄ¡¸¦ Àç½ÃÀÛÇØ º¸¼¼¿ä...
$ cat ~aaa/cgi-bin/tmp.pl
--------------------------
#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
#
print "test cgi(pl)";
--------------------------
http://www.domain.com/~aaa/cgi-bin/tmp.pl
À̶§ Æ۹̼ÇÀº
$ chmod o+x ~aaa/cgi-bin/tmp.pl
À¸·Î ÇؾßÇÕ´Ï´Ù. ÀÌ Àǹ̴Â
¾ÆÆÄÄ¡ ÀÚ½Ä ÇÁ·Î¼¼½º(nobody)ÀÇ ±ÇÇÑÀº ½ÇÇà(x)±ÇÇÑÀ»
Áà¾ßÇÔÀ» ÀǹÌÇÕ´Ï´Ù.