Linuxdoc Sgml/Virtual-Services-HOWTO
<!doctype linuxdoc system>
<article>
<!-- Title information -->
<title>Virtual Services Howto
<author>Brian Ackerman, (<htmlurl url="mailto:brian@nycrc.net" name="brian@nycrc.net">)
<date>v2.1, 15 August 1998
<trans>±ÇÅÂÁØ, (<htmlurl url="mailto:linusben@bawi.org" name="linusben@bawi.org">)
<tdate> 06 April 1999
<abstract>
ÀÌ ¹®¼´Â ½Ã½ºÅÛ¿¡¼ °¡»ó ¼ºñ½º(virtualize)¸¦ Á¦°øÇÏ´Â °Í¿¡ ´ëÇÑ ¸¹Àº
¿äûµéÀ» À§ÇØ ¸¸µé¾îÁ³´Ù.
</abstract>
<!-- Table of contents -->
<toc>
<!-- Beginning -->
<sect> ¼Ò°³
<sect1> ÇÊ¿äÇÑ Áö½Äµé
<p>
½Ã½ºÅÛÀÇ °¡»ó ¼ºñ½º¸¦ Á¦°øÇÏ´Â ÀÏÀº ¾î·Á¿î ÀÏÀÌ ¾Æ´ÏÁö¸¸, ±âÃÊÀûÀÎ Áö½Ä
ÀÌ»óÀ» ¿ä±¸ÇÑ´Ù. ÀÌ ¹®¼°¡ ¸®´ª½º ¸Ó½ÅÀ» ÀüüÀûÀ¸·Î ¼³Á¤ÇÏ´Â ¹æ¹ý¿¡ ´ëÇÑ
ÀÔ¹®¼(primer)´Â ¾Æ´Ï´Ù.
<p>
ÀÌ ÇÏ¿ìÅõ ¹®¼´Â ´ç½ÅÀÌ ¾Æ·¡ÀÇ ³»¿ëµé¿¡ ´ëÇØ¼ ¾î´ÀÁ¤µµ ÀÌÇØ¸¦ Çϰí ÀÖ´Ù´Â
°¡Á¤ÇÏ¿¡ ÀÌ·ç¾îÁø °ÍÀÌ´Ù:(ÇÑ±Û ÀÚ·á´Â ¿øº»¿¡ ¾ø´Â °ÍÀÔ´Ï´Ù. ´ç¿¬ÇÏÁÒ?-¿ªÀÚÁÖ)
<itemize>
<item> ¸®´ª½º Ä¿³Î ÄÄÆÄÀϰú IP ¾Ù¸®¾î½Ì(aliasing) Áö¿ø
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/mini/IP-Alias.html" name="IP Alias mini-HOWTO">
<htmlurl url="http://kldp.org//HOWTO/mini/html/IP-Alias/IP-Alias.html" name="¸®´ª½º¿¡¼ IP Aliasing ¼¼ÆÃÇϱâ mini-HOWTO">
<item> ³×Æ®¿öÅ© ÀåºñÀÇ ¼³Á¤
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/NET-3-HOWTO.html" name="NET-3 HOWTO">
<item> inetd ¼³Á¤
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/NET-3-HOWTO.html" name="NET-3 HOWTO">
<item> ¾Æ·¡¿Í °°Àº ¿©·¯°¡Áö ³×Æ®¿þÅ© ÆÐŰÁö
<htmlurl url="http://www.sendmail.org" name="»÷µå¸ÞÀÏ(Sendmail)">
<htmlurl url="http://suny.multi.co.kr/~leesl/mail/" name="Çѱ۰ú »÷µå¸ÞÀÏ">
<htmlurl url="http://www.apache.org" name="¾ÆÆÄÄ¡(Apache)">
<htmlurl url="http://www.apache.kr.net" name="¾ÆÆÄÄ¡(Apache)-ÇѱۻçÀÌÆ®">
<htmlurl url="http://www.qmail.org" name="Qmail">
<htmlurl url="http://samba.anu.edu.au" name="»ï¹Ù(SAMBA)">
<item> DNS ¼³Á¤
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/DNS-HOWTO.html" name="DNS HOWTO">
<htmlurl url="http:////kldp.org/KoreanDoc/html/DNS-KLDP/PoweredByDNS.html" name="DNS °ü·Ã¹®¼">
<item> ±âÃÊÀûÀÎ ½Ã½ºÅÛ °ü¸®¿¡ ´ëÇÑ ÀÌÇØ
<htmlurl url="http://sunsite.unc.edu/LDP/LDP/sag/index.html" name="Linux Systems Administrators's Guide">
<htmlurl url="http://kldp.org/sysadmin.html" name="KLDPÀÇ ½Ã½ºÅÛ °ü¸® ÆäÀÌÁö">
<item> À¥¼¹ö ¼³Á¤¿¡ ´ëÇÑ ÀÌÇØ
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/WWW-HOWTO.html" name="WWW ÇÏ¿ìÅõ">
</itemize>
¸¸¾à ´ç½ÅÀÌ À§ÀÇ ¾î¶² °Í¿¡ ´ëÇØ È®½ÅÀÌ ¾ø´Ù¸é, ¸µÅ©¸¦ ÂѾư¡¼ ³»¿ëÀ»
¸ÕÀú È®½ÇÇÏ°Ô ÀÌÇØÇϱ⠹ٶõ´Ù. À§ÀÇ »çÇ׿¡ ´ëÇØ¼´Â ³ ¸ÞÀÏ¿¡ ´ëÇØ °áÄÚ
´äÀåÀ» º¸³»Áö ¾ÊÀ» °ÍÀÌ´Ù. °ü·ÃµÈ HOWTOÀÇ ÀúÀÚ¿¡°Ô Á÷Á¢ Áú¹®À» ÇÏ´Â °ÍÀÌ
ÁÁÀ» °ÍÀÌ´Ù.
<sect1> ¸ñÀû
<p>
°¡»ó(virtual) ¼ºñ½ºÀÇ ¸ñÀûÀº ÇϳªÀÇ ¸Ó½Å¿¡ ¿©·¯°³ÀÇ ³×Æ®¿öÅ© Ä«µå ¾øÀ̵µ
¿©·¯°³ÀÇ IP ÁÖ¼Ò¸¦ ÀνÄÇϵµ·Ï ÇÏ´Â µ¥ ÀÖ´Ù. IP ¾Ù¸®¾î½Ì(aliasing)Àº ¿©·¯°³ÀÇ
³×Æ®¿öÅ© Ä«µå°¡ ÀÖÀ» ¶§ °¢°¢ÀÇ Àåºñ¿¡¼ Çϳª ÀÌ»óÀÇ IP ÁÖ¼Ò¸¦ Çã¿ëÇÏ´Â Ä¿³Î
¿É¼ÇÀÌ´Ù. ÀÌ ¶§ Ä¿³ÎÀº µÚ¿¡¼ ´ÙÁßÀÇ Á¤º¸±³È¯ÀÌ ÀÌ·ç¾îÁö°í(À̰ÍÀº ¸Å¿ì ºü¸£°Ô
ÀÌ·ç¾îÁø´Ù) »ç¿ëÀÚ´Â ¸¶Ä¡ Çϳª ÀÌ»óÀÇ ¼¹ö¸¦ °¡Áö°í ÀÖ´Â °Íó·³ ÀνÄÇÏ°Ô µÈ´Ù.
<p>
ÀÌ·± ´ÙÁß Á¤º¸±³È¯(multiplexing)Àº ÇϳªÀÇ µµ¸ÞÀÎÀ» È£½ºÆÃÇÏ´Â °Í°ú °°Àº
ºñ¿ëÀ¸·Î ¿©·¯°³ÀÇ µµ¸ÞÀÎ(www.domain1.com www.domain2.com µî)À» È£½ºÆÃÇÒ
¼ö ÀÖ´Ù. ºÒÇàÇϰԵµ ´ëºÎºÐÀÇ ¼ºñ½º(FTP, web, mail)´Â ´ÙÁß µµ¸ÞÀÎÀ» ´Ù·ê
¼ö ÀÖµµ·Ï ¼³°èµÇ¾îÀÖÁö ¾Ê´Ù. À̵éÀ» Àû´çÇÏ°Ô ÀÛµ¿½Ã۱â À§Çؼ´Â ¼³Á¤
»Ó¸¸ ¾Æ´Ï¶ó ¼Ò½º Äڵ嵵 º¯Çü½ÃÄÑ¾ß ÇÑ´Ù. ÀÌ ¹®¼´Â ¾î¶»°Ô ÀÌ·± º¯ÇüÀ» ½ÃÄѼ
°¡»ó ¸Ó½ÅÀ» ¼³Á¤ÇÒ °ÍÀÎÁö¿¡ ´ëÇØ ±â¼úÇÑ´Ù.
<p>
°¡»ó ¼ºñ½º ±â´ÉÀ» À§Çؼ´Â µ¥¸ó ¿ª½Ã ÇÊ¿äÇÏ´Ù. ÀÌ µ¥¸ó(virtuald) ¿ª½Ã
ÀÌ ¹®¼ÀÇ ÈĹݿ¡¼ ´Ù·ê °ÍÀÌ´Ù.
<sect1> Çǵå¹é(Feedback)
<p>
ÀÌ ¹®¼´Â ÆÐŰÁöµéÀÌ ¾÷µ¥ÀÌÆ®µÇ°í ¼Ò½ºÄڵ峪 ¼³Á¤ ³»¿ëµéÀÌ º¯°æµÉ ¶§¸¶´Ù
È®ÀåµÉ °ÍÀÌ´Ù. ¸¸¾à ÀÌ ¹®¼ÀÇ Æ¯Á¤ºÎºÐÀÌ ºÒºÐ¸íÇÏ´Ù°í »ý°¢µÇ¸é °Å¸®³¦¾øÀÌ
³ª¿¡°Ô ´ç½ÅÀÇ Á¦¾ÈÀ̳ª Áú¹®À» email·Î º¸³»¶ó. ³»°¡ ÀÌ ÇÏ¿ìÅõ ¹®¼ÀÇ ¸ðµç
ºÎºÐÀ» µÚÁöÁö ¾Êµµ·Ï °¡±ÞÀûÀÌ¸é Æ¯Á¤ÇÑ(specific) ºÎºÐÀ» Áý¾î¼ È®½ÇÇϰÔ
ÇØÁÖ°í, ºÒºÐ¸íÇÑ ºÎºÐÀÌ À§Ä¡ÇÑ ¼½¼ÇÀ» °°ÀÌ Ç¥½ÃÇØ Áֱ⠹ٶõ´Ù. ¶ÇÇϳª
Áß¿äÇÑ Á¡Àº Á¦¸ñ¿¡ VIRTSERVICES HOWTO¶ó´Â ¹®ÀåÀ» ³Ö¾î ¸ÞÀÏÀ» º¸³»¶ó´Â
Á¡ÀÌ´Ù. ±×·¸Áö ¾ÊÀº ´Ù¸¥ ¸ÞÀϵéÀº °³ÀÎÀûÀÎ ¸ÞÀÏ·Î Ãë±ÞµÉ °ÍÀ̱⠶§¹®¿¡
¹«½ÃµÉ ¼öµµ ÀÖ´Ù. (³» Ä£±¸µé ¿ª½Ã ³»°¡ °³ÀÎÀûÀÎ ¸ÞÀÏÀ» ´Ù ÀÐÁö ¾Ê´Â´Ù´Â
»ç½ÇÀ» ¾Ë°í ÀÖ´Ù.)
<p>
³ªÀÇ ¿¹Á¦µéÀº ´ÜÁö ¿¹Á¦ÀÏ »ÓÀ̹ǷΠ±×´ë·Î º¹»çÇØ¼ »ç¿ëÇÏÁö´Â ¸»±â ¹Ù¶õ´Ù.
´ç½ÅÀÌ ÀÌ ¿¹Á¦¸¦ »ç¿ëÇϰíÀÚ ÇÑ´Ù¸é, ´ç½Å ½Ã½ºÅÛ¿¡ ¸Â´Â °ªÀ» ³Ö¾î¾ß ÇÒ °ÍÀÌ´Ù.
¸¸¾à ¾î¶² ¹®Á¦°¡ »ý±ä´Ù¸é ³ª¿¡°Ô ¸ÞÀÏÀ» º¸³»¶ó. ¼³Ä¡¿¡ »ç¿ëÇÑ ¼³Á¤ ÆÄÀϰú
¼³Ä¡¿¡ ¹ß»ýÇÑ ¿¡·¯ ¸Þ¼¼ÁöµéÀ» ¸ðµÎ ³ª¿¡°Ô º¸³»ÁØ´Ù¸é ³»°¡ ±×°ÍÀ» º» µÚ
³ªÀÇ ÀǰßÀ» ´äÀå¿¡ ½á¼ º¸³»ÁÙ °ÍÀÌ´Ù.
<sect1> °»½Å ±â·Ï (Revision History)
<p>
<bf>V1.0</bf>
<p>
ÃÖÃÊÀÇ ¹öÀü
<p>
<bf>V1.1</bf>
<p>
¹öÃß¾ó À¥ ¼³Á¤ ºÎºÐÀÇ ¿¡·¯ ¼öÁ¤
<p>
<bf>V1.2</bf>
<p>
³¯Â¥ ¼öÁ¤
<p>
<bf>V2.0</bf>
<p>
HTML ¸µÅ© °»½Å
<p>
À¥ °»½Å
<p>
»õ·Î¿î ¼¾µå¸ÞÀÏ ¿É¼Ç
<p>
»õ·Î¿î Qmail ¼½¼Ç
<p>
Syslogd °»½Å
<p>
FTP °»½Å
<p>
Virtuald ±âº» ¿É¼Ç
<p>
»õ·Î¿î »ï¹Ù(SAMBA) ¼½¼Ç
<p>
FAQ °»½Å
<p>
<bf>V2.1</bf>
<p>
¸ðµç ÆÐ½º(path)¸¦ /usr/local·Î ¼öÁ¤
Changed all paths to /usr/local.
<p>
VirtualdÀÇ VERBOSELOG ÄÄÆÄÀÏ ¿É¼Ç Ãß°¡
<p>
VirtualmailfilterÀÇ setuid/setgid ¹ö±× ¼öÁ¤
<p>
VirtualmailfilterÀÇ excel ¹ö±× ¼öÁ¤
<p>
VirtualmailfilterÀÇ ´ë¼Ò¹®ÀÚ ¹ö±× ¼öÁ¤.
<p>
VirtualmailfilterÀÇ È¯°æ º¯¼ö È®ÀÎ ¼öÁ¤
<p>
Virtualmailfilter/virtmaildelivery¿¡¼ mbox ÄÚµå Á¦°Å
<p>
Qmail¿¡¼ tcpserver.init pop ¼½¼Ç Ãß°¡
<p>
FAQ¿¡ ¾Ù¸®¾î½º µµ¸ÞÀγ×ÀÓ Áú¹® Ãß°¡
<p>
Virtmailfilter°¡ Ȩ µð·ºÅ丮¸¦ virtmaildelivery·Î º¸³»´Â ºÎºÐ ¼öÁ¤
<sect1> ÀúÀÛ±Ç/¹èÆ÷
<p>
ÀÌ ¹®¼ÀÇ ÀúÀÛ±ÇÀº Copyright (c) 1997 by The Computer Resource Center Inc.
¿¡ ÀÖ´Ù.
<p>
ÀÌ ¹®¼ÀÇ º¹»çº»Àº ÀúÀÚÀÇ µ¿ÀÇ ¾øÀÌ ¾î¶² ¸Åü(¹°¸®Àû, ÀüÀÚÀû)¸¦ ÅëÇØ¼µµ
¹èÆ÷ ¹× Àç»ý»êÀÌ °¡´ÉÇÏ´Ù. ¹ø¿ª ¿ª½Ã ºñ½ÁÇÏ°Ô Çã¿ëµÇ´Âµ¥, ´Ù¸¸ ¹ø¿ªÀÚ¸¦
¹®¼¿¡ ¸í½ÃÇÑ´Ù´Â °ÍÀ» °¡Á¤ÇÑ´Ù. »ó¾÷ÀûÀÎ Àç¹èÆ÷ ¿ª½Ã Çã¿ëµÇ¸ç
Àå·ÁµÇÁö¸¸ ÀÌ·± Á¾·ùÀÇ ¹èÆ÷¿¡ ´ëÇØ¼´Â
<htmlurl url="mailto:brian@nycrc.net" name="Computer Resource Center">
¿¡°Ô ¾Ë·ÁÁֱ⠹ٶõ´Ù.
<p>
ÀÌ ¹®¼ÀÇ ¹ßÃé ¿ª½Ã »çÀü µ¿ÀÇ ¾øÀÌ ÀÌ·ç¾îÁú ¼ö ÀÖ´Ù.
<p>
ÀÌ ¹®¼ÀÇ º¹»çº» Á¦ÀÛ ¹× ¹èÆ÷´Â ÀúÀ۱ǿ¡ ´ëÇÑ ¸í½Ã¿Í Çã°¡¿¡ ´ëÇÑ
ÀÌ ±Ç°í°¡ ¸ðµç ¹èÆ÷º»¿¡ Æ÷Ç﵃ ¶§¿¡¸¸ ÀÎÁ¤µÈ´Ù.
<p>
¿ä¾àÇϸé, ¿ì¸®´Â °¡´ÉÇÑ ¸¹Àº °æ·Î¸¦ ÅëÇØ¼ ÀÌ ¹®¼°¡ ³Î¸® ÆÛÁö±â¸¦ ¹Ù¶õ´Ù.
ÇÏÁö¸¸, ¿ì¸®´Â ¶ÇÇÑ ÀÌ ¹®¼ÀÇ ÀúÀÛ±Ç ¿ª½Ã °è¼Ó °®°íÀֱ⸦ ¿øÇϹǷÎ,
ÀÌ ¹®¼ÀÇ Àç¹èÆ÷¿¡ ´ëÇÑ °ÍÀ» ¾Ë±â¸¦ ¹Ù¶õ´Ù.
<sect> IP ¾Ù¸®¾î½Ì(IP Aliasing)
<p>
IP ¾Ù¸®¾î½ÌÀº °¡»ó È£½ºÆÃ ¸Ó½ÅÀ» ½ÇÇà½Ã۱â À§ÇÑ ¼³Á¤À¸·Î ÇÊ¿äÇÑ
Ä¿³Î ¿É¼ÇÀÌ´Ù. ÀÌ¹Ì À̰Ϳ¡ ´ëÇÑ ¹Ì´Ï-ÇÏ¿ìÅõ°¡ ³ª¿ÍÀÖ´Ù.
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/mini/IP-Alias.html" name="IP aliasing">
<htmlurl url="http://kldp.org//HOWTO/mini/html/IP-Alias/IP-Alias.html" name="¸®´ª½º¿¡¼ IP Aliasing ¼¼ÆÃÇϱâ mini-HOWTO">
À̰ÍÀ» ¾î¶»°Ô ¼³Á¤ÇÏ´ÂÁö ¾Ë°í ½Í´Ù¸é ÀÌ ¹®¼¸¦ Âü°íÇ϶ó.
<sect> Virtuald
<sect1> ¼Ò°³
<p>
¸ðµç ³×Æ®¿öÅ© ¿¬°áÀº 2°³ÀÇ IP ¾îµå·¹½º/Æ÷Æ® ½ÖÀ¸·Î ÀÌ·ç¾îÁø´Ù.
³×Æ®¿öÅ© ÇÁ·Î±×·¡¹ÖÀ» À§ÇÑ API(Applications Program Interface)´Â
¼ÒÄÏ API·Î ºÒ¸°´Ù. ¼ÒÄÏÀº ¸¶Ä¡ ¿·ÁÀÖ´Â ÆÄÀϰú °°ÀÌ ÀÛµ¿Çϱ⠶§¹®¿¡
³×Æ®¿öÅ© ¿¬°áÀ» ÅëÇØ µ¥ÀÌÅ͸¦ ÁÖ°í¹Þ´Â °ÍÀº ¼ÒÄÏ¿¡ ¾²°íÀд °úÁ¤À¸·Î
ÀÌÇØµÈ´Ù. ·ÎÄà ¼ÒÄÏÀÇ ÁÖ¼Ò¸¦ µ¹·ÁÁÖ´Â ÇÔ¼ö´Â <tt>getsockname</tt>ÀÌ´Ù.
Virtuald´Â <tt>getsockname</tt>À» »ç¿ëÇÏ¿© ·ÎÄà ½Ã½ºÅÛÀÇ ¾î¶² IP°¡
Á¢±Ù °¡´ÉÇÑÁö¸¦ ÆÇ´ÜÇÑ´Ù. Virtuald´Â ¼³Á¤ ÆÄÀÏÀ» ÀÐ¾î¼ ÇØ´ç IP¿¡ ÇÒ´çµÈ
µð·ºÅ丮¸¦ µ¹·Á¹Þ´Â´Ù. ±×¸®°í´Â <tt>chroot</tt>¸¦ ÅëÇØ¼ ¸ðµç ¼ºñ½º¿¡ ´ëÇÑ
Á¦¾î±ÇÀ» ³Ñ°ÜÁØ´Ù. <tt>Chroot</tt>Àº ·çÆ® µð·ºÅ丮¸¦ Àç¼³Á¤ÇÏ¿© »õ·Ó°Ô
ÁöÁ¤¹ÞÀº Æ÷ÀÎÆ®¸¦ ·çÆ®·Î ¼³Á¤Çϱ⠶§¹®¿¡ »óÀ§ µð·ºÅ丮´Â ½ÇÇà
ÇÁ·Î±×·¥µé¿¡ ÀÇÇØ ¹«½ÃµÈ´Ù. ³×Æ®¿öÅ© ÇÁ·Î±×·¥¿¡ ´ëÇØ¼´Â ÀÌ °úÁ¤Àº ¸¶Ä¡
¾Æ¹«Àϵµ ÀϾÁö ¾ÊÀº °Íó·³ Åõ¸íÇÏ°Ô º¸ÀÏ °ÍÀÌ´Ù. Virtuald´Â inetd¿Í °°Àº
ÇÁ·Î±×·¥°ú ¿¬°áµÇ¾î ¾î¶² ¼ºñ½º¶óµµ °¡»óÀûÀ¸·Î ¸¸µé ¼ö ÀÖ´Ù.
<sect1> Inetd
<p>
Inetd´Â ¿ÜºÎ¿¡¼ ³×Æ®¿öÅ©¸¦ ÅëÇØ ¿¬°áÀ» ½ÃµµÇÒ ¶§(¿¹¸¦ µé¸é
POP¼¹öÀÇ ¿äû) ¿©·¯ °³ÀÇ Æ÷Æ®¸¦ °¨½ÃÇϰí ÀÖ´Ù°¡ ¿äû¿¡ ´ëÇÑ
Àû´çÇÑ ¿¬°áÀ» ±¸ÇöÇØÁÖ´Â ³×Æ®¿öÅ© super serverÀÌ´Ù. Inetd´Â
³×Æ®¿öÅ©¸¦ Àü¹ÝÀûÀ¸·Î °ü¸®ÇÏ¸é¼ Æ¯Á¤ ÇÁ·Î±×·¥¿¡ ´ëÇØ ³×Æ®¿öÅ©¸¦
¿¬°áÇØ ÁÖ´Â ÀÏÀ» ÇÑ´Ù. ÀÌ·± °úÁ¤À» ÅëÇØ ¾î¶² ¼ºñ½º°¡ ³×Æ®¿öÅ©
¿¬°áÀÌ ÇÊ¿ä ¾øÀ» ¶§ ºÒÇÊ¿äÇÏ°Ô ½ÇÇàµÇ´Â °ÍÀ» ¸·À» ¼ö ÀÖ´Ù.
<p>
Ç¥ÁØÀûÀÎ /etc/inetd.conf ÆÄÀÏÀº ´ÙÀ½°ú °°´Ù:
<verb>
ftp stream tcp nowait root /usr/sbin/tcpd \
wu.ftpd -l -a
pop-3 stream tcp nowait root /usr/sbin/tcpd \
in.qpop -s
</verb>
°¡»ó ¼ºñ½º¸¦ ÇÒ ¶§ /etc/inetd.conf ÆÄÀÏÀº ´ÙÀ½°ú °°ÀÌ µÈ´Ù:
<verb>
ftp stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.ftp wu.ftpd -l -a
pop-3 stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.pop in.qpop -s
</verb>
<sect1> ¼³Á¤ ÆÄÀÏ
<p>
°¢°¢ÀÇ ¼ºñ½ºµéÀº ¾î¶² IPµé°ú µð·ºÅ丮µéÀ» »ç¿ëÇÏ°í °ü¸®ÇÒ °ÍÀÎÁö¿¡
´ëÇÑ Á¤º¸¸¦ ¼³Á¤ ÆÄÀÏ¿¡¼ ¾ò°Ô µÈ´Ù. ´ç½ÅÀº ÇϳªÀÇ Àüü ¼³Á¤ ÆÄÀÏ
(master config file)À» °®´øÁö ¾Æ´Ï¸é ¸î¸îÀÇ ¼³Á¤ ÆÄÀϵéÀ» ÅëÇØ¼
°¢°¢ÀÇ ¼ºñ½º¿¡¼ µµ¸ÞÀÎÀÇ ´Ù¸¥ ¸®½ºÆ®¸¦ ¾ò°Ô ÇÒ ¼ö ÀÖ´Ù. ¼³Á¤ ÆÄÀÏÀº
´ÙÀ½°ú °°´Ù:
<verb>
# This is a comment and so are blank lines
# Format IP SPACE dir NOSPACES
10.10.10.129 /virtual/domain1.com
10.10.10.130 /virtual/domain2.com
10.10.10.157 /virtual/domain3.com
# Default option for all other IPs
default /
</verb>
<sect1> ¼Ò½ºÄÚµå
<p>
¾Æ·¡´Â virtuald ÇÁ·Î±×·¥¿¡ ´ëÇÑ C ¼Ò½º ÄÚµåÀÌ´Ù. À̰ÍÀ» ÄÄÆÄÀÏÇϰí
/usr/local/bin ¾Æ·¡¿¡ 0755ÀÇ ÆÛ¹Ì¼ÇÀ¸·Î ¼³Ä¡Ç϶ó.(¼ÒÀ¯ÀÚ¿Í ±×·ìÀº
¸ðµÎ root·Î ÇÑ´Ù.) ÄÄÆÄÀϽÿ¡´Â VERBOSELOG°¡ ¿É¼ÇÀ¸·Î »ç¿ëµÉ ¼ö Àִµ¥
(¿ÀÁ÷ ÀÌ ¿É¼Ç¸¸ÀÌ Á¸ÀçÇÑ´Ù), À̰ÍÀº ¿¬°á½Ã ±â·ÏÀ» ³²±æ°ÍÀÎÁö¸¦ Á¤ÇÑ´Ù.
<verb>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include <syslog.h>
#include <stdio.h>
#undef VERBOSELOG
#define BUFSIZE 8192
int getipaddr(char **ipaddr)
{
struct sockaddr_in virtual_addr;
static char ipaddrbuf[BUFSIZE];
int virtual_len;
char *ipptr;
virtual_len=sizeof(virtual_addr);
if (getsockname(0,(struct sockaddr *)&virtual_addr,&virtual_len)<0)
{
syslog(LOG_ERR,"getipaddr: getsockname failed: %m");
return -1;
}
if (!(ipptr=inet_ntoa(virtual_addr.sin_addr)))
{
syslog(LOG_ERR,"getipaddr: inet_ntoa failed: %m");
return -1;
}
strncpy(ipaddrbuf,ipptr,sizeof(ipaddrbuf)-1);
*ipaddr=ipaddrbuf;
return 0;
}
int iptodir(char **dir,char *ipaddr,char *filename)
{
char buffer[BUFSIZE],*bufptr;
static char dirbuf[BUFSIZE];
FILE *fp;
if (!(fp=fopen(filename,"r")))
{
syslog(LOG_ERR,"iptodir: fopen failed: %m");
return -1;
}
*dir=NULL;
while(fgets(buffer,BUFSIZE,fp))
{
buffer[strlen(buffer)-1]=0;
if (*buffer=='#' || *buffer==0)
continue;
if (!(bufptr=strchr(buffer,' ')))
{
syslog(LOG_ERR,"iptodir: strchr failed");
return -1;
}
*bufptr++=0;
if (!strcmp(buffer,ipaddr))
{
strncpy(dirbuf,bufptr,sizeof(dirbuf)-1);
*dir=dirbuf;
break;
}
if (!strcmp(buffer,"default"))
{
strncpy(dirbuf,bufptr,sizeof(dirbuf)-1);
*dir=dirbuf;
break;
}
}
if (fclose(fp)==EOF)
{
syslog(LOG_ERR,"iptodir: fclose failed: %m");
return -1;
}
if (!*dir)
{
syslog(LOG_ERR,"iptodir: ip not found in conf file");
return -1;
}
return 0;
}
int main(int argc,char **argv)
{
char *ipaddr,*dir;
openlog("virtuald",LOG_PID,LOG_DAEMON);
#ifdef VERBOSELOG
syslog(LOG_ERR,"Virtuald Starting: $Revision: 1.1 $");
#endif
if (!argv[1])
{
syslog(LOG_ERR,"invalid arguments: no conf file");
exit(0);
}
if (!argv[2])
{
syslog(LOG_ERR,"invalid arguments: no program to run");
exit(0);
}
if (getipaddr(&ipaddr))
{
syslog(LOG_ERR,"getipaddr failed");
exit(0);
}
#ifdef VERBOSELOG
syslog(LOG_ERR,"Incoming ip: %s",ipaddr);
#endif
if (iptodir(&dir,ipaddr,argv[1]))
{
syslog(LOG_ERR,"iptodir failed");
exit(0);
}
if (chroot(dir)<0)
{
syslog(LOG_ERR,"chroot failed: %m");
exit(0);
}
#ifdef VERBOSELOG
syslog(LOG_ERR,"Chroot dir: %s",dir);
#endif
if (chdir("/")<0)
{
syslog(LOG_ERR,"chdir failed: %m");
exit(0);
}
if (execvp(argv[2],argv+2)<0)
{
syslog(LOG_ERR,"execvp failed: %m");
exit(0);
}
closelog();
exit(0);
}
</verb>
<sect> ¼Ð ½ºÅ©¸³Æ®
<sect1> Virtfs
<p>
°¢°¢ÀÇ µµ¸ÞÀÎÀº ÀڽŸ¸ÀÇ µð·ºÅ丮 ±¸Á¶¸¦ °¡Áø´Ù. µû¶ó¼ ¸¸¾à
<tt>chroot</tt>¸¦ »ç¿ëÇÏ·Á°í ÇÑ´Ù¸é, ´ç½ÅÀº °øÀ¯ ¶óÀ̺귯¸®³ª ¹ÙÀ̳ʸ®
½ÇÇàÆÄÀϵé, ¼³Á¤ ÆÄÀÏ µîÀ» º¹Á¦ÇÏ´Â °úÁ¤ÀÌ ÇÊ¿äÇÏ´Ù. ³ª´Â ³»°¡ ¸¸µç
°¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼ /virtual/domain1.comÀ» »ç¿ëÇÑ´Ù.
<p>
¹°·Ð ´õ ¸¹Àº µð½ºÅ©ÀÇ °ø°£ÀÌ ÇÊ¿äÇÏ°Ô µÇÁö¸¸, ±×°ÍÀÌ »õ·Î¿î ¸Ó½Å°ú
³×Æ®¿öÅ© Ä«µå¸¦ ¼³Ä¡ÇÏ´Â °Íº¸´Ù´Â °ªÀÌ Àú·ÅÇÏ´Ù. ¸¸¾à ´ç½ÅÀÌ °ø°£À» Àý¾àÇϰí
½Í´Ù¸é ÇÏµå ¸µÅ©¸¦ ÀÌ¿ëÇÒ ¼ö Àִµ¥, ³» °æ¿ì ÀÌ ¹æ¹ýÀ» »ç¿ëÇϸé 2M°¡ ¾à°£
³Ñ´Â °ø°£¸¸À» »ç¿ëÇÏ°Ô µÈ´Ù. ÇÏÁö¸¸, ÀÌ ½ºÅ©¸³Æ®´Â °¡±ÞÀû ÀϹÝÀûÀÎ ½Ã½ºÅÛÀ»
¸¸µé±â À§ÇØ ¸ÞÀÎ ÆÄÀϽýºÅÛ¿¡¼ ¸ðµç ÆÄÀÏÀ» º¹»çÇÏ·Á ÇÒ °ÍÀÌ´Ù.
<p>
¿©±â °£´ÜÇÑ virtfs ½ºÅ©¸³Æ®°¡ ÀÖ´Ù:
<verb>
#!/bin/sh
echo '$Revision: 1.1 $'
echo -n "Enter the domain name: "
read domain
if [ "$domain" = "" ]
then
echo Nothing entered: aborting
exit 0
fi
leadingdir=/virtual
echo -n "Enter leading dir: (Enter for default: $leadingdir): "
read ans
if [ "$ans" != "" ]
then
leadingdir=$ans
fi
newdir=$leadingdir/$domain
if [ -d "$newdir" ]
then
echo New directory: $newdir: ALREADY exists
exit 0
else
echo New directory: $newdir
fi
echo Create $newdir
mkdir -p $newdir
echo Create bin
cp -pdR /bin $newdir
echo Create dev
cp -pdR /dev $newdir
echo Create dev/log
ln -f /virtual/log $newdir/dev/log
echo Create etc
mkdir -p $newdir/etc
for i in /etc/*
do
if [ -d "$i" ]
then
continue
fi
cp -pd $i $newdir/etc
done
echo Create etc/skel
mkdir -p $newdir/etc/skel
echo Create home
for i in a b c d e f g h i j k l m n o p q r s t u v w x y z
do
mkdir -p $newdir/home/$i
done
echo Create home/c/crc
mkdir -p $newdir/home/c/crc
chown crc.users $newdir/home/c/crc
echo Create lib
mkdir -p $newdir/lib
for i in /lib/*
do
if [ -d "$i" ]
then
continue
fi
cp -pd $i $newdir/lib
done
echo Create proc
mkdir -p $newdir/proc
echo Create sbin
cp -pdR /sbin $newdir
echo Create tmp
mkdir -p -m 0777 $newdir/tmp
chmod +t $newdir/tmp
echo Create usr
mkdir -p $newdir/usr
echo Create usr/bin
cp -pdR /usr/bin $newdir/usr
echo Create usr/lib
mkdir -p $newdir/usr/lib
echo Create usr/lib/locale
cp -pdR /usr/lib/locale $newdir/usr/lib
echo Create usr/lib/terminfo
cp -pdR /usr/lib/terminfo $newdir/usr/lib
echo Create usr/lib/zoneinfo
cp -pdR /usr/lib/zoneinfo $newdir/usr/lib
echo Create usr/lib/\*.so\*
cp -pdR /usr/lib/*.so* $newdir/usr/lib
echo Create usr/sbin
cp -pdR /usr/sbin $newdir/usr
echo Linking usr/tmp
ln -s /tmp $newdir/usr/tmp
echo Create var
mkdir -p $newdir/var
echo Create var/lock
cp -pdR /var/lock $newdir/var
echo Create var/log
mkdir -p $newdir/var/log
echo Create var/log/wtmp
cp /dev/null $newdir/var/log/wtmp
echo Create var/run
cp -pdR /var/run $newdir/var
echo Create var/run/utmp
cp /dev/null $newdir/var/run/utmp
echo Create var/spool
cp -pdR /var/spool $newdir/var
echo Linking var/tmp
ln -s /tmp $newdir/var/tmp
echo Create var/www/html
mkdir -p $newdir/var/www/html
chown webmast.www $newdir/var/www/html
chmod g+s $newdir/var/www/html
echo Create var/www/master
mkdir -p $newdir/var/www/master
chown webmast.www $newdir/var/www/master
echo Create var/www/server
mkdir -p $newdir/var/www/server
chown webmast.www $newdir/var/www/server
exit 0
</verb>
<sect1> Virtexec
<p>
°¡»ó ȯ°æ¿¡¼ ¸í·É¾î¸¦ ½ÇÇà½Ã۱â À§Çؼ ´ç½ÅÀº <tt>chroot</tt>¸¦
ÀÌ¿ëÇÏ¿© µð·ºÅ丮¸¦ º¯°æÇÑ µÚ ¸í·É¾î¸¦ ½ÇÇàÇØ¾ß¸¸ ÇÑ´Ù. ¿©±â ¾î¶²
¸í·É¿¡ ´ëÇØ¼ ÀÌ·± ±â´ÉÀ» ¼öÇàÇÒ ¼ö Àִ Ưº°ÇÑ ¼Ð½ºÅ©¸³Æ®ÀÎ
virtexec¸¦ ¼Ò°³ÇÑ´Ù:
<verb>
#!/bin/sh
echo '$Revision: 1.1 $'
BNAME=`basename $0`
FIRST4CHAR=`echo $BNAME | cut -c1-4`
REALBNAME=`echo $BNAME | cut -c5-`
if [ "$BNAME" = "virtexec" ]
then
echo Cannot run virtexec directly: NEED a symlink
exit 0
fi
if [ "$FIRST4CHAR" != "virt" ]
then
echo Symlink not a virt function
exit 0
fi
list=""
num=1
for i in /virtual/*
do
if [ ! -d "$i" ]
then
continue
fi
if [ "$i" = "/virtual/lost+found" ]
then
continue
fi
list="$list $i $num"
num=`expr $num + 1`
done
if [ "$list" = "" ]
then
echo No virtual environments exist
exit 0
fi
dialog --clear --title 'Virtexec' --menu Pick 20 70 12 $list 2> /tmp/menu.$$
if [ "$?" = "0" ]
then
newdir=`cat /tmp/menu.$$`
else
newdir=""
fi
tput clear
rm -f /tmp/menu.$$
echo '$Revision: 1.1 $'
if [ ! -d "$newdir" ]
then
echo New directory: $newdir: NOT EXIST
exit 0
else
echo New directory: $newdir
fi
echo bname: $BNAME
echo realbname: $REALBNAME
if [ "$*" = "" ]
then
echo args: none
else
echo args: $*
fi
echo Changing to $newdir
cd $newdir
echo Running program $REALBNAME
chroot $newdir $REALBNAME $*
exit 0
</verb>
ÀÌ ½ºÅ©¸³Æ®°¡ ½ÇÇàµÇ±â À§Çؼ ´ç½Å ½Ã½ºÅÛ¿¡ <tt> dialog</tt> ÇÁ·Î±×·¥ÀÌ
¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù´Â °ÍÀ» ÁÖÀÇÇ϶ó. virtexec¸¦ »ç¿ëÇϱâ À§Çؼ´Â ´ÜÁö
½Éº¼¸¯ ¸µÅ©¸¦ ÇØÁÖ¸é µÈ´Ù. ¿¹¸¦ µé¸é ´ÙÀ½°ú °°´Ù.
<verb>
ln -s /usr/local/bin/virtexec /usr/local/bin/virtpasswd
ln -s /usr/local/bin/virtexec /usr/local/bin/virtvi
ln -s /usr/local/bin/virtexec /usr/local/bin/virtpico
ln -s /usr/local/bin/virtexec /usr/local/bin/virtemacs
ln -s /usr/local/bin/virtexec /usr/local/bin/virtmailq
</verb>
¸µÅ©¸¦ ½ÃŲ ÈÄ virtvi¸¦ ½ÇÇà½ÃŰ¸é °¡»ó ½Ã½ºÅÛÀÇ vi¸¦ ½ÇÇà½Ãų °ÍÀÌ´Ù.
¸¶Âù°¡Áö·Î virtpasswd´Â °¡»ó ½Ã½ºÅÛÀÇ »ç¿ëÀÚ ºñ¹Ð¹øÈ£¸¦ ¹Ù²Ü °ÍÀ̰í,
virtmailq´Â °¡»ó °ø°£ÀÇ ¸ÞÀÏ Å¥(queue)¸¦ È®ÀÎÇÒ °ÍÀÌ´Ù. ´ç½ÅÀº ¿øÇÏ´Â ¸¸Å
virtexec¸¦ ¸¸µé ¼ö ÀÖ´Ù. ¸¸¾à ´ç½ÅÀÇ ÇÁ·Î±×·¥ÀÌ °øÀ¯ ¶óÀ̺귯¸®¸¦ ÇÊ¿ä·Î
ÇÑ´Ù¸é ¹ÙÀ̳ʸ®¿Í ¸¶Âù°¡Áö·Î °¡»ó ÆÄÀϽýºÅÛ¿¡ À§Ä¡½Ãų ¼ö ÀÖ´Ù.
<sect1> °ø°í(Note)
<p>
³ª´Â ¸ðµç ½ºÅ©¸³Æ®µéÀ» /usr/local/bin¿¡ ¼³Ä¡Çß´Ù. ±× À̿ܿ¡ °¡»ó ÆÄÀϽýºÅÛ¿¡
³Ö°í½ÍÁö ¾ÊÀº °ÍµéÀº /usr/local¿¡ µÎ¾ú´Ù. ½ºÅ©¸³Æ®´Â /usr/local¿¡ ÀÖ´Â ÆÄÀÏÀ»
°¡»ó ÆÄÀϽýºÅÛÀ¸·Î º¹»çÇÏÁö ¾Ê´Â´Ù. °¡»ó ÆÄÀϽýºÅÛÀ¸·Î ³Ñ¾î¿À¸é ¾ÈµÇ´Â
Áß¿äÇÑ ÆÄÀϵéÀº ¹Ýµå½Ã °¡»ó ½Ã½ºÅÛ¿¡¼ Á¦°ÅµÇ¾î¾ß ÇÑ´Ù. ÇÑ ¿¹·Î, ³» ½Ã½ºÅÛ¿¡´Â
ssh°¡ ¼³Ä¡µÇ¾î Àִµ¥, ¸ðµç °¡»óÀÇ ÆÄÀÏ ½Ã½ºÅÛÀÇ ¼¹ö¿¡¼´Â °³ÀÎŰ(private
key)¸¦ ¿øÇÏÁö ¾Ê±â ¶§¹®¿¡, virtfs¸¦ ½ÇÇà½ÃŲ ÀÌÈÄ¿¡ °¢°¢ÀÇ °¡»ó ÆÄÀÏ ½Ã½ºÅÛ¿¡¼
À̰ÍÀ» Á¦°ÅÇß´Ù. ¶ÇÇÑ resolv.conf¸¦ ¹Ù²Ù°í, ±× ¾È¿¡ ÀÖ´ø ´Ù¸¥ µµ¸ÞÀεéÀÇ
À̸§À» °¡Áø ¸ðµç °ÍµéÀ» »èÁ¦Çß´Ù. ÀÌ·± °Íµé·Î´Â /etc/hosts³ª /etc/HOSTNAME
µîÀÌ ÀÖ´Ù.
<p>
³»°¡ virtexec·Î ½Éº¼¸¯ ¸µÅ©½ÃŲ ÇÁ·Î±×·¥µéÀÌ´Ù:
<itemize>
<item> virtpasswd -- »ç¿ëÀÚ ºñ¹Ð¹øÈ£ º¯°æ
<item> virtadduser -- »ç¿ëÀÚ Ãß°¡
<item> virtdeluser -- »ç¿ëÀÚ »èÁ¦
<item> virtsmbstatus -- »ï¹Ù(SAMBA) »óÅ º¸±â
<item> virtvi -- ÆÄÀÏ ÆíÁý
<item> virtmailq -- ¸ÞÀÏÅ¥ È®ÀÎ
<item> virtnewaliases -- ¾Ù¸®¾î½º Å×ÀÌºí »õ·Î ±¸Ãà
</itemize>
<sect> DNS
<p>
DNS ¿ª½Ã Á¤»óÀûÀ¸·Î ¼³Á¤µÉ ¼ö ÀÖ´Ù. À̰ÍÀº
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/DNS-HOWTO.html" name="DNS HOWTO">.
¸¦ ÂüÁ¶Ç϶ó.
<sect> Syslogd
<sect1> ¹®Á¦µé
<p>
Syslogd´Â ÀϹÝÀûÀÎ À¯´Ð½º ½Ã½ºÅÛ¿¡¼ »ç¿ëµÇ´Â ½Ã½ºÅÛ ±â·Ï µµ±¸ÀÌ´Ù.
Syslogd´Â FIFO¶ó ºÒ¸®´Â Ưº°ÇÑ ÆÄÀÏÀ» ¿©´Â µ¥¸óÀε¥, FIFO´Â ÇϳªÀÇ ÆÄÀÌÇÁ¿Í
°°ÀÌ ÀÛµ¿Çϴ Ưº°ÇÑ ÆÄÀÏÀÌ´Ù. ¾²´Â ÂÊ¿¡¼ ±â·ÏÇÑ ³»¿ëÀº ¸ðµÎ Àд ÂÊ¿¡ ³ªÅ¸³ª°Ô
µÈ´Ù. Syslogd´Â Àд ÂÊ¿¡¼ º¸³»´Â µ¥ÀÌÅ͸¦ ±â´Ù¸®°í ÀÖ´Ù. CÀÇ ÇÔ¼ö °¡¿îµ¥¿¡´Â
¾²´Â ÂÊ¿¡ ¹«¾ð°¡¸¦ ±â·ÏÇÒ ¼ö ÀÖ´Â ÇÔ¼ö°¡ Àִµ¥, ÇÁ·Î±×·¥¿¡¼ ÀÌ ÇÔ¼ö¸¦
»ç¿ëÇÑ´Ù¸é, ´ç½ÅÀÇ Ãâ·Â °á°ú´Â syslogd·Î °¡°Ô µÈ´Ù.
<p>
<tt>Chroot</tt>¸¦ »ç¿ëÇϴ ȯ°æ¿¡¼´Â syslogd°¡ (/dev/log)¿¡¼ ÀоîµéÀÏ FIFO°¡
Á¸ÀçÇÏÁö ¾Ê°Ô µÈ´Ù. À̰ÍÀº ¸ðµç °¡»ó ȯ°æ¿¡¼ syslogd·Î µé¾î°¥ ¼ö ¾ø´Ù´Â °ÍÀ»
ÀǹÌÇÑ´Ù.
<sect1> Solution
<sect2> Setup Links
<p>
Syslogd´Â ¸í·É¾î ¶óÀο¡¼ ¼³Á¤À» ÇØÁØ´Ù¸é ´Ù¸¥ FIFO¸¦ ãÀ» ¼ö ÀÖ´Ù:
<verb>
syslogd -p /virtual/log
</verb>
±×¸®°í´Â /virtual/log¸¦ /dev/log·Î ½Éº¼¸µ ¸µÅ©½ÃŲ´Ù:
<verb>
ln -sf /virtual/log /dev/log
</verb>
±×¸®°í´Â ¸ðµç /dev/logÀÇ º¹»çº»À» ÀÌ ÆÄÀÏ·Î Çϵ帵ũ ½ÃŲ´Ù:
<verb>
ln -f /virtual/log /virtual/domain1.com/dev/log
</verb>
virtfs ½ºÅ©¸³Æ®´Â ÀÌ¹Ì ÀÌ °úÁ¤À» ¼öÇàÇÑ´Ù. /virtualÀÌ µð½ºÅ© °ø°£¿¡ ÀÎÁ¢ÇØ ÀÖ°í
/dev/log°¡ Çϵ帵ũµÇ¾î ÀÖ´Â »óÅÂÀ̱⠶§¹®¿¡, À̵éÀº °°Àº inode ¼ýÀÚ¸¦ °¡Áö°í
°°Àº µ¥ÀÌÅ͸¦ °¡¸®Å°°í ÀÖ´Ù. ¸ðµç °¡»óÀÇ /dev/log µéÀÌ µ¿½Ã¿¡ ÀÛµ¿ÁßÀ̱⠶§¹®¿¡
<tt>chroot</tt>µµ À̰ÍÀ» ¸ØÃâ ¼ö ¾ø´Ù.
¸ðµç ȯ°æ¿¡¼ºÎÅÍÀÇ ¸ðµç ¸Þ¼¼Áö°¡ ÇϳªÀÇ Àå¼Ò¿¡ ±â·ÏµÈ´Ù´Â »ç½ÇÀ» ±â¾ïÇ϶ó.
ÇÏÁö¸¸, ÀÌ µ¥ÀÌÅÍ¿¡¼ ¿øÇÏ´Â ÀڷḸ °É·¯³»´Â µ¶¸³ÀûÀÎ ÇÁ·Î±×·¥À» ½±°Ô ¸¸µé ¼ö
ÀÖÀ» °ÍÀÌ´Ù.
<sect2> Syslogd.init
<p>
syslogd.initÀÇ ÀÌ ¹öÀüÀº syslogd°¡ ½ÃÀÛÇÒ ¶§¸¶´Ù /dev/log FIFO¸¦ Áö¿ì°í
»õ·Î ¸¸µé±â ¶§¹®¿¡ ¸Å¹ø /dev/log¿¡ Çϵ帵ũ½ÃÄÑ¾ß ÇÑ´Ù. ¿©±â º¯ÇüµÈ
syslogd.init ÆÄÀÏÀÌ ÀÖ´Ù:
<verb>
#!/bin/sh
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting dev log: "
ln -sf /virtual/log /dev/log
echo done
echo -n "Starting system loggers: "
daemon syslogd -p /virtual/log
daemon klogd
echo
echo -n "Starting virtual dev log: "
for i in /virtual/*
do
if [ ! -d "$i" ]
then
continue
fi
if [ "$i" = "/virtual/lost+found" ]
then
continue
fi
ln -f /virtual/log $i/dev/log
echo -n "."
done
echo " done"
touch /var/lock/subsys/syslogd
;;
stop)
echo -n "Shutting down system loggers: "
killproc syslogd
killproc klogd
echo
rm -f /var/lock/subsys/syslogd
;;
*)
echo "Usage: syslogd {start|stop}"
exit 1
esac
exit 0
</verb>
<sect1> ¿©·¯°³ÀÇ Syslogd
<sect2> ÇϳªÀÇ µð½ºÅ©¿¡ ÇѰ³ÀÇ syslogd
<p>
¸¸¾à ´ç½ÅÀÌ ¼³Á¤ÇÑ ÇϳªÀÇ ÆÄÀϽýºÅÛÀÌ ³ÑÃļ ´Ù¸¥ µð½ºÅ©¿¡ ÀÖ´Â °ø°£À» °¡»ó
½Ã½ºÅÛ¿¡¼ »ç¿ëÇϰíÀÚ ÇÑ´Ù¸é, ÇÏµå ¸µÅ©¸¦ ÅëÇØ¼ ¼·Î ´Ù¸¥ µð½ºÅ©¸¦ ¿¬°áÇÒ ¼ö
¾ø´Ù´Â »ç½ÇÀ» ¸í½ÉÇϱ⠹ٶõ´Ù. À̰ÍÀº ÇÑ µµ¸ÞÀο¡ ´ëÇØ¼µµ ¼·Î ´Ù¸¥ µð½ºÅ©¿¡¼´Â
°¢°¢ÀÇ syslogd¸¦ ½ÇÇà½ÃÄÑ¾ß ÇÑ´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù. ÇÑ ¿¹·Î, ¸¸¾à ´ç½ÅÀÌ /virtual1¿¡
13°³ÀÇ µµ¸ÞÀÎÀ» °¡Áö°í ÀÖ°í, /virtual2¿¡ 15°³ÀÇ µµ¸ÞÀÎÀ» °¡Áö°í ÀÖ´Ù¸é,
13°³ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼´Â /virtual1/log¿¡ ÇÏµå ¸µÅ©¸¦
½ÃŲ ÈÄ, <tt> syslogd -p /virtual1/log </tt>¿Í °°Àº
¹æ¹ýÀ¸·Î °¢°¢ syslogd¸¦ ½ÇÇà½ÃŲ´Ù. ¸¶Âù°¡Áö ¹æ¹ýÀ¸·Î /virtual2¿¡ 15°³ÀÇ
´Ù¸¥ µµ¸ÞÀÎÀ» /virtual2/log¿¡ Çϵ帵ũ ½ÃŲ ÈÄ <tt>syslogd -p /virtual2/log</tt>
ÀÇ ¹æ¹ýÀ¸·Î syslogd¸¦ ½ÇÇà½ÃŲ´Ù.
<sect2> ÇϳªÀÇ µµ¸ÞÀο¡ ÇϳªÀÇ syslogd
<p>
¸¸¾à ´ç½ÅÀÌ ¸ðµç ±â·ÏµéÀ» ÇϳªÀÇ À§Ä¡·Î ÁýÁß½ÃŰ°í ½ÍÁö ¾Ê´Ù¸é °¢°¢ÀÇ µµ¸ÞÀο¡
´ëÇØ¼ syslogd¸¦ µû·Î ½ÇÇà½Ãų ¼ö ÀÖ´Ù. À̰ÍÀº ÇÁ·Î¼¼½º ID¸¦ ³¶ºñÇϱ⠶§¹®¿¡
±ÇÇÏ°í ½ÍÀº ¹æ¹ýÀº ¾Æ´ÏÁö¸¸, À̰ÍÀ» ±¸ÇöÇÏ´Â °ÍÀº ½¬¿î ÀÏÀÌ´Ù. ´ç½ÅÀº syslogd.init
ÆÄÀÏ¿¡¼ <tt> chroot /virtual/domain1.com syslogd</tt>·Î °¢°¢ÀÇ
µµ¸ÞÀο¡ ´ëÇØ syslogd¸¦ ½ÇÇà½Ãų ¼ö ÀÖ´Ù. À̰ÍÀº <tt>chroot</tt> ¾È¿¡¼ °¢°¢ÀÇ
syslogd¸¦ ½ÇÇà½ÃŰ¸ç ±× ±â·ÏÀº /var/log°¡ ¾Æ´Ï¶ó /virtual/domain1.com/var/log¿¡
±â·ÏµÉ °ÍÀÌ´Ù. ¸ÞÀÎ ½Ã½ºÅÛ¿¡¼ ÀÏ¹Ý <tt>syslogd</tt>¿Í Ä¿³Î ±â·ÏÀ» À§ÇÑ
<tt>klogd</tt>¸¦ ½ÇÇà½ÃŰ´Â °ÍÀ» ÀØÁö ¸»¶ó.
<sect> °¡»ó FTP
<sect1> Inetd
<p>
Wu-ftpd´Â ÀÚüÀûÀ¸·Î °¡»ó ½Ã½ºÅÛ¿¡ ¸Â°Ô ±¸¼ºµÉ ¼ö ÀÖ´Ù. ÇÏÁö¸¸, °¢°¢ÀÇ µµ¸ÞÀο¡
´ëÇØ¼ ºÐ¸®µÈ ºñ¹Ð¹øÈ£ ÆÄÀÏÀ» °ü¸®ÇÒ ¼ö´Â ¾ø´Ù. ¿¹¸¦ µé¸é,
<tt> bob@domain1.com </tt> ¿Í <tt> bob@domain2.com </tt>¸¦ ¿øÇÒ ¶§, µÎ µµ¸ÞÀÎÀÇ
°èÁ¤ °¡¿îµ¥ ÇϳªÀÇ À̸§À» bob2·Î ¹Ù²Ù´øÁö ±× ÀÌ¿ÜÀÇ ´Ù¸¥ °èÁ¤ À̸§À» »ç¿ëÇØ¾ß ÇÑ´Ù.
ÇÏÁö¸¸ ¸¸¾à ´ç½ÅÀÌ °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼ °¡»óÀÇ ÆÄÀϽýºÅÛÀ» °¡Áö°í ÀÖ´Ù¸é, °¢°¢ÀÇ
ºñ¹Ð¹øÈ£ ÆÄÀÏÀ» °¡Áú ¼ö Àֱ⠶§¹®¿¡ ÀÌ·± ¹®Á¦¸¦ ÇØ°áÇÒ ¼ö ÀÖ´Ù. ´ÜÁö virtnewuser
½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÏ¿© »ç¿ëÀÚ¸¦ ¸¸µé°í virtpasswd ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇØ¼ ºñ¹Ð¹øÈ£¸¦
¼³Á¤ÇØ ÁÖ¸é À§¿¡¼ ¸»ÇÑ »óȲ¿¡ ´ëÇØ ¸ðµç ¼³Á¤À» ³¡³¾ ¼ö ÀÖ´Ù.
<p>
wu-ftpd¸¦ À§ÇÑ inetd.confÀÇ ¿£Æ®¸®´Â ´ÙÀ½°ú °°´Ù:
<verb>
ftp stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.ftp wu.ftpd -l -a
</verb>
<sect1> À͸íÀÇ FTP(Anonymous FTP)
<p>
À̰ÍÀº virtualdÀÇ ¼³Á¤¿¡ ¿µÇâÀ» ¹ÞÁö ¾Ê´Â´Ù. ¿ì¼±
/virtuald/domain1.com/etc/passwd ¾È¿¡ ÀϹÝÀûÀÎ °æ¿ì¿Í ¸¶Âù°¡Áö·Î FTP
»ç¿ëÀÚ¸¦ »ý¼ºÇÑ´Ù.
<verb>
ftp:x:14:50:Anonymous FTP:/var/ftp:/bin/false
</verb>
±×¸®°í´Â À͸íÀÇ FTP¸¦ À§ÇÑ µð·ºÅ丮¸¦ ¼³Á¤ÇÑ´Ù. °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼
¼·Î ´Ù¸¥ ºñ¹Ð¹øÈ£ ÆÄÀÏÀ» °¡Áö°í Àֱ⠶§¹®¿¡ À͸íÀÇ FTP¸¦ Á¦°øÇÒ µµ¸ÞÀÎÀ»
¼±ÅÃÇÒ ¼ö ÀÖ´Ù. FTP ¼¹ö´Â ÀÌ¹Ì <tt>chroot</tt>¿¡ ÀÇÇØ
/virtual/domain1.com µð·ºÅ丮¿¡ ¼³Á¤µÇ¾î Àֱ⠶§¹®¿¡ ¾î¶² Ãß°¡°æ·Îµµ ¾Õ¿¡
¼³Á¤ÇÒ ÇÊ¿ä´Â ¾ø´Ù.
<sect1> °¡»óÀÇ FTP »ç¿ëÀÚµé
<p>
Wu-ftpd´Â ¹æ¹®ÀÚ ±×·ì(guest group)À̶ó´Â °ÍÀ» Áö¿øÇÑ´Ù. À̰ÍÀ» ÀÌ¿ëÇϸé
°¢°¢ÀÇ »ç¿ëÀڵ鿡 ´ëÇØ¼ ´Ù¸¥ FTP °ø°£À» ¸¸µé ¼ö ÀÖ´Ù. ¶ÇÇÑ FTP ¼¹ö´Â
ƯÁ¤ °ø°£¿¡ ´ëÇØ <tt>chroot</tt>¸¦ ÀÌ¿ëÇØ¼ »ç¿ëÀÚ°¡ Á¤ÇØÁø
µð·ºÅ丮 ¹ÛÀ¸·Î ³ª°¥ ¼ö ¾ø°Ô ¸¸µé ¼ö ÀÖ´Ù. ¸¸¾à ´ç½ÅÀÌ °¡»ó µµ¸ÞÀÎ
¾È¿¡ ÀÌ ¹æ¹ýÀ¸·Î »ç¿ëÀÚµéÀ» Ãß°¡ÇÑ´Ù¸é ±× »ç¿ëÀÚµéÀº ½Ã½ºÅÛ
ÆÄÀϵéÀ» º¼ ¼ö ¾ø°Ô µÈ´Ù.
<p>
¹æ¹®ÀÚ ±×·ìÀº /virtual/domain1.com/etc/ftpaccess ÆÄÀÏ¿¡ Ãß°¡µÈ´Ù.
<p>
/virtual/domain1.com/etc/passwd ¾È¿¡ ¿£Æ®¸®¸¦ ¸¸µé°í ½ÃÀÛÇϴ Ȩ µð·ºÅ丮´Â
chroot µð·ºÅ丮¿Í <tt>/./</tt>·Î ºÐ¸®ÇÑ´Ù.
<verb>
guest1:x:8500:51:Guest FTP:/home/g/guest1/./incoming:/bin/false
</verb>
<p>
±× ´ÙÀ½¿¡´Â ¹æ¹®ÀÚÀÇ È¨À» À͸íÀÇ FTP¸¦ ¼³Á¤ÇÏ´ø ¶§¿Í ¸¶Âù°¡Áö·Î ¼³Á¤ÇØ ÁØ´Ù.
°¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼ ºñ¹Ð¹øÈ£ ÆÄÀÏÀ» µû·Î °ü¸®Çϱ⠶§¹®¿¡ ¾î¶² µµ¸ÞÀο¡
¹æ¹®ÀÚ °èÁ¤ÀÌ Á¸ÀçÇÏ´ÂÁö, ±×¸®°í °¢ µµ¸ÞÀÎÀÇ ¾î¶² »ç¿ëÀÚµéÀÌ ¹æ¹®ÀÚ ±×·ìÀ¸·Î
¼³Á¤µÇ¾î ÀÖ´ÂÁö¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù. ´Ù½Ã Çѹø °Á¶Çϴµ¥, ÀÌ¹Ì <tt>chroot</tt>¿¡
ÀÇÇØ¼ FTP ¼¹ö°¡ /virtual/domain1.com µð·ºÅ丮·Î ¼³Á¤µÇ¾î Àֱ⠶§¹®¿¡
°æ·Î¾Õ¿¡ ¾î¶² Ãß°¡ÀûÀÎ Á¤º¸¸¦ ÁÙ ÇÊ¿ä´Â ¾ø´Ù.
<sect> °¡»óÀÇ À¥
<sect1> Virtuald¿Í ½ÇÇàÇϱâ
<sect2> ±ÇÇÏÁö ¾ÊÀ½!(Not recommended)
<p>
¾ÆÆÄÄ¡´Â ±âº»ÀûÀ¸·Î °¡»óÀÇ µµ¸ÞÀÎÀ» À§ÇÑ Áö¿øÀ» ÇØÁØ´Ù. ¾ÆÆÄÄ¡´Â ³»°¡
³»ºÎÀÇ °¡»ó µµ¸ÞÀÎ ±âÀÛÀ» »ç¿ëÇÏ´Â °ÍÀ» ±ÇÇÏ´Â À¯ÀÏÇÑ ÇÁ·Î±×·¥ÀÌ´Ù.
inetd¸¦ ÅëÇØ¼ ¾î¶² ÇÁ·Î±×·¥ÀÌ ½ÇÇàµÇ´Â °ÍÀº ¸¹Àº ´ë°¡¸¦ ÇÊ¿ä·Î Çϸç,
ÇÁ·Î±×·¥ÀÌ ½ÃÀÛÇϱâ À§Çؼ´Â Ç×»ó inetd°¡ ½ÃÀ۵Ǿî¾ß ÇÑ´Ù´Â ´ÜÁ¡ÀÌ ÀÖ´Ù.
ÀÌ·± °á°ú·Î ¹ÝÀÀ ½Ã°£ÀÌ ´À·ÁÁú °ÍÀε¥, ´Ù¸¥ ³×Æ®¿öÅ© ¼ºñ½º¿¡¼´Â ÀÌ·±
´À·ÁÁüÀÌ °ßµô¸¸ ÇÏÁö¸¸ À¥ ¼ºñ½º¿¡¼´Â ±×·¸Áö ¾ÊÀ» °ÍÀÌ´Ù. ¾ÆÆÄÄ¡´Â ¶ÇÇÑ
³Ê¹« ¸¹Àº ¿äûÀÌ µé¾î¿À´Â °æ¿ì Á¦¾î¸¦ ÇÒ ¼ö ÀÖ´Â ±â´ÉÀ» °¡Áö°í Àִµ¥,
ÀÌ ±â´ÉÀº Å©Áö ¾ÊÀº ±Ô¸ðÀÇ »çÀÌÆ®¿¡¼µµ Áß¿äÇÑ ¹®Á¦°¡ µÉ ¼ö ÀÖ´Ù.
<p>
°£´ÜÈ÷ ¸»Çϸé, ¾ÆÆÄÄ¡ ¼¹ö¸¦ virtuald¿Í ÇÔ²² »ç¿ëÇÏ¿© °¡»ó ½Ã½ºÅÛÀ» ±¸ÃàÇÏ´Â °ÍÀº
Á¤¸» ¾ÈÁÁÀº »ý°¢ÀÌ´Ù. virtuald°¡ ÁöÇâÇÏ´Â °ÍÀº Á¦°øÇϰíÀÚ ÇÏ´Â ¼ºñ½º°¡ ³»ºÎ¿¡¼
°¡»ó °ø°£¿¡ ´ëÇÑ ¸¸Á·½º·¯¿î Áö¿øÀ» ÇÏÁö ¾ÊÀ» °æ¿ì¿¡ ºÎÁ·ÇÑ ºÎºÐÀ» ä¿ì´Â ÀÏÀÌ´Ù.
virtuald°¡ ÀÌ¹Ì ¿Ïº®ÇÏ°Ô °¡»ó ½Ã½ºÅÛÀ» Áö¿øÇÏ´Â ÁÁÀº Äڵ带 ´ëüÇϱâ À§ÇÑ °ÍÀº
¾Æ´Ï´Ù.
<p>
¹°·Ð À§ÀÇ Ãæ°íµµ ²À ±×·¸°³ ÇÏ°í ¸»¸®¶ó »ý°¢ÇÏ´Â ¹«¸ðÇÑ »ç¶÷µé¿¡°Ô´Â º° È¿¿ëÀÌ
¾øÀ» °ÍÀÌÁö¸¸.
<sect2> Inetd
<p>
/etc/inetd.conf ¸¦ ÆíÁýÇ϶ó.
<verb>
vi /etc/inetd.conf # Add this line
www stream tcp nowait www /usr/local/bin/virtuald \
virtuald /virtual/conf.www httpd -f /var/www/conf/httpd.conf
</verb>
<sect2> Httpd.conf
<p>
/var/www/conf/httpd.conf¸¦ ÆíÁýÇ϶ó.
<verb>
vi /var/www/conf/httpd.conf # Or wherever you put the Apache config files
It should say:
ServerType standalone
Replace it with:
ServerType inetd
</verb>
<sect2> ¼³Á¤
<p>
±×¸®°í´Â ¾ÆÆÄÄ¡ ¼¹öÀ» ÀϹÝÀûÀ¸·Î ¼³Á¤ÇÏ´Â °úÁ¤À» ¼öÇàÇÑ´Ù.
<sect2> Httpd.init
<p>
inetd¸¦ ÅëÇØ¼ ¾ÆÆÄÄ¡°¡ ½ÇÇàµÉ ¶§¿¡´Â httpd.initÀº ÇÊ¿ä¾ø´Ù.
<sect1> Apache VirtualHost¿Í °°ÀÌ ½ÇÇàÇϱâ
<p>
¾ÆÆÄÄ¡´Â ¼¼ °³ÀÇ ¼³Á¤ ÆÄÀÏ - <tt> access.conf </tt>, <tt> httpd.conf </tt>,
<tt>srm.conf</tt>À» °¡Áø´Ù. ¾ÆÆÄÄ¡ÀÇ »õ·Î¿î ¹öÀüÀº ¼³Á¤ ÆÄÀÏÀÌ ¼¼ °³ÀÏ ÇÊ¿ä´Â ¾ø´Ù.
ÇÏÁö¸¸, ¼¼ °³ÀÇ ¼³Á¤ÆÄÀÏ·Î ³ª´©¾îÁ® ÀÖ´Â °ÍÀÌ ÈξÀ °ü¸®ÇÏ°í ¼³Á¤ÇϱⰡ ½±´Ù°í
»ý°¢µÇ±â ¶§¹®¿¡ ÀÌ ÇÏ¿ìÅõ ¹®¼¿¡¼´Â ÀÌ ½ºÅ¸ÀÏÀ» ±âÁØÀ¸·Î ¼³¸íÇϰڴÙ.
<sect2> Access.conf
<p>
ÀÌ ¼³Á¤ÆÄÀÏÀº À¥ µð·ºÅ丮 ±¸Á¶¿¡¼ Á¢±ÙÀ» ÅëÁ¦Çϴµ¥ »ç¿ëµÈ´Ù. ¿©±â °¢°¢ÀÇ µµ¸ÞÀο¡
¾î¶»°Ô ¼·Î ´Ù¸¥ ¿É¼ÇÀ» ¼³Á¤ÇÒ ¼ö ÀÖ´ÂÁö¸¦ º¸¿©ÁÖ´Â ¿¹Á¦ ¼³Á¤ÆÄÀÏÀÌ ÀÖ´Ù.
<verb>
# /var/www/conf/access.conf: Global access configuration
# Options are inherited from the parent directory
# Set the main directory with default options
<Directory />
AllowOverride None
Options Indexes
</Directory>
# Give one domain a passwd protected directory
<Directory /virtual/domain1.com/var/www/html/priv>
AuthUserFile /var/www/passwd/domain1.com-priv
AuthGroupFile /var/www/passwd/domain1.com-priv-g
AuthName PRIVSECTION
AuthType Basic
<Limit GET PUT POST>
require valid-user
</Limit>
</Directory>
# Give another domain Server Side Includes
<Directory /virtual/domain2.com/var/www/html>
Options IncludesNOEXEC
</Directory>
</verb>
<sect2> Httpd.conf
<p>
ÀÌ ¼³Á¤ÆÄÀÏÀº ¾ÆÆÄÄ¡ ¼¹öÀÇ ÁÖµÈ ¿É¼ÇÀ» °ü¸®ÇÑ´Ù. ¿©±â °¢°¢ÀÇ µµ¸ÞÀο¡
´ëÇØ¼ ¼·Î ´Ù¸¥ ¿É¼ÇÀ» ¼³Á¤ÇÏ´Â °Í¿¡ ´ëÇÑ ¿¹Á¦ ÆÄÀÏÀÌ ÀÖ´Ù.
<verb>
# /var/www/conf/httpd.conf: Main server configuration file
# Begin: main conf section
# Needed since not using inetd
ServerType standalone
# Port to run on
Port 80
# Log clients with names vs IP addresses
HostnameLookups on
# User to run server as
User www
Group www
# Where server config, error and log files are
ServerRoot /var/www
# Process Id of server in this file
PidFile /var/run/httpd.pid
# Internal server process info
ScoreBoardFile /var/www/logs/apache_status
# Timeout and KeepAlive options
Timeout 400
KeepAlive 5
KeepAliveTimeout 15
# Number of servers to run
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 30
# End: main conf section
# Begin: virtual host section
# Tell server to accept requests for ip:port
# I have one for each IP needed so you can explicitly ignore certain domains
Listen 10.10.10.129:80
Listen 10.10.10.130:80
# VirtualHost directive allows you to specify another virtual
# domain on your server. Most Apache options can be specified
# within this section.
<VirtualHost www.domain1.com>
# Mail to this address on errors
ServerAdmin webmaster@domain1.com
# Where documents are kept in the virtual domain
DocumentRoot /virtual/domain1.com/var/www/html
# Name of the server
ServerName www.domain1.com
# Log files Relative to ServerRoot option
ErrorLog logs/domain1.com-error_log
TransferLog logs/domain1.com-access_log
RefererLog logs/domain1.com-referer_log
AgentLog logs/domain1.com-agent_log
# Use CGI scripts in this domain
ScriptAlias /cgi-bin/ /var/www/cgi-bin/domain1.com/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
</VirtualHost>
<VirtualHost www.domain2.com>
# Mail to this address on errors
ServerAdmin webmaster@domain2.com
# Where documents are kept in the virtual domain
DocumentRoot /virtual/domain2.com/var/www/html
# Name of the server
ServerName www.domain2.com
# Log files Relative to ServerRoot option
ErrorLog logs/domain2.com-error_log
TransferLog logs/domain2.com-access_log
RefererLog logs/domain2.com-referer_log
AgentLog logs/domain2.com-agent_log
# No CGI's for this host
</VirtualHost>
# End: virtual host section
</verb>
<sect2> Srm.conf
<p>
ÀÌ ¼³Á¤ÆÄÀÏÀº ¾î¶² ¿äû¿¡ ´ëÇØ ¼ºñ½º¸¦ Á¦°øÇÒ °ÍÀÎÁö¿Í ±× Çü½ÄÀÌ
¾î¶»°Ô µÉ °ÍÀÎÁö¿¡ ´ëÇÑ °ÍÀ» Á¶ÀýÇÑ´Ù. °¡»ó µµ¸ÞÀο¡ ´ëÇØ¼
À̰ÍÀ» ¹Ù²Ü ÇÊ¿ä´Â ¾ø´Ù. ¾ÆÆÄÄ¡¿¡¼ ±âº»ÀûÀ¸·Î Á¦°øÇÏ´Â ¿¹Á¦
ÆÄÀÏ Çü½Ä ±×´ë·Î °¡»ó ½Ã½ºÅÛ¿¡ Àû¿ëÇØµµ ÀÛµ¿ÇÒ °ÍÀÌ´Ù.
<sect2> Httpd.init
<p>
httpd.init ÆÄÀÏ¿¡ ´ëÇØ¼ Ưº°È÷ ÇØÁÙ °ÍÀº ¾ø´Ù. ¾ÆÆÄÄ¡ÀÇ Ç¥ÁØÀûÀÎ
¼³Á¤À» ÀÌ¿ëÇ϶ó.
<sect1> ÆÄÀÏ ¼¼úÀÚ ¿À¹öÇ÷οì(File Descriptor Overflow)
<sect2> °æ°í
<p>
À̰ÍÀº ¿ÀÁ÷ µ¶¸³Àû(standalone style)ÀÎ ¾ÆÆÄÄ¡ ¼¹ö¿¡¸¸ ÇØ´çµÈ´Ù.
inetd¸¦ ÅëÇØ¼ ¼¹ö°¡ ½ÇÇàµÉ ¶§¿¡´Â ´Ù¸¥ µµ¸ÞÀΰú ¿¬°üÀÌ ¾ø±â
¶§¹®¿¡ ¸ðµç ÆÄÀÏ ¼¼úÀÚ Å×À̺íÀ» °®´Â´Ù.
<p>
¾ÆÆÄÄ¡ ¼¹ö°¡ ¿©´Â ¸ðµç ·Î±× ÆÄÀϵéÀº ÇÁ·Î¼¼½º¿¡ ´ëÇÑ ¶Ç´Ù¸¥ ÆÄÀÏ ¼¼úÀÚ
(file descriptor)°¡ µÈ´Ù. ¸®´ª½º¿¡¼´Â °¢°¢ÀÇ ÇÁ·Î¼¼½º¿¡ ´ëÇØ¼ 256°³ ±îÁö
ÆÄÀÏ ±â¼úÀÚ¸¦ °¡Áú ¼ö ÀÖ´Ù´Â Á¦¾àÀÌ ÀÖ´Ù. Áï ¿©·¯°³ÀÇ µµ¸ÞÀÎÀ» »ç¿ëÇÑ´Ù¸é
±¸¸ÕÄñ ¸¹Àº ÆÄÀÏ ±â¼úÀÚµéÀÌ ÇÊ¿äÇÏ°Ô µÈ´Ù. ¸¸¾à ÇϳªÀÇ ¾ÆÆÄÄ¡ ¼¹ö
ÇÁ·Î¼¼½º¿¡¼ ³Ê¹« ¸¹Àº µµ¸ÞÀÎÀ» ¼³Á¤ÇÏ°í »ç¿ëÇÑ´Ù¸é ÀÌ Å×À̺íÀÌ
³ÑÃij¯(overflow) ¼öµµ ÀÖ´Ù. À̰ÍÀº ƯÁ¤ÇÑ ·Î±×°¡ ÀÛµ¿ÇÏÁö ¾ÊÀ» ¼öµµ ÀÖÀ¸¸ç,
CGI°¡ ½ÇÆÐÇÒ ¼öµµ ÀÖ´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù.
<sect2> ¿©·¯°³ÀÇ ¾ÆÆÄÄ¡ ¼¹ö
<p>
¸¸¾à ÇÑ µµ¸ÞÀο¡ ´ëÇØ¼ ´Ù¼¸°³ÀÇ ÆÄÀÏ ±â¼úÀÚ¸¦ °¡Áö°í ÀÖ´Ù°í °¡Á¤Çϸé
´ç½ÅÀº ¾ÆÆÄÄ¡ ¼¹ö¿¡¼ 50°³ÀÇ µµ¸ÞÀÎÀ» ¾Æ¹« ¹®Á¦¾øÀÌ ½ÇÇà½Ãų ¼ö ÀÖ´Ù.
ÇÏÁö¸¸, ¸¸¾à ÀÌ·± »óȲ¿¡¼ ¹®Á¦°¡ ¹ß»ýÇÑ´Ù¸é /var/www1¿¡ µµ¸ÞÀÎ1-µµ¸ÞÀÎ25
ÀÇ ¾ÆÆÄÄ¡ ¼¹ö¸¦ ÇÒ´çÇϰí, /var/www2¿¡ µµ¸ÞÀÎ26-µµ¸ÞÀÎ50ÀÇ ¾ÆÆÄÄ¡ ¼¹ö¸¦
ÇÒ´çÇÏ´Â ¹æ½ÄÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù. À̰ÍÀº °¢°¢ÀÇ ¼¹ö¿¡ ´ëÇØ ÀڽŸ¸ÀÇ ¼³Á¤°ú
¿¡·¯, ·Î±× µð·ºÅ丮¸¦ °®°Ô µÈ´Ù. °¢°¢ÀÇ ¼¹ö´Â ¶ÇÇÑ ÀڽŸ¸ÀÇ Listen°ú
VirtualHost µð·ºÅ丮¸¦ °¡Áö°í ÀÖ¾î¾ß ÇÑ´Ù. httpd.init ÆÄÀÏ¿¡¼µµ
¿©·¯°³ÀÇ ¼¹ö¸¦ ¼³Á¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù´Â »ç½ÇÀ» ÀØÁö ¸»¶ó.
<sect1> ÇϳªÀÇ IP¿¡¼ ¼¹ö °øÀ¯
<sect2> IP Àý¾àÇϱâ
<p>
HTTP(HyperText Transfer Protocol) ¹öÀü 1.1¿¡´Â ¼¹öÀÇ À̸§À» Ŭ¶óÀÌ¾ðÆ®¿¡
¾Ë¸®´Â ±â´ÉÀÌ Ãß°¡µÇ¾ú´Ù. À̰ÍÀº Ŭ¶óÀÌ¾ðÆ®°¡ ¼¹ö¸¦ ãÀ» ¶§ IP ¾îµå·¹½º·Î
ºÎÅÍ Ã£À» Çʿ䰡 ¾ø´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù. µû¶ó¼ µÎ°³ÀÇ °¡»ó ¼¹ö°¡ °°Àº
IP ¾îµå·¹½º¸¦ °¡Áö°í ¼·Î ´Ù¸¥ À¥ »çÀÌÆ®·Î ²Ù¹Ð ¼ö ÀÖ´Ù. ¾ÆÆÄÄ¡ ¼³Á¤Àº
À§¿Í ¶È°°Àºµ¥, ´ÜÁö ¼·Î ´Ù¸¥ ListenÀ» Áö½ÃÇÒ Çʿ䰡 ¾ø´Ù´Â Á¡¸¸ ´Ù¸£´Ù.
(µÎ°³ÀÇ µµ¸ÞÀÎÀÌ °°Àº IP¸¦ ¾²±â ¶§¹®¿¡ Listen ¿ª½Ã °°°Ô µÈ´Ù.)
<sect2> °áÁ¡
<p>
¿ÀÁ÷ ¹®Á¦°¡ µÇ´Â Á¡Àº virtuald°¡ µµ¸ÞÀÎÀ» ±¸ºÐÇϱâ À§Çؼ IP ¾îµå·¹½º¸¦
»ç¿ëÇÑ´Ù´Â Á¡ÀÌ´Ù. Áö±Ý ÇöÀçÀÇ virtuald ÇüÅ·δ °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇÑ
½ºÇ® µð·ºÅ丮¸¦ <tt>chroot</tt>·Î ´Ù¸£°Ô ¼³Á¤ÇÒ ¼ö ¾ø´Ù. µû¶ó¼,
¸ÞÀÏÀº ÇϳªÀÇ IP¿¡ ´ëÇØ¼¸¸ ¹ÝÀÀÇÒ ¼ö Àֱ⠶§¹®¿¡ °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼
µ¶ÀÚÀûÀÎ ½ºÇ® µð·ºÅ丮¸¦ °®´Â °ÍÀº ºÒ°¡´ÉÇÏ´Ù. IP¸¦ °øÀ¯ÇÏ´Â ¸ðµç
À¥ Ŭ¶óÀÌ¾ðÆ®´Â IPÀÇ ½ºÇ® µð·ºÅ丮 ¿ª½Ã °øÀ¯ÇØ¾ß ÇÑ´Ù. ¶Ç À̰ÍÀº »ç¿ëÀÚÀ̸§À»
º¹»çÇØ¼ »ç¿ëÇÏ´Â °Í¿¡ ´ëÇÑ ¹®Á¦¸¦ ¾ð±ÞÇÏ°Ô ÇÏÁö¸¸, ÀÌÁ¤µµ´Â IP¸¦ °øÀ¯ÇÔ¿¡
ÀÖ¾î¼ ÇÊ¿äÇÑ ´ë°¡ÀÏ °ÍÀÌ´Ù.
<sect1> ´õ ¸¹Àº Á¤º¸
<p>
ÀÌ ÇÏ¿ìÅõ´Â ´ÜÁö ¾î¶»°Ô °¡»ó ½Ã½ºÅÛÀ» ¾ÆÆÄÄ¡ À¥ ¼¹ö¿¡¼ Á¦°øÇÒ ¼ö ÀÖ´ÂÁö¸¸À»
º¸¿©ÁÖ°í ÀÖ´Ù. ´ëºÎºÐÀÇ À¥ ¼¹öµéÀº ºñ½ÁÇÑ ÀÎÅÍÆäÀ̽º¸¦ °®´Â´Ù. °¡»ó À¥ È£½ºÆÃ¿¡
´ëÇØ ´õ ¸¹Àº ³»¿ëÀ» ¾Ë°í½Í´Ù¸é
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/WWW-HOWTO.html" name="WWW HOWTO">,
¸¦ Âü°íÇϰųª, ¾ÆÆÄÄ¡¿¡ ´ëÇÑ ¹®¼µé (
<htmlurl url="http://www.apache.org" name="Apache »çÀÌÆ®">¿¡¼ ±¸ÇÒ ¼ö ÀÖ´Ù)
ȤÀº <htmlurl url="http://www.apacheweek.com" name="ApacheWeek">¸¦ ã¾Æº¸¶ó.
<sect> °¡»ó ¸ÞÀÏ/POP ¼¹ö
<sect1> ¹®Á¦
<p>
°¡»ó ¸ÞÀÏÀÇ Áö¿ø¿¡ ´ëÇÑ ¿äûÀº ³¯·Î Áõ°¡Çϰí ÀÖ´Ù. ¼¾µå¸ÞÀÏÀº °¡»ó ¸ÞÀÏ
½Ã½ºÅÛÀ» Áö¿øÇÑ´Ù°í ¸»ÇÑ´Ù. ÇÏÁö¸¸ ±×°ÍÀÌ Áö¿øÇÏ´Â °ÍÀº ¿©·¯ µµ¸ÞÀο¡¼
¸ÞÀϵéÀ» °Ë»çÇÏ´Â ±â´ÉÀÌ´Ù. ±× ÈÄ ´ç½ÅÀº ƯÁ¤ ¸ÞÀÏÀ» ´Ù¸¥ °÷À¸·Î Æ÷¿öµù
ÇÒ ¼ö ÀÖ´Ù. ÇÏÁö¸¸, ·ÎÄà ¸Ó½ÅÀ¸·Î Æ÷¿öµùµÈ ¸ÞÀÏÀ̳ª bob@domain1.com°ú
bob@domain2.com¿¡ ¿Â ¸ÞÀÏÀº °°Àº ¸ÞÀÏ Æú´õ¿¡ µé¾î°¡ ÀÖ°Ô µÈ´Ù.
À̵éÀÌ ¼·Î ´Ù¸¥ ¸ÞÀÏÀÌ°í µÎ¸íÀÇ bobÀÌ ¼·Î ´Ù¸¥ »ç¶÷ÀÏ ¶§¿¡´Â ¹®Á¦°¡
µÈ´Ù.
<sect1> ÇØ°áÃ¥
<p>
´ç½ÅÀº °¢°¢ÀÇ »ç¿ëÀÚ À̸§¿¡ ¼ýÀÚ¸¦ ºÙ¿©¼, ȤÀº Á¤ÇØÁø ¹®ÀÚ¸¦ ¾Õ¿¡ ºÙ¿©¼
Áߺ¹µÇ´Â »ç¿ëÀÚ°¡ ¾Æ´ÔÀ» ±¸ºÐÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀÌ ÀÖ´Ù.(¿¹: bob1, bob2 ȤÀº
dom1bob, dom2bob) ´ç½ÅÀº ¶ÇÇÑ mailÀ̳ª pop¸¦ °íÃļ ÀÌ·± ÀüȯÀÌ º¸ÀÌÁö ¾Ê°Ô
ÀÌ·ç¾îÁú ¼ö ÀÖ°Ô ¸¸µé¼öµµ ÀÖ´Ù. ¿ÜºÎ·Î ³ª°¡´Â ¸ÞÀÏ ¿ª½Ã ÀÌ·± ½ÄÀ¸·Î °¢°¢ÀÇ
¼ºêµµ¸ÞÀο¡ ´ëÇØ¼ ±× À̸§À» »ç¿ëÇÏ°Ô ¸¸µé ¼ö ÀÖ´Ù.
<p>
³»°¡ °¡Áø ÇØ°áÃ¥Àº µÎ°¡ÁöÀÌ´Ù. Çϳª´Â sendmailÀ» ÀÌ¿ëÇÏ´Â °ÍÀ̰í, ´Ù¸¥ Çϳª´Â
QmailÀ» ÀÌ¿ëÇÏ´Â °ÍÀÌ´Ù. SendmailÀ» ÀÌ¿ëÇÑ ÇØ°áÃ¥Àº ÀÌ ±â´ÉÀ» Ãß°¡ÇÏ¿© sendmail
À» ¼³Ä¡ÇÏ´Â °ÍÀÌ´Ù. ÇÏÁö¸¸, ÀÌ ¹æ¹ýÀº ¸ðµç Á¦¾àÀÌ sendmail¿¡ ¶È°°ÀÌ Àû¿ëµÈ´Ù.
ÀÌ ¹æ¹ýÀº ¶ÇÇÑ °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼ Çϳª¾¿ÀÇ sendmailÀÌ queue mode·Î ½ÇÇàµÇ¾î¾ß
ÇÑ´Ù´Â ´ÜÁ¡À» °¡Áö°í ÀÖ´Ù. 50°³ ȤÀº ±× ÀÌ»óÀÇ senmail queue ÇÁ·Î¼¼½º´Â ¸Å½Ã°£
½Ã½ºÅÛÀ» ¹Ù»Ú°Ô ¸¸µé °ÍÀÌ´Ù.
<p>
QmailÀ» ÀÌ¿ëÇÏ´Â ÇØ°áÃ¥Àº ¿©·¯°³ÀÇ QmailÀ» ÇÊ¿ä·ÎÇÏÁöµµ ¾Ê°í, ÇϳªÀÇ queue µð·ºÅ丮
À̿ܿ¡¼µµ ½ÇÇà °¡´ÉÇÏ´Ù. ÀÌ ¹æ¹ýÀº QmailÀÌ virtuald¿Í ¸ÂÁö ¾Ê±â ¶§¹®¿¡ Ãß°¡ÀûÀÎ
ÇÁ·Î±×·¥À» ÇÊ¿ä·Î ÇÑ´Ù. ³ sendmailÀ» ÀÌ¿ëÇÑ ¹æ¹ý ¿ª½Ã ºñ½ÁÇÑ °úÁ¤À» ÇÊ¿ä·Î ÇÑ´Ù°í
¹Ï´Â´Ù. ÇÏÁö¸¸, QmailÀº ÀÌ °æ¿ì º¸´Ù ÇØ°áÃ¥À» À§ÇÑ Áغñ°¡ Àß µÇ¾îÀÖ´Â °Í °°´Ù.
<p>
³»°¡ ÇÑ ÇÁ·Î±×·¥ÀÌ ´Ù¸¥ ÇÁ·Î±×·¥º¸´Ù ³´´Ù´Â °ÍÀ» º¸ÁõÇÏ´Â °ÍÀº ¾Æ´Ï´Ù.
Sendmail ¼³Ä¡´Â º¸´Ù Á÷Á¢ÀûÀÎ ÇØ°áÃ¥ÀÌÁö¸¸, QmailÀ» ÀÌ¿ëÇÏ´Â ¹æ¹ýÀÌ ¾Æ¸¶ ´õ
°·ÂÇÑ ÇØ°áÃ¥ÀÌ µÉ ¼ö ÀÖ´Ù.
<sect1> SendmailÀ» ÀÌ¿ëÇÑ ÇØ°áÃ¥
<sect2> ¼Ò°³
<p>
°¢°¢ÀÇ °¡»ó ÆÄÀÏ ½Ã½ºÅÛÀº ÀÚ½ÅÀÇ /etc/passwd ¾È¿¡ µµ¸ÞÀÎÀ» ¼³Á¤ÇÑ´Ù.
À̰ÍÀº bob@domain1.com°ú bob@domain2.comÀÌ ¼·Î ´Ù¸¥ »ç¿ëÀÚ·Î
/etc/passwd ¾È¿¡ µî·ÏµÇ¾î ÀÖ´Ù´Â °ÍÀ» ÀǹÌÇϸç, ¸ÞÀÏ ÇÁ·Î±×·¥¿¡¼ µÎ
»ç¿ëÀÚ¸¦ ±¸ºÐÇÏ´Â µ¥¿¡´Â ¾Æ¹« ¹®Á¦°¡ ¾ø´Ù. ¶ÇÇÑ ÀڽŸ¸ÀÇ ½ºÇ® µð·ºÅ丮
¿ª½Ã °¡Áö°í ÀÖÀ¸¹Ç·Î ´Ù¸¥ °¡»ó ÆÄÀÏ ½Ã½ºÅÛ¿¡ ´ëÇØ¼ ¼·Î ´Ù¸¥ ÆÄÀϷμ
¸ÞÀÏ Æú´õ°¡ Á¸ÀçÇÏ°Ô µÈ´Ù.
<sect2> Sendmail ¼³Á¤ ÆÄÀÏ ¸¸µé±â
<p>
ÀϹÝÀûÀÎ /etc/sendmail.cf ¸¦ m4¸¦ ÅëÇØ ¸¸µç´Ù. ³»°¡ »ç¿ëÇÏ´Â °ÍÀº ´ÙÀ½°ú °°´Ù:
<verb>
divert(0)
VERSIONID(`tcpproto.mc')
OSTYPE(linux)
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
MAILER(local)
MAILER(smtp)
</verb>
<sect2> Sendmail ¼³Á¤ÆÄÀÏ ÆíÁýÇϱâ
<p>
/virtual/domain1.com/etc/sendmail.cf ¸¦ °¡»ó µµ¸ÞÀο¡ ¹ÝÀÀÇÒ ¼ö ÀÖµµ·Ï ÆíÁýÇÑ´Ù:
<verb>
vi /virtual/domain1.com/etc/sendmail.cf # Approximately Line 86
It should say:
#Dj$w.Foo.COM
Replace it with:
Djdomain1.com
</verb>
<sect2> Sendmail Áö¿ª ¹è´Þ
<p>
/virtual/domain1.com/etc/sendmail.cw¸¦ Áö¿ª È£½ºÆ®À̸§À¸·Î ÆíÁýÇÑ´Ù.
<verb>
vi /virtual/domain1.com/etc/sendmail.cw
mail.domain1.com
domain1.com
domain1
localhost
</verb>
<sect2> °¡»ó µµ¸ÞÀÎ »çÀÌÀÇ Sendmail : The Hack (PRE8.8.6)
<p>
ÇÏÁö¸¸, sendmailÀº ÀÛÀº ¼Ò½º ÄÚµå º¯È¯À» ÇÊ¿ä·Î ÇÑ´Ù. SendmailÀº /etc/sendmail.cw
¶ó´Â ÆÄÀÏÀ» °¡Áö°í Àִµ¥, ¿©±â¿¡´Â sendmailÀÌ ·ÎÄà ³»¿¡¼(¿ÜºÎÀÇ ´Ù¸¥ ¸Ó½ÅÀÌ
¾Æ´Ñ) ¹è´ÞÇÒ ¸ðµç ¸Ó½ÅµéÀÇ À̸§ÀÌ ±â·ÏµÇ¾î ÀÖ´Ù.
SendmailÀº ³»ºÎ¿¡¼ ¸Ó½ÅÀÇ ¸ðµç ÀåÄ¡µé¿¡ ´ëÇØ °Ë»çÇÏ¿© ÀÌ ¸®½ºÆ®¸¦ ·ÎÄà IP¸¦ °¡Áö°í
ÃʱâÈÇÑ´Ù. ÀÌÁ¡ ¶§¹®¿¡ ¸¸¾à °°Àº ¸Ó½Å ³»ÀÇ °¡»ó µµ¸ÞÀÎ »çÀÌ¿¡¼
¸ÞÀÏÀ» ÁÖ°í¹Þ°íÀÚ ÇÒ ¶§ ¹®Á¦°¡ µÉ ¼ö ÀÖ´Ù. SendmailÀº ´Ù¸¥ °¡»ó
µµ¸ÞÀÎÀ» ·ÎÄà ¾îµå·¹½º·Î »ý°¢ÇÏ°í ·ÎÄà Áö¿ªÀ¸·Î ¸ÞÀÏÀ» ½ºÇ®¸µÇÏ°Ô µÈ´Ù. ¿¹¸¦ µé¸é,
bob@domain1.comÀÌ fred@domain2.com¿¡°Ô ¸ÞÀÏÀ» º¸³Â´Ù°í ÇÏÀÚ. ±×·¯¸é domain1.comÀÇ
sendmailÀº domain2.comÀ» ·ÎÄ÷ΠÀνÄÇÏ°í ¸ÞÀÏÀ» domain1.com¿¡ ½ºÇ®¸µÇÒ °ÍÀÌ´Ù.
(´ç¿¬È÷ domain2.comÀ¸·Î´Â ¸ÞÀÏÀÌ °¡Áö ¾ÊÀ» °ÍÀÌ´Ù.) µû¶ó¼ ´ç½ÅÀº sendmailÀ»
º¯Çü½ÃÄÑ¾ß ÇÑ´Ù. (ÀÌ º¯ÇüÀº v8.8.5¿¡¼ Å×½ºÆ®Çغ» °á°ú ¾Æ¹« ¹®Á¦°¡ ¾ø¾ú´Ù.)
<verb>
vi v8.8.5/src/main.c # Approximately Line 494
It should say:
load_if_names();
Replace it with:
/* load_if_names(); Commented out since hurts virtual */
</verb>
¸¸¾à °¡»ó µµ¸ÞÀÎ »çÀÌ¿¡¼ ¸ÞÀÏÀ» ÁÖ°í¹ÞÀ» Çʿ䰡 ÀÖÀ» °æ¿ì¿¡¸¸ ÀÌ ¼³Á¤À»
ÀÌ¿ëÇ϶ó. (¾Æ¸¶ ´ëºÎºÐÀÇ °æ¿ì ±×·¯ÇϰÚÁö¸¸)
À̰ÍÀº ¹®Á¦Á¡À» ÇØ°áÇÒ °ÍÀÌ´Ù. ÇÏÁö¸¸, ÁÖµÈ ÀÌ´õ³Ý ÀåÄ¡ÀÎ eth0´Â ¾ø¾îÁöÁö ¾Ê´Â´Ù.
µû¶ó¼, ¸¸¾à ´ç½ÅÀÌ °¡»ó IP¿¡¼ eth0·Î ¸ÞÀÏÀ» º¸³»°Ô µÇ¸é À̰ÍÀº ·ÎÄ÷Π¹è´ÞÀÌ
µÉ °ÍÀÌ´Ù. µû¶ó¼ ³ª´Â À̰ÍÀ» ´õ¹Ì(dummy) IPÀÎ virtual1.maindomain.com(10.10.10.157)·Î
ÀÌ¿ëÇÑ´Ù. ³ Àý´ë ÀÌ È£½ºÆ®·Î ¸ÞÀÏÀ» º¸³»Áö ¾ÊÀ¸¸ç, ¹°·Ð ±× °¡»ó µµ¸ÞÀÎÀ¸·Îµµ ¸ÞÀÏÀº
°¡Áö ¾Ê´Â´Ù. ÀÌ ¹æ¹ýÀº ¶ÇÇÑ ³»°¡ ssh¸¦ »ç¿ëÇÏ´Â IP¸¦ °¡Áø ½Ã½ºÅÛÀÌ Á¤»óÀûÀÎÁö¸¦
È®ÀÎÇÏ´Â ¹æ¹ýÀ̱⵵ ÇÏ´Ù.
<sect2> °¡»ó µµ¸ÞÀÎ »çÀÌÀÇ Sendmail : SendmailÀÇ »õ·Î¿î ±â´É (POST8.8.6)
<p>
Sendmail V8.8.6ºÎÅÍ´Â Ãß°¡ÀûÀÎ ³×Æ®¿öÅ© ÀÎÅÍÆäÀ̽ºÀÇ ºñ»ç¿ë žÀç(disable loading)¿¡
´ëÇÑ »õ·Î¿î ¿É¼ÇÀÌ »ý°å´Ù. µû¶ó¼ Äڵ带 ¹Ù²Ü ÇÊ¿ä´Â ¾ø°Ô µÇ¾ú´Âµ¥, À̰ÍÀ»
<tt>DontProbeInterfaces</tt>¶ó ÇÑ´Ù.
<p>
/virtual/domain1.com/etc/sendmail.cf¸¦ ÆíÁýÇ϶ó.
<verb>
vi /virtual/domain1.com/etc/sendmail.cf # Add the line
O DontProbeInterfaces=True
</verb>
<sect2> Sendmail.init
<p>
SendmailÀº µ¶¸³ÀûÀ¸·Î ½ÇÇàÀÌ ºÒ°¡´ÉÇϰí Ç×»ó inetd¸¦ ÅëÇØ¼ ½ÇÇàµÇ°Ô µÈ´Ù.
ÀÌ ¹æ¹ýÀº ºñÈ¿À²ÀûÀÌ°í ½ÃÀÛÇÏ´Â µ¥ ½Ã°£ÀÌ °É¸®°ÚÁö¸¸, ¸¸¾à ´ç½ÅÀÌ ¿î¿µÇÏ´Â
»çÀÌÆ®°¡ ÀÌ·± Á¡ÀÌ ¹®Á¦°¡ µÉ Á¤µµ·Î ³×Æ®¿öÅ©°¡ ºó¹øÇÏ´Ù¸é ÇϳªÀÇ ½Ã½ºÅÛ¿¡¼
°¡»óÀÇ ¿©·¯ µµ¸ÞÀÎÀ» °°ÀÌ »ç¿ëÇÏ´Â °ÍÀº ÁÁÀº ¹æ¹ýÀÌ ¾Æ´Ï´Ù. <tt> -bd </tt>
Ç÷¢(flag)°ú °°ÀÌ »ç¿ëÇÏÁö ¾Êµµ·Ï ÁÖÀÇÇ϶ó. ¶ÇÇÑ °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼
<tt> sendmail -q </tt>À» ½ÇÇàÇÏ¿© ¹è´ÞµÇÁö ¾ÊÀº ¸ÞÀϵ鿡 ´ëÇÑ Å¥ ÀÛ¾÷À»
°¡´ÉÇÏ°Ô ÇÏ´Â °Íµµ ÀØÁö ¸»¶ó. »õ·Î¿î sendmail.init ÆÄÀÏÀº ´ÙÀ½°ú °°´Ù:
<verb>
#!/bin/sh
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting sendmail: "
daemon sendmail -q1h
echo
echo -n "Starting virtual sendmail: "
for i in /virtual/*
do
if [ ! -d "$i" ]
then
continue
fi
if [ "$i" = "/virtual/lost+found" ]
then
continue
fi
chroot $i sendmail -q1h
echo -n "."
done
echo " done"
touch /var/lock/subsys/sendmail
;;
stop)
echo -n "Stopping sendmail: "
killproc sendmail
echo
rm -f /var/lock/subsys/sendmail
;;
*)
echo "Usage: sendmail {start|stop}"
exit 1
esac
exit 0
</verb>
<sect2> Inetd ¼³Á¤
<p>
Pop´Â ´Ù¸¥ ¿µÇâ¾øÀÌ Á¤»óÀûÀ¸·Î ¼³Ä¡µÉ °ÍÀÌ´Ù. ´ÜÁö inetdÀÇ ¿£Æ®¸®¿¡¼
ÀÌ Ç×À» °¡»óÀÇ Æ÷Æ®¿Í ÇÔ²² °í·ÁÇÒ Çʿ䰡 ÀÖ´Ù. inetd.conf ¿£Æ®¸®¿¡¼
sendmail°ú pop¿¡ ´ëÇÑ °ÍÀº ´ÙÀ½°ú °°´Ù:
<verb>
pop-3 stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.pop in.qpop -s
smtp stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.mail sendmail -bs
</verb>
<sect1> QmailÀ» ÀÌ¿ëÇÑ ¹æ¹ý
<sect2> ¼Ò°³
<p>
ÀÌ ¹æ¹ýÀº qmail-localÀÇ ¹è´Þ ½Ã½ºÅÛÀ» Â÷¿ëÇϱ⠶§¹®¿¡, °¡»óÀÇ È¨ µð·ºÅ丮 ¾ÈÀÇ
.qmail ÆÄÀÏÀº ÀÛµ¿ÇÏÁö ¾Ê°Ô µÈ´Ù. ÇÏÁö¸¸, °¢°¢ÀÇ µµ¸ÞÀÎÀº µµ¸ÞÀÎ ÀüüÀÇ ¾Ù¸®¾î½Ì
(aliasing)À» ÅëÁ¦ÇÏ´Â µµ¸ÞÀÎ ÁÖÀÎ »ç¿ëÀÚ(domain master user)¸¦ °®´Â´Ù. µÎ °³ÀÇ
¿ÜºÎ ÇÁ·Î±×·¥µéÀÌ µµ¸ÞÀÎ ÁÖÀÎÀÇ .qmail-default ÆÄÀÏÀ» »ç¿ëÇÒ ¼ö ÀÖ°Ô ÇØÁÙ °ÍÀÌ´Ù.
°¢°¢ÀÇ µµ¸ÞÀο¡ ¸ÞÀÏÀÌ ¹è´ÞµÇ±â À§Çؼ´Â ÀÌµé µÎ ÇÁ·Î±×·¥À» ÅëÇØ¾ß ÇÒ °ÍÀÌ´Ù.
<p>
µÎ °³ÀÇ ÇÁ·Î±×·¥ÀÌ ÇÊ¿äÇѵ¥, ±× °¡¿îµ¥ Çϳª´Â setuid root »óÅ·Π½ÇÇàµÈ´Ù.
ÀÌ ÀÛÀº ÇÁ·Î±×·¥Àº ÀÏ´Ü ÇÁ·Î¼¼½ºÀÇ ¼ÒÀ¯±ÇÀ» root°¡ ¾Æ´Ñ »ç¿ëÀÚ·Î ¹Ù²Ù°í,
´Ù½Ã µÎ¹øÂ° ÇÁ·Î±×·¥À» ½ÇÇà½ÃŲ´Ù. °¡±î¿î º¸¾È °ü·Ã »çÀÌÆ®¿¡¼ ¿Ö ÀÌ·± ¹æ½ÄÀÌ
ÇÊ¿äÇÑÁö¸¦ Âü°íÇÒ ¼ö ÀÖÀ» °ÍÀÌ´Ù.
<p>
ÀÌ ¹æ¹ýÀº virtuald¸¦ »ç¿ëÇÒ Çʿ伺ÀÌ º°·Î ¾ø´Ù. QmailÀº ¸Å¿ì À¯µ¿ÀûÀÎ ÇÁ·Î±×·¥À̶ó
ÀϹÝÀûÀÎ virtuald ¼³Á¤À» ÇÊ¿ä·ÎÇÏÁö ¾Ê´Â´Ù. QmailÀº ¸ÞÀÏÀÇ ¹è´ÞÀ» À§ÇØ
ÇÁ·Î±×·¥µéÀÇ ¿¬°áÀ» ÀÌ¿ëÇϵµ·Ï ¼³°èµÇ¾ú´Ù. ÀÌ µðÀÚÀÎÀº °¡»ó ¼ºñ½º ºÎºÐÀ»
Qmail ¹è´Þ ÇÁ·Î¼¼½º Áß°£¿¡ ½±°Ô »ðÀÔÇÒ ¼ö ÀÖ°Ô ÇÑ´Ù.
<p>
´ç½ÅÀÌ QmailÀ» »ç¿ëÇÑ´Ù¸é ¸ÞÀÎ ¼¹öÀÇ µµ¸ÞÀο¡¼ ¹«Á¦ÇÑÀÇ µµ¸ÞÀÎ À̸§À» ¸¸µé¾î
³¾ ¼ö ÀÖ´Ù. À̰ÍÀº °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ ºÐ¸®µÈ QmailÀ» °®´Â °ÍÀÌ ¾Æ´Ï±â ¶§¹®¿¡
°¡´ÉÇÏ´Ù. ¸ÞÀÏ Å¬¶óÀÌ¾ðÆ® ÇÁ·Î±×·¥(À¯µµ¶ó³ª elm, mutt µî)¿¡¼ ´ç½ÅÀÌ ÀÓÀÇ·Î
¸¸µé¾î³½ µµ¸ÞÀÎ À̸§À» ÀνÄÇÏ´Â °ÍÀ» È®ÀÎÇØ º¸¶ó.
<sect2> °¡»ó µµ¸ÞÀÎ ¼³Á¤
<p>
QmailÀº ´ç½ÅÀÌ Á¦°øÇÏ´Â °¢°¢ÀÇ °¡»ó µµ¸ÞÀÎÀ» ¹Þ¾ÆµéÀÏ ¼ö ÀÖµµ·Ï ¼³Á¤µÇ¾î¾ß
ÇÑ´Ù. ¾Æ·¡ÀÇ ¸í·É¾îµéÀ» ¼öÇàÇ϶ó.
<verb>
echo "domain1.com:domain1" >> /var/qmail/control/virtualdomains
</verb>
<sect2> µµ¸ÞÀÎÀÇ ÁÖÀÎ(Domain Master User) ¼³Á¤
<p>
¸ÞÀÎ /etc/passwd ÆÄÀÏ¿¡ domain1ÀÇ »ç¿ëÀÚµéÀ» Ãß°¡ÇÑ´Ù. ³ª´Â /bin/false ¼ÐÀ»
¸¸µé¾î µµ¸ÞÀÎ ÁÖÀÎ(the domain master)ÀÌ ·Î±×ÀÎÇÏÁö ¸øÇÏ°Ô ¸¸µé¾ú´Ù. µµ¸ÞÀÎ
ÁÖÀÎÀº domain1ÀÇ .qmail ÆÄÀϵéÀ» Ãß°¡ÇÒ ¼ö ÀÖ°í, µµ¸ÞÀÎÀÇ ¸ðµç ¸ÞÀϵéÀº ÀÌ
°èÁ¤À» ÅëÇÏ¿© ¹ß¼ÛµÈ´Ù. »ç¿ëÀÚ À̸§Àº ¿©´ü ÀÚ¸®±îÁö °¡´ÉÇϸç
µµ¸ÞÀÎ À̸§Àº ´õ ±æ¾îÁö ¼ö ÀÖ´Ù´Â °ÍÀ» ÁÖÀÇÇϱ⠹ٶõ´Ù. ³ª¸ÓÁö ¹®ÀÚµéÀº
¹«½ÃµÈ´Ù. À̰ÍÀº domain12¶ó´Â »ç¿ëÀÚ¿Í domain123À̶ó´Â »ç¿ëÀÚ°¡ °°Àº
»ç¿ëÀÚ·Î ÀνĵDZ⠶§¹®¿¡ QmailÀÌ È¥µ¿ÇÒ ¼ö ÀÖ´Ù´Â °ÍÀ» ÀǹÌÇÑ´Ù. µû¶ó¼
µµ¸ÞÀÎ ÁÖÀÎ À̸§ °áÁ¤¿¡ ÁÖÀǸ¦ ±â¿ïÀ̱⠹ٶõ´Ù.
<p>
´ÙÀ½°ú °°Àº ÀýÂ÷¸¦ ÅëÇÏ¿© µµ¸ÞÀÎ ÁÖÀÎÀÇ .qmail ÆÄÀÏÀ» ¸¸µéÀÚ. ´Ù¸¥ ½Ã½ºÅÛ ¾Ù¸®¾î½º -
¿¹¸¦ µé¸é À¥¸¶½ºÅͳª È£½ºÆ®¸¶½ºÅÍ- °¡ ÀÌ ÁöÁ¡¿¡ Ãß°¡µÈ´Ù.
<verb>
echo "user@domain1.com" > /home/d/domain1/.qmail-mailer-daemon
echo "user@domain1.com" > /home/d/domain1/.qmail-postmaster
echo "user@domain1.com" > /home/d/domain1/.qmail-root
</verb>
µµ¸ÞÀÎ ÁÖÀÎÀÇ .qmail-default ÆÄÀÏÀ» ¸¸µéÀÚ. À̰ÍÀº ¸ðµç ¸ÞÀÏÀ» °¡»óÀÇ µµ¸ÞÀÎÀ¸·Î
°É·¯ÁÖ°Ô µÉ °ÍÀÌ´Ù.
<verb>
echo "| /usr/local/bin/virtmailfilter" > /home/d/domain1/.qmail-default
</verb>
<sect2> Tcpserver
<p>
QmailÀº Maildir Çü½ÄÀ» Áö¿øÇϴ Ưº°ÇÑ popÀ» ÇÊ¿ä·Î ÇÑ´Ù. ÀÌ pop ÇÁ·Î±×·¥
¶ÇÇÑ °¡»ó ½Ã½ºÅÛ¿¡ ¸Â°Ô µÇ¾î¾ß ÇÑ´Ù. QmailÀÇ ÀúÀÚ´Â tcpserver(inetd ´ë¿ë)¸¦
Qmail°ú ÇÔ²² »ç¿ëÇÒ °ÍÀ» ±ÇÇϴµ¥, ³ªÀÇ ¿¹Á¦¿¡¼µµ inetd ´ë½Å¿¡ tcpserver¸¦
»ç¿ëÇÏ¿´´Ù.
<p>
Tcpserver´Â ¼³Á¤ ÆÄÀÏÀ» ÇÊ¿ä·Î ÇÏÁö ¾Ê´Â´Ù. ¸ðµç Á¤º¸´Â ¸í·ÉÇà¿¡¼ ÁÖ¾îÁö°Ô µÈ´Ù.
¿©±â ¸ÞÀÏ µ¥¸ó°ú popper¸¦ »ç¿ëÇϱâ À§ÇÑ tcpserver.initÀÌ ÀÖ´Ù.
<verb>
#!/bin/sh
. /etc/rc.d/init.d/functions
QMAILDUSER=`grep qmaild /etc/passwd | cut -d: -f3`
QMAILDGROUP=`grep qmaild /etc/passwd | cut -d: -f4`
# See how we were called.
case "$1" in
start)
echo -n "Starting tcpserver: "
tcpserver -u 0 -g 0 0 pop-3 /usr/local/bin/virtuald \
/virtual/conf.pop qmail-popup virt.domain1.com \
/bin/checkpassword /bin/qmail-pop3d Maildir &
echo -n "pop "
tcpserver -u $QMAILDUSER -g $QMAILDGROUP 0 smtp \
/var/qmail/bin/qmail-smtpd &
echo -n "qmail "
echo
touch /var/lock/subsys/tcpserver
;;
stop)
echo -n "Stopping tcpserver: "
killall -TERM tcpserver
echo -n "killing "
echo
rm -f /var/lock/subsys/tcpserver
;;
*)
echo "Usage: tcpserver {start|stop}"
exit 1
esac
exit 0
</verb>
<sect2> Qmail.init
<p>
´ç½ÅÀº Á¦°øµÇ´Â Ç¥ÁØ Qmail Ãʱ⠽ºÅ©¸³Æ®¸¦ ¹Ù·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù. QmailÀº
À̰ÍÀ» ¾î¶»°Ô ¼³Á¤ÇØ¾ß ÇÏ´ÂÁö¿¡ ´ëÇØ »ó´çÈ÷ ÁÁÀº ¹®¼¿Í ÇÔ²² ¹èÆ÷µÈ´Ù.
<sect2> ¼Ò½º(Source)
<p>
Qmail·Î °¡»ó ¸ÞÀÏ ¼ºñ½º¸¦ ±¸ÃàÇϱâ À§Çؼ´Â µÎ°³ÀÇ ¼·Î ´Ù¸¥ ÇÁ·Î±×·¥ÀÌ ÇÊ¿äÇÏ´Ù.
Çϳª´Â virtmailfilterÀ̰í, ´Ù¸¥ Çϳª´Â virtmaildeliveryÀÌ´Ù. ¿©±â virtmailfilter¿¡
´ëÇÑ C ¼Ò½º Äڵ尡 ÀÖ´Ù. ÀÌ ÇÁ·Î±×·¥Àº /usr/local/bin¿¡ 4750ÀÇ ¼ÒÀ¯±ÇÀ» °¡Áö°í,
root ¼ÒÀ¯, nofiles ±×·ìÀ¸·Î ¼³Ä¡µÇ¾î¾ß ÇÑ´Ù.
<verb>
#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <pwd.h>
#define VIRTPRE "/virtual"
#define VIRTPWFILE "etc/passwd"
#define VIRTDELIVERY "/usr/local/bin/virtmaildelivery"
#define VIRTDELIVERY0 "virtmaildelivery"
#define PERM 100
#define TEMP 111
#define BUFSIZE 8192
int main(int argc,char **argv)
{
char *username,*usernameptr,*domain,*domainptr,*homedir;
char virtpath[BUFSIZE];
struct passwd *p;
FILE *fppw;
int status;
gid_t gid;
pid_t pid;
if (!(username=getenv("EXT")))
{
fprintf(stdout,"environment variable EXT not set\n");
exit(TEMP);
}
for(usernameptr=username;*usernameptr;usernameptr++)
{
*usernameptr=tolower(*usernameptr);
}
if (!(domain=getenv("HOST")))
{
fprintf(stdout,"environment variable HOST not set\n");
exit(TEMP);
}
for(domainptr=domain;*domainptr;domainptr++)
{
if (*domainptr=='.' && *(domainptr+1)=='.')
{
fprintf(stdout,"environment variable HOST has ..\n");
exit(TEMP);
}
if (*domainptr=='/')
{
fprintf(stdout,"environment variable HOST has /\n");
exit(TEMP);
}
*domainptr=tolower(*domainptr);
}
for(domainptr=domain;;)
{
snprintf(virtpath,BUFSIZE,"%s/%s",VIRTPRE,domainptr);
if (chdir(virtpath)>=0)
break;
if (!(domainptr=strchr(domainptr,'.')))
{
fprintf(stdout,"domain failed: %s\n",domain);
exit(TEMP);
}
domainptr++;
}
if (!(fppw=fopen(VIRTPWFILE,"r+")))
{
fprintf(stdout,"fopen failed: %s\n",VIRTPWFILE);
exit(TEMP);
}
while((p=fgetpwent(fppw))!=NULL)
{
if (!strcmp(p->pw_name,username))
break;
}
if (!p)
{
fprintf(stdout,"user %s: not exist\n",username);
exit(PERM);
}
if (fclose(fppw)==EOF)
{
fprintf(stdout,"fclose failed\n");
exit(TEMP);
}
gid=p->pw_gid;
homedir=p->pw_dir;
if (setgid(gid)<0 || setuid(p->pw_uid)<0)
{
fprintf(stdout,"setuid/setgid failed\n");
exit(TEMP);
}
switch(pid=fork())
{
case -1:
fprintf(stdout,"fork failed\n");
exit(TEMP);
case 0:
if (execl(VIRTDELIVERY,VIRTDELIVERY0,username,homedir,NULL)<0)
{
fprintf(stdout,"execl failed\n");
exit(TEMP);
}
default:
if (wait(&status)<0)
{
fprintf(stdout,"wait failed\n");
exit(TEMP);
}
if (!WIFEXITED(status))
{
fprintf(stdout,"child did not exit normally\n");
exit(TEMP);
}
break;
}
exit(WEXITSTATUS(status));
}
</verb>
<sect2> ¼Ò½º(Source)
<p>
¿©±â¿¡´Â virtmaildelivery¿¡ ´ëÇÑ C ¼Ò½º Äڵ尡 ÀÖ´Ù. À̰ÍÀº /usr/local/bin¿¡
0755ÀÇ ¼ÒÀ¯±ÇÀ¸·Î, ¼ÒÀ¯ÀÚ¿Í ±×·ì ¸ðµÎ root·Î ¼³Ä¡µÇ¾î¾ß ÇÑ´Ù.
<verb>
#include <sys/stat.h>
#include <sys/file.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <time.h>
#define TEMP 111
#define BUFSIZE 8192
#define ATTEMPTS 10
int main(int argc,char **argv)
{
char *user,*homedir,*dtline,*rpline,buffer[BUFSIZE],*p,mail[BUFSIZE];
char maildir[BUFSIZE],newmaildir[BUFSIZE],host[BUFSIZE];
int fd,n,nl,i,retval;
struct stat statp;
time_t thetime;
pid_t pid;
FILE *fp;
retval=0;
if (!argv[1])
{
fprintf(stdout,"invalid arguments: need username\n");
exit(TEMP);
}
user=argv[1];
if (!argv[2])
{
fprintf(stdout,"invalid arguments: need home directory\n");
exit(TEMP);
}
homedir=argv[2];
if (!(dtline=getenv("DTLINE")))
{
fprintf(stdout,"environment variable DTLINE not set\n");
exit(TEMP);
}
if (!(rpline=getenv("RPLINE")))
{
fprintf(stdout,"environment variable RPLINE not set\n");
exit(TEMP);
}
while (*homedir=='/')
homedir++;
snprintf(maildir,BUFSIZE,"%s/Maildir",homedir);
if (chdir(maildir)<0)
{
fprintf(stdout,"chdir failed: %s\n",maildir);
exit(TEMP);
}
time(&thetime);
pid=getpid();
if (gethostname(host,BUFSIZE)<0)
{
fprintf(stdout,"gethostname failed\n");
exit(TEMP);
}
for(i=0;i<ATTEMPTS;i++)
{
snprintf(mail,BUFSIZE,"tmp/%u.%d.%s",thetime,pid,host);
errno=0;
stat(mail,&statp);
if (errno==ENOENT)
break;
sleep(2);
time(&thetime);
}
if (i>=ATTEMPTS)
{
fprintf(stdout,"could not create %s\n",mail);
exit(TEMP);
}
if (!(fp=fopen(mail,"w+")))
{
fprintf(stdout,"fopen failed: %s\n",mail);
retval=TEMP; goto unlinkit;
}
fd=fileno(fp);
if (fprintf(fp,"%s",rpline)<0)
{
fprintf(stdout,"fprintf failed\n");
retval=TEMP; goto unlinkit;
}
if (fprintf(fp,"%s",dtline)<0)
{
fprintf(stdout,"fprintf failed\n");
retval=TEMP; goto unlinkit;
}
while(fgets(buffer,BUFSIZE,stdin))
{
for(p=buffer;*p=='>';p++)
;
if (!strncmp(p,"From ",5))
{
if (fputc('>',fp)<0)
{
fprintf(stdout,"fputc failed\n");
retval=TEMP; goto unlinkit;
}
}
if (fprintf(fp,"%s",buffer)<0)
{
fprintf(stdout,"fprintf failed\n");
retval=TEMP; goto unlinkit;
}
}
p=buffer+strlen(buffer);
nl=2;
if (*p=='\n')
nl=1;
for(n=0;n<nl;n++)
{
if (fputc('\n',fp)<0)
{
fprintf(stdout,"fputc failed\n");
retval=TEMP; goto unlinkit;
}
}
if (fsync(fd)<0)
{
fprintf(stdout,"fsync failed\n");
retval=TEMP; goto unlinkit;
}
if (fclose(fp)==EOF)
{
fprintf(stdout,"fclose failed\n");
retval=TEMP; goto unlinkit;
}
snprintf(newmaildir,BUFSIZE,"new/%u.%d.%s",thetime,pid,host);
if (link(mail,newmaildir)<0)
{
fprintf(stdout,"link failed: %s %s\n",mail,newmaildir);
retval=TEMP; goto unlinkit;
}
unlinkit:
if (unlink(mail)<0)
{
fprintf(stdout,"unlink failed: %s\n",mail);
retval=TEMP;
}
exit(retval);
}
</verb>
<sect1> °¨»ç (Acknowledgement)
<p>
Qmail¿¡ ÀÇÇÑ ÇØ°áÃ¥À» °¡´ÉÇÏ°Ô µµ¿òÀ» ÁØ
<htmlurl url="mailto:vince@nycrc.net" name="Vicente Gonzalez (vince@nycrc.net)">
¿¡°Ô °¨»çÇÑ´Ù. ¾Æ¸¶ Vince¿¡°Ô °¨»çÀÇ ¸ÞÀÏ Á¤µµ´Â º¸³¾ ¼ö ÀÖ°ÚÁö¸¸, Qmail¿¡ ´ëÇÑ
°ÍÀ» Æ÷ÇÔÇÏ¿© ÀÌ HOWTO¿¡ Æ÷ÇÔµÈ ³»¿ëÀÇ Áú¹®°ú ÀǰßÀº ¸ðµÎ ³ª¿¡°Ô º¸³»µµ·Ï Ç϶ó.
<sect> °¡»ó »ï¹Ù (Virtual Samba)
<sect1> ¼³Á¤
<p>
°¡»ó SAMBA´Â ¸Å¿ì ¼³Á¤Çϱ⠽±´Ù. ¾Æ·¡ÀÇ ÆÄÀϵéÀÌ ÀûÀýÇÏ°Ô ¼³Á¤À» ÇØÁÙ °ÍÀÌ´Ù.
<itemize>
<item>/virtual/domain1.com/etc/smb.conf FILE
<item>/virtual/domain1.com/var/lock/samba DIRECTORY
<item>/virtual/domain1.com/var/log DIRECTORY
<item>/usr/local/bin/virtsmbstatus SYMLINK /usr/local/bin/virtexec
</itemize>
<sect1> Inetd
<p>
/etc/inetd.conf¸¦ ÆíÁýÇÑ´Ù.
<verb>
vi /etc/inetd.conf # Add this line
netbios-ssn stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.smbd smbd
</verb>
<sect1> Smb.init
<p>
¼¹ö°¡ inetd¸¦ ÅëÇØ¼ ½ÇÇàµÇ¹Ç·Î ÀÌ smb.init ÆÄÀÏÀº ÇÊ¿äÇÏÁö ¾Ê´Ù.
<sect> ´Ù¸¥ °¡»ó ¼ºñ½º
<p>
´Ù¸¥ °¡»ó ¼ºñ½ºµµ ºñ½ÁÇÑ °úÁ¤À¸·Î Á¦°øµÉ ¼ö ÀÖ´Ù.
<itemize>
<item>virtfs¸¦ ½ÇÇà½ÃŰ°í ½ÇÇàÆÄÀϰú ¶óÀ̺귯¸®¸¦ °¡»óÀÇ ÆÄÀÏ ½Ã½ºÅÛ¿¡ ³Ö´Â´Ù.
<item>À̰ÍÀ» /etc/inetd.conf¿¡ ³Ö´Â´Ù.
<item>/virtual/conf.service ÆÄÀÏÀ» ¸¸µç´Ù.
<item>ÇÊ¿äÇÑ ´Ù¸¥ °¡»ó ½ºÅ©¸³Æ®¸¦ ¸¸µç´Ù.
</itemize>
<sect> °á·Ð
<p>
À̰ÍÀÌ ÇÊ¿äÇÑ ¸ðµç ´Ü°èÀÌ´Ù. ´Ù½ÃÇѹø ¸»Çϴµ¥, ȸ½ÅÀº
<htmlurl url="mailto:brian@nycrc.net" name="Computer Resource Center">·Î º¸³»¶ó.
¸¸¾à ´ç½ÅÀÌ Áú¹®À» °¡Áö°í Àְųª ÀÌ ¹®¼¸¦ °»½ÅÇÒ ³»¿ëÀÌ ÀÖ´Ù¸é,
³ª¿¡°Ô ±×°ÍÀ» ¾Ë·ÁÁֱ⠹ٶõ´Ù.
<p>
ÁÁÀº ¹ÝÀÀµéÀÌ ÀÌ ¹®¼¸¦ Áö¼ÓÀûÀ¸·Î ¸¸µé¾î¿Ô´Ù. ³ª¿¡°Ô Áú¹®À» º¸³½ ¸ðµç »ç¶÷µéÀÌ
ÀÌ ¹®¼ÀÇ ÇüŸ¦ ¸¸µå´Â µ¥ µµ¿òÀ» ÁÖ¾ú°í, ´Ù½Ã Çʿ伺À» ´À³¢´Â ¸¹Àº °÷ÀÇ »ç¶÷µé¿¡°Ô
µµ¿òÀ» ÁÖ°Ô ÇÑ °Í¿¡ ´ëÇØ¼ °¨»çÇÏ°Ô »ý°¢ÇÑ´Ù. Áú¹®Çϱâ Àü¿¡ FAQ¸¦ ¸ÕÀú Àо°í
ÇØ´ç Áú¹®°ú ±×¿¡ ´ëÇÑ ´äÀÌ ÀÖ´ÂÁö È®ÀÎÇØÁֱ⠹ٶõ´Ù. ´Ù½ÃÇѹø ¹®¼¿¡ °ü½ÉÀ»
°¡Á®ÁØ ¿©·¯ºÐµé¿¡°Ô °¨»çÀÇ ¶æÀ» ÀüÇÑ´Ù.
<htmlurl url="mailto:brian@nycrc.net" name="Brian">
<sect> ÀÚÁÖ Áú¹®µÇ´Â »çÇ×µé(FAQ)
<p>
<bf>Q1</bf>. sendmail.init°ú syslogd.initÀ» ¸¸µé¾ú½À´Ï´Ù. À̰͵éÀ»
/usr/local/bin¿¡ ³Ö°í ½ÇÇà½ÃŰ¸é ¿¡·¯°¡ ³³´Ï´Ù.
<p>
<bf>A1</bf>.
ÀÌ ÆÄÀϵéÀº init ½ºÅ©¸³Æ®¶ó°í ÇÑ´Ù. ÀÌ ÇÁ·Î±×·¥µéÀº ÄÄÇ»ÅͰ¡ óÀ½ ºÎÆÃµÉ ¶§ initÀ̶ó´Â
ÇÁ·Î±×·¥¿¡ ÀÇÇØ ½ÇÇàµÈ´Ù. init ÇÁ·Î±×·¥Àº /usr/local ¹ØÀÇ ¹ÙÀ̳ʸ® ÆÄÀÏÀ» ÂüÁ¶ÇÏÁö ¾Ê´Â´Ù.
½Ã½ºÅÛ¿¡¼ init ½ºÅ©¸³Æ®¸¦ »ç¿ëÇϱâ À§ÇÑ ¹æ¹ýÀº Linux System Administrators Guide³ª
Linux Getting Started Guide¸¦ Âü°íÇ϶ó.
<p>
<bf>Q2</bf>. ´ÙÀ½°ú °°Àº ³»¿ëÀ» /etc/sendmail.cf¿¡ ³Ö¾ú½À´Ï´Ù.
<verb>
divert(0)
VERSIONID(`tcpproto.mc')
OSTYPE(linux)
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
MAILER(local)
MAILER(smtp)
</verb>
Ãâ·Â °á°ú°¡ ÀÌ»óÇÏ°Ô ³ª¿À´Âµ¥ ±× ÀÌÀ¯°¡ ¹«¾ùÀԴϱî?
<p>
<bf>A2</bf>.
À̰ÍÀ» /etc/sendmail.cf¿¡ Á÷Á¢ ³ÖÀ¸¸é ¾ÈµÈ´Ù. sendmail.cf´Â sendmailÀÌ ÀÌÇØÇϱ⠽±°Ô
¾²¿©Á³±â ¶§¹®¿¡ º¸Åë »ç¶÷µéÀÌ º¸°í ÀÌÇØÇϱâ´Â ½±Áö ¾Ê´Ù. µû¶ó¼ º¸Åë m4¶ó´Â ÇÁ·Î±×·¥À̳ª
À̰ÍÀÇ ¸ÅÅ©·Î¸¦ ÀÌ¿ëÇÏ¿© sendmail.cf ÆÄÀÏÀ» ¸¸µé°Ô ÇÔÀ¸·Î½á ¼³Á¤À» º¸´Ù ½±°Ô ÇÏ´Â °ÍÀÌ
ÀϹÝÀûÀÌ´Ù. À§ÀÇ ¶óÀεéÀº sendmailÀÇ ¼³Á¤ ÆÄÀÏÀ» À§ÇÑ ¸ÅÅ©·ÎÀÌ´Ù. ¸ÅÅ©·Î¸¦ ÀÌ¿ëÇØ¼
sendmailÀ» ¼³Á¤ÇÏ´Â ¹æ¹ýÀ» ¾Ë°íÀÚ ÇÑ´Ù¸é sendmail¿¡ ´ëÇÑ ¹®¼¸¦ ÂüÁ¶Çϱ⠹ٶõ´Ù.
/etc/sendmail.cf ÆÄÀÏÀ» ¸¸µç ´ÙÀ½ virtfs ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇÏ¿©
/virtual/domain1.com/etc/sendmail.cf·Î ÆÄÀÏÀ» º¹»çÇÏ´Â °ÍÀ» ÀØÁö ¸»¶ó.
±×¸®°í´Â sendmail.cf ÆÄÀÏÀ» °¢°¢ÀÇ µµ¸ÞÀο¡ ¸Â°Ô ¼³Á¤ÇØ¾ß µÈ´Ù.
<p>
<bf>Q3</bf>.
virtuald´Â ¾îµð¼ ±¸ÇÒ¼ö ÀÖ½À´Ï±î? ±×°ÍÀÌ °ú¿¬ ¹«¾ù¿¡ ¾²´Â °ÍÀΰ¡¿ä?
¶Ç ±×°ÍÀ» ¾î¶»°Ô »ç¿ëÇÒ ¼ö ÀÖ½À´Ï±î?
<p>
<bf>A3</bf>.
Virtuald´Â °¡»ó ¼ºñ½º¸¦ Á¦°øÇϱâ À§ÇÑ ÇÁ·Î±×·¥À¸·Î ³»°¡ ¸¸µç C ÇÁ·Î±×·¥ÀÌ´Ù.
ÀÌ ÇÁ·Î±×·¥ÀÇ ¼Ò½º´Â ´ç½ÅÀÌ º¸°í ÀÖ´Â ¹Ù·Î ÀÌ HOWTO¿¡ Æ÷ÇԵǾî ÀÖ´Ù. º¸ÅëÀÇ C ÇÁ·Î±×·¥Ã³·³
À̰͵µ <tt> make virtuald</tt>ÀÇ ¹æ¹ýÀ¸·Î ÄÄÆÄÀÏÇÒ ¼ö ÀÖ´Ù. ¸¸µé¾îÁø ¹ÙÀ̳ʸ® ÆÄÀÏÀº
/usr/local/bin¿¡ ³õ´Â´Ù. ÀϹÝÀûÀÎ ³×Æ®¿öÅ© ¼¹ö ÇÁ·Î±×·¥¿¡ ´ëÇÑ Æ÷Àå(wrapper)À¸·Î virtuald¸¦
»ç¿ëÇÒ ¶§¿¡´Â /etc/inetd.conf¿¡ Ãß°¡ÇØ¾ß ÇÒ °ÍÀÌ ÀÖ´Ù.
<p>
<bf>Q4</bf>.
³» ½Ã½ºÅÛ¿¡´Â dialog°¡ ¾ø´Âµ¥¿ä?
<p>
<bf>A4</bf>.
dialog´Â ´ç½ÅÀÌ ¼Ð ½ºÅ©¸³Æ®¿¡ ´ÙÀ̾ó·Î±× ÆË¾÷ À©µµ¸¦ ³ÖÀ» ¼ö ÀÖ°Ô ÇØÁÖ´Â ÇÁ·Î±×·¥ÀÌ´Ù.
À§¿¡¼ ¼Ò°³ÇÑ ³ªÀÇ virtual ¼Ð ½ºÅ©¸³Æ® ¿¹Á¦¸¦ ½ÇÇà½Ã۱â À§Çؼ´Â ÀÌ ÇÁ·Î±×·¥ÀÌ ¹Ýµå½Ã
ÇÊ¿äÇÏ´Ù. dialog´Â
<htmlurl url="ftp://sunsite.unc.edu/pub/Linux/utils/shell/cdialog-0.9a.tar.gz" name="sunsite">.
¿¡¼ ¾òÀ» ¼ö ÀÖÀ» °ÍÀÌ´Ù. ÀÌ ÇÁ·Î±×·¥ÀÇ ÄÄÆÄÀÏÀº ¸Å¿ì ½±±â ¶§¹®¿¡ ¼³Ä¡¿¡ º° ¹®Á¦°¡ ¾øÀ» °ÍÀÌ´Ù.
<p>
<bf>Q5</bf>.
°¡»óÀÇ syslogd°¡ ÀÛµ¿ÁßÀÎÁö¸¦ ¾î¶»°Ô ¾Ë ¼ö ÀÖÁö¿ä?
<p>
<bf>A5</bf>.
virtuald°¡ ÀÛµ¿ÁßÀÏ ¶§¿¡´Â ¾Æ·¡ÀÇ ¸Þ¼¼Áö°¡ syslogd(/var/log/messages)¿¡ ³²°Ô µÈ´Ù:
<verb>
Nov 19 17:21:07 virtual virtuald[10223]: Virtuald Starting: $Revision: 1.1 $
Nov 19 17:21:07 virtual virtuald[10223]: Incoming ip: 204.249.11.136
Nov 19 17:21:07 virtual virtuald[10223]: Chroot dir: /virtual/domain1.com
</verb>
<tt> Chroot dir</tt> ¸Þ½ÃÁö´Â <tt>chroot</tt> ½Ã½ºÅÛ ÄÝÀÌ ÀÌ·çÁø ´ÙÀ½ virtuald¿¡ ÀÇÇØ
º¸³»Áö°Ô µÈ´Ù. ¸¸¾à ÀÌ ¸Þ½ÃÁö°¡ ³ªÅ¸³´Ù¸é °¡»óÀÇ syslogd´Â ½ÇÇàÁßÀ̶ó°í ÇÒ ¼ö ÀÖ´Ù.
¸¸¾à ´ç½ÅÀÌ °¡»ó ½Ã½ºÅÛÀ¸·Î ¸¸µç ¼ºñ½ºÀÇ ·Î±× ¸Þ½ÃÁö°¡ syslogd¿¡ º¸³»Áø °ÍÀ»
È®ÀÎÇÑ´Ù¸é, À̰ÍÀº ¶ÇÇÑ °¡»óÀÇ syslogd°¡ ¸Â°Ô ¼³Á¤µÈ °ÍÀÓÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
<p>
¸¸¾à ´ç½ÅÀÌ ÄÄÆÄÀÏ ½Ã°£ ¿É¼Ç VERBOSELOG¸¦ ÄѳõÁö ¾Ê¾Ò´Ù¸é virtuald´Â ÀüÇô ±â·ÏÀ»
³²±âÁö ¾ÊÀ» °ÍÀÌ´Ù. ÀÌ·± °æ¿ì °¡»óÀÇ syslogd°¡ ½ÇÇàµÇ´ÂÁö¸¦ È®ÀÎÇÒ ¼ö ÀÖ´Â
À¯ÀÏÇÑ ¹æ¹ýÀº °¡»ó ½Ã½ºÅÛÀ» ±¸¼ºÇÏ´Â µ¥¸óµéÀÌ µ¶¸³ÀûÀ¸·Î syslogd¿¡ ¹«¾ùÀΰ¡¸¦
±â·ÏÇÏ´Â °ÍÀ» Âü°íÇÏ´Â °ÍÀÌ´Ù.
<p>
<bf>Q6</bf>. °¡»óÀÇ ÆÄÀϽýºÅÛ¿¡ °ÉÃÄ ÄõŸ(quota)¸¦ ¼³Á¤ÇÏ·Á¸é ¾î¶»°Ô ÇÏÁÒ?
<p>
<bf>A6</bf>.
º¸Åë ÇÏ´Â ¹æ½ÄÀ¸·Î ÄõŸ¸¦ ¼³Á¤ÇÑ´Ù.
<htmlurl url="http://sunsite.unc.edu/LDP/HOWTO/mini/Quota.html" name="Quota mini-HOWTO">
¸¦ Âü°íÇ϶ó.
ÇÏÁö¸¸, µµ¸ÞÀÎÀÌ ´Ù¸¥ °æ¿ì¿¡µµ uid¿¡ È¥¶õÀ» Á־ ¾ÈµÈ´Ù´Â »ç½ÇÀ» ±â¾ïÇ϶ó.
¸¸¾à uid¿¡ È¥¶õÀÌ ¿Â´Ù¸é »ç¿ëÀÚµéÀÌ ÄõŸ¸¦ °øÀ¯ÇÏ°Ô µÉ °ÍÀÌ´Ù. ÄõŸ¸¦ ¼³Á¤ÇÒ uidÀÇ ¹üÀ§¸¦
ÁöÁ¤Çϰí, µµ¸ÞÀο¡ ÄõŸ¸¦ ¼³Á¤ÇÒ »ç¿ëÀÚ À̿ܿ¡´Â ±× ¹üÀ§ÀÇ uid¸¦ »ç¿ëÇÒ ¼ö ¾ø°Ô ¸¸µé¾î¶ó.
<p>
<bf>Q7</bf>. inet.conf ¿£Æ®¸®¿¡ ÀÖ´Â \ Ç¥½Ã´Â ¹«½¼ ¶æÀÌÁÒ?
<p>
<bf>A7</bf>.
´ÜÁö ¼³Á¤ ÆÄÀÏ¿¡¼ µÎ ÁÙ¿¡ °ÉÃÄ ÇÑ ³»¿ëÀ» »ç¿ëÇÒ ¶§ ÁٹٲÞÀ» Ç¥½ÃÇÏ´Â °ÍÀÌ´Ù.
³»°¡ ÀÌ Ç¥½Ã¸¦ »ç¿ëÇÑ °ÍÀº ´Ü¾î¸¦ Àû´çÇÑ À§Ä¡¿¡ ³õ¾Æ º¸±âÁÁ°Ô ÇϰíÀÚ ÇÏ´Â Àǵµ¿´´Ù.
\À» ¾ø¾Ö°í ÇϳªÀÇ ÁÙ·Î ¼³Á¤ ÆÄÀÏÀ» ¹Ù²Ù¾îµµ »ó°ü¾ø´Ù.
<p>
<bf>Q8</bf>.
passwd³ª ´Ù¸¥ login ÇÁ·Î±×·¥À» »ç¿ëÇÒ ¶§ <tt> permission denied </tt> ¸Þ½ÃÁö°¡ ³ª¿É´Ï´Ù.
FTP³ª su¸¦ »ç¿ëÇÒ ¶§¿¡´Â <tt> no modules loaded for service XXX </tt>¶ó°í ³ª¿É´Ï´Ù.
¿Ö ±×·²±î¿ä?
<p>
<bf>A8</bf>.
À̰͵éÀº PAM ¿¡·¯ ¸Þ½ÃÁöµéÀÌ´Ù. ³ª´Â ÀÌ ½ºÅ©¸³Æ®µéÀ» PAMÀÌ ³ª¿À±â ÀÌÀü¿¡ ÀÛ¼ºÇÏ¿´´Ù.
³»°¡ ÀÛ¼ºÇÑ virtfs ½ºÅ©¸³Æ®´Â /etc/pam.d, /usr/lib/cracklib_dict.*, /lib/security, ȤÀº
±×¹ÛÀÇ PAMÀÌ ¿ä±¸ÇÏ´Â ÆÄÀϵéÀ» º¹»çÇÏ´Â ºÎºÐÀ» °¡Áö°í ÀÖÁö ¾Ê´Ù. PAMÀº ÀÌµé ÆÄÀϵéÀ»
ÇÊ¿ä·Î ÇÑ´Ù. ´ç½ÅÀÌ virtfs ½ºÅ©¸³Æ®¸¦ ÆíÁýÇÏ¿© ÀÌµé ÆÄÀϵéÀ» º¹»çÇÏ°Ô ¸¸µç´Ù¸é À̵é
¹®Á¦´Â »ç¶óÁú °ÍÀÌ´Ù.
<p>
<bf>Q9</bf>.
virtuald´Â tcpdÀÇ hosts.allow¿Í hosts.deny ÆÄÀϵéÀ» »ç¿ëÇÒ ¼ö ÀÖ³ª¿ä?
<p>
<bf>A9</bf>. ¹°·Ð. ¾à°£ÀÇ ¼öÁ¤À¸·Î °¡´ÉÇÏ´Ù.
<p>
¿ì¼± ¼Ò½ºÀÇ µÎºÎºÐÀ» ¹Ù²ã¾ß ÇÑ´Ù.
<p>
arguments¸¦ È®ÀÎÇÏ´Â ºÎºÐ¿¡ ¾Æ·¡ ³»¿ëÀ» ÷°¡ÇØ¾ß ÇÑ´Ù.
<verb>
if (!argv[3])
{
syslog(LOG_ERR,"invalid arguments: no program to run");
exit(0);
}
</verb>
exec ¶óÀÎ ¿ª½Ã ´ÙÀ½°ú °°ÀÌ ¹Ù²î¾î¾ß ÇÑ´Ù.
º¯°æ Àü:
<verb>
if (execvp(argv[2],argv+2)<0)
</verb>
º¯°æ ÈÄ:
<verb>
if (execvp(argv[2],argv+3)<0)
</verb>
´ÙÀ½À¸·Î inetd.conf ¶óÀÎÀ» º¯°æÇÑ´Ù.
º¯°æ Àü:
<verb>
ftp stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.ftp wu.ftpd -l -a
</verb>
º¯°æ ÈÄ:
<verb>
ftp stream tcp nowait root /usr/local/bin/virtuald \
virtuald /virtual/conf.ftp tcpd wu.ftpd -l -a
</verb>
´ÙÀ½¿¡ /virtual/domain1.com/etc/hosts.allow ¿Í
/virtual/domain1.com/etc/hosts.deny ÆÄÀÏÀ» ¼³Á¤ÇÏ¿© ÀÌ¿ëÇÒ ¼ö ÀÖ´Ù.
<p>
<bf>Q10</bf>.
°¡»ó È£½ºÆ®¿¡¼ CGI¸¦ ½ÇÇà½Ãų ¼ö ÀÖ³ª¿ä?
<p>
<bf>A10</bf>.
¹°·Ð ½ÇÇàÀÌ °¡´ÉÇÏÁö¸¸, /cgi-bin À» ´ç½ÅÀÌ Á¢±ÙÇÒ ¼ö ÀÖ´Â <tt> chroot </tt>ÀÇ
¹Û¿¡ ¼³Á¤ÇÒ °ÍÀ» ±ÇÇÑ´Ù. ÇÑ ¿¹·Î, /var/www/cgi-bin/domain1.comÀ» »ý°¢ÇØ º¸ÀÚ.
Ŭ¶óÀÌ¾ðÆ®°¡ /cgi-bin¿¡ Á¢±ÙÇÒ ¼ö ÀÖµµ·Ï Çã¿ëÇÏ´Â °ÍÀº ´ç½ÅÀÇ ¼¹ö¿¡¼
ÇÁ·Î±×·¥À» ½ÇÇà½Ãų ¼ö ÀÖ´Â ±âȸ¸¦ ºÎ¿©ÇÏ´Â °ÍÀÌ´Ù. À̰ÍÀº º¸¾È»ó Å« ÇãÁ¡ÀÌ µÉ ¼ö
ÀÖ´Ù. ÁÖÀÇÇ϶ó! ³» °æ¿ì ¹ö±×¸¦ ÀÚ¼¼È÷ °Ë»çÇÏÁö ¾Ê´Â ½Ã½ºÅ۵鿡 ´ëÇØ¼´Â ¾Æ¿¹ cgi°¡
½ÇÇàÇÒ ¼ö ¾øµµ·Ï ¼³Á¤ÇØ ³õ¾Ò´Ù.
<p>
<bf>Q11</bf>.
³» ¼³Á¤ÆÄÀϵéÀº ÀÌ ¹®¼ÀÇ ¿¹Á¦¿Í ´Ù¸¨´Ï´Ù. ¾î¶»°Ô ÇØ¾ß ÇÏÁÒ?
<p>
<bf>A11</bf>.
¼³Á¤ ÆÄÀÏ¿¡´Â ±âº»ÀûÀ¸·Î µÎ°¡Áö ÇüŰ¡ Á¸ÀçÇÑ´Ù: ½Ã½ºÅÛV¿Í BSD°¡ ±×°ÍÀÌ´Ù. ÀÌ ¹®¼¿¡¼
Á¦°øÇÏ´Â ¿¹Á¦´Â ½Ã½ºÅÛV ÇüÅÂÀÇ ¼³Á¤ ÆÄÀÏ¿¡ ±âÃÊÇϰí ÀÖ´Ù. µÎ ½Ã½ºÅÛ ¸ðµÎ¿¡¼ °¡»ó
¼ºñ½º´Â ¼º°øÀûÀ¸·Î ÀÛµ¿ÇÑ´Ù. BSD ÇüÅÂÀÇ ¼³Á¤ ÆÄÀϵ鿡 ´ëÇÑ Á¤º¸´Â ½Ã½ºÅÛ ±¸ÀÔó¿¡
¹®ÀÇÇϰųª °¡±î¿î LDP »çÀÌÆ®¸¦ ÂüÁ¶Ç϶ó.
<p>
<bf>Q12</bf>.
´ç½Å¿¡°Ô ¸ÞÀÏÀ» º¸³Â´Âµ¥, ȸ½ÅÀÌ ¾ø°Å³ª ȸ½Å¿¡ ¾ÆÁÖ ¿À·£ ½Ã°£ÀÌ °É¸³´Ï´Ù. ¿ÖÁÒ?
<p>
<bf>A12</bf>.
¾Æ¸¶ ¸ÞÀÏÀÇ Á¦¸ñ¿¡ VIRTSERVICES HOWTO¶ó´Â Çì´õ¸¦ ³ÖÁö ¾Ê¾Æ¼ ±×·² °ÍÀÌ´Ù. ³»°¡ ³×Æ®¿öÅ©
°ü¸®ÀÚ·Î °¡»ó ¼¹öµé°ú ±× Ŭ¶óÀÌ¾ðÆ®µéÀ» °ü¸®ÇÏ´Â µ¥ ÇÊ¿äÇÑ ¸¹Àº ÀÏÀ» Çϰí ÀÖ´Ù´Â Á¡À»
Á» »ý°¢ÇØÁÖ°í, Âü¾ÆÁֱ⠹ٶõ´Ù. ÀÌ ÇÏ¿ìÅõ ¹®¼¿¡ ´ëÇÑ ¸ÞÀÏÀ» Á¤È®È÷ º¸³Â´Ù¸é
2ÀÏ¿¡¼ 3ÀÏ ¾È¿¡ Ç×»ó ´äÀåÀ» ¹ÞÀ» ¼ö ÀÖÀ» °ÍÀÌ´Ù. Á¤È®È÷ ¸ÞÀÏÀ» º¸³»Áö ¾Ê¾Ò´Ù¸é ³ªÀÇ
VIRTSERVICES ¸ÞÀϹڽº¿¡ °É·¯Á® µé¾î¿ÀÁö ¸øÇßÀ» °ÍÀ̰í, ±×·¯¸é ¸çÄ¥ ȤÀº ¸îÁÖ µ¿¾È
³»°¡ ¸ð¸¥ ä ¹æÄ¡µÇ¾î ÀÖÀ»Áöµµ ¸ð¸¥´Ù.
<p>
<bf>Q13</bf>. virtuald´Â 100M ºñÆ® ȯ°æ¿¡¼µµ ÀÛµ¿Çϳª¿ä?
<p>
<bf>A13</bf>
³×Æ®¿öÅ© Ä«µåÀÇ ¼Óµµ´Â virtuald°¡ ÀÛµ¿ÇÏ´ÂÁöÀÇ ¿©ºÎ¿Í ¾Æ¹« »ó°üÀÌ ¾ø´Ù. 10M ºñÆ® ȯ°æ¿¡¼
100M ºñÆ® ³×Æ®¿öÅ© Ä«µå¸¦ »ç¿ëÇØµµ Á¤»óÀûÀ¸·Î ÀÛµ¿ÇÑ´Ù´Â »ç½ÇÀ» È®ÀÎÇØ º¸¶ó.
<p>
<bf>Q14</bf>. sendmailÀÇ virthost Å×À̺íÀ» »ç¿ëÇÒ ¼ö ÀÖ³ª¿ä?
<p>
<bf>A14</bf>.
¾ÈµÈ´Ù. À̰ÍÀº sendmailÀÌ ¿©·¯ µµ¸ÞÀο¡ ´ëÇÑ Á¤º¸¸¦ ¹Þ±â À§ÇÑ ±â´ÉÀÌ´Ù. virtuald´Â
°¢°¢ÀÇ sendmail¿¡ ´ëÇØ¼ ºÐ¸®µÈ <tt> chroot </tt> ȯ°æÀ» Á¦°øÇÑ´Ù. virtuald¸¦
¼³Ä¡ÇÑ ÈÄ¿¡´Â sendmailÀ» °¢°¢ÀÇ µµ¸ÞÀο¡ ´ëÇØ¼ ÀϹÝÀûÀÎ ¹æ¹ýÀ¸·Î ¼³Á¤ÇÑ´Ù.
<p>
<bf>Q15</bf>.
°¡»ó telnetÀ» ¼³Ä¡ÇÒ ¼ö ÀÖ³ª¿ä? °¡»óÀÇ root °èÁ¤À» ¸¸µé¾î »ç¿ëÀÚµéÀÌ ÀڽŵéÀÇ µµ¸ÞÀÎÀ»
°ü¸®ÇÏ°Ô ¸¸µé ¼ö ÀÖ³ª¿ä?
<p>
<bf>A15</bf>.
ÀÌ Áú¹®Àº ±²ÀåÈ÷ ÀÚÁÖ ³ª¿À´Â Áú¹®À̰í, ¼ÖÁ÷È÷ ¸»Çϸé ÀÌ Áú¹®¿¡ ´ëÇØ ´äÇÏ´Â °ÍÀº
Á» ÇǰïÇÑ ÀÏÀÌ´Ù. ÀÌ ¹®¼¿¡¼ ÀÌ¹Ì ¿©·¯¹ø ¸»ÇßµíÀÌ, ±× ´äÀº inetd¸¦ ÅëÇÏ´Â ¸ðµç
¼ºñ½º´Â virtuald¸¦ ÀÌ¿ëÇÏ¿© °¡»ó ¼ºñ½º·Î ¸¸µé¼ö ÀÖÀ¸¸ç À§ÀÇ Áú¹®¿¡ ´ëÇØ
¾ÈµÉ ÀÌÀ¯´Â Çϳªµµ ¾ø´Ù´Â °ÍÀÌ´Ù. »ó½ÄÀûÀÎ °ÍÀÌ´Ù. telnet °¡»ó ¼ºñ½º¸¦ Á¦°øÇÏ¿©
¾ò´Â À̵æÀÌ ¹«¾ùÀÎÁö ¸ð¸£°ÚÁö¸¸, ÀÌ·± ¼³Á¤Àº °¡»ó ¸Ó½ÅÀÇ º¸¾È µîÀÇ ¹®Á¦¿¡ ¸¹Àº
ÅõÀÚ¸¦ ÇÊ¿ä·ÎÇÒ °ÍÀÌ´Ù. ¿©±â ÀÌ¿Í °ü·ÃµÈ ¸î°¡Áö ³»¿ëµéÀÌ ÀÖ´Ù:
<itemize>
<item>
¿ÜºÎ¿¡¼ Á¢±ÙÇÏ´Â ÅųÝÀ» Á¦¾îÇÏ¿© ¿©·¯°³ÀÇ ÇÁ·Î¼¼½º¸¦ ½ÇÇà½Ã۰í, ¿ÜºÎ·Î ³ª°¡´Â ¿¬°á¿¡
´ëÇØ ¼Ò½º IP ÁÖ¼Ò¸¦ ÃʱâÈÇϱâ À§Çؼ´Â Ä¿³ÎÀ» ÇØÅ·ÇØ¾ß¸¸ ÇÑ´Ù. ¶Ç °¡»óÀÇ È£½ºÆ®À̸§À»
»ç¿ëÇϱâ À§Çؼ´Â gethostname¿¡ ´ëÇÑ Á¶ÀÛµµ ÇÊ¿äÇÏ´Ù. ÀÌ·± ÀÛ¾÷ÀÌ ¼÷·ÃµÈ »ç¿ëÀÚ¿¡°Ô´Â
´ÜÁö Ä¿³ÎÀ» ÇØÅ·ÇÏ´Â ÀÏÀÏ »ÓÀÌÁö¸¸, Ãʺ¸Àڵ鿡°Ô´Â Àý´ëÀûÀ¸·Î ±ÇÇÏÁö ¾Ê´Â´Ù.
<item>
»ç¿ëÀÚµéÀÌ ÅÚ³ÝÀ¸·Î Á¢±ÙÇÏ´Â °ÍÀ» Çã¿ëÇÏ´Â °ÍÀº ÀÓÀÇÀÇ ÇÁ·Î±×·¥À» ´ç½ÅÀÇ
¸®´ª½º ¹Ú½º¿¡¼ ½ÇÇà½Ãų ¼ö ÀÖµµ·Ï Çã¿ëÇÏ´Â °Í°ú °°Àº °ÍÀÌ´Ù. ¾Ë·ÁÁ® ÀÖ´Â
ħÀÔ ¹æ¹ýÀ¸·Î rootÀÇ °èÁ¤ÀÌ ³ëÃâµÇ°Å³ª, ÀÌ ÀÌÀ¯·Î ½Ã½ºÅÛ¿¡ ¼Õ»óÀÌ °¡ÇØÁú ¼ö ÀÖ´Ù.
<item>
°¡»ó ½Ã½ºÅÛ¿¡ ´ëÇØ¼ root·Î telnet Á¢±ÙÀ» Çã¿ëÇÏ´Â °ÍÀº ¸Å¿ì ¾ÈÁÁÀº »ý°¢ÀÌ´Ù.
°¡»ó ½Ã½ºÅÛÀÇ rootµµ raw device ÆÄÀÏÀ» ÀÐÀ»¼ö ÀÖ°í, <tt>chroot</tt>·Î À̰ÍÀ»
ÃʱâÈÇϰųª ½Ã½ºÅÛÀ» Á¾·á½ÃŰ°í ¾î¶² ÇÁ·Î¼¼½º¸¦ Á¾·á½ÃŰ´Â ÀÏ µîÀ» ¼öÇàÇÒ ¼ö ÀÖ´Ù.
<item>
ÀÌ ÅÚ³Ý ¼ºñ½º°¡ ½ÇÇàµÇ¸é ³×Æ®¿öÅ© ¼ºñ½º°¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ±ÍÁßÇÑ CPU ½Ã°£ÀÌ
³¶ºñµÉ °ÍÀÌ´Ù.
<item>
ÅÚ³ÝÀº º¸¾È¼ºÀÌ ¶³¾îÁö´Â ³×Æ®¿öÅ© ¼ºñ½ºÀÌ´Ù. Æò¹üÇÑ ÅØ½ºÆ® ÇüÅÂÀÇ ºñ¹Ð¹øÈ£°¡
³×Æ®¿öÅ©¸¦ ÅëÇÏ¿© º¸³»Áö°Ô µÈ´Ù. ¸¸¾à ¾ÇÀÇÀÖ´Â »ç¿ëÀÚ°¡ ÀÌ ºñ¹Ð¹øÈ£¸¦ ¾Ë°Ô µÈ´Ù¸é
±× »ç¿ëÀÚ´Â À̸¦ ÀÌ¿ëÇØ ½Ã½ºÅÛÀ» °ø°ÝÇϰí, ÆÄ±«½Ãų ¼ö ÀÖ´Ù.
<item>
´ç½ÅÀÇ °¡»ó ȯ°æÀÇ µ¢Ä¡°¡ Ä¿Áú °ÍÀÌ´Ù. º¸´Ù ¸¹Àº °øÀ¯ ¶óÀ̺귯¸®µé°ú ¼³Á¤ ÆÄÀÏ,
±×¸®°í º¸´Ù ¸¹Àº ½ÇÇà ÆÄÀϵéÀ» ÇÊ¿äÇÏ°Ô µÈ´Ù. 6G Á¤µµÀÇ ÇÏµå µð½ºÅ©µµ ±Ý¼¼ °ø°£ÀÌ
ºÎÁ·ÇÏ°Ô µÉ °ÍÀÌ´Ù.
</itemize>
<p>
±âº»ÀûÀ¸·Î °¡»ó ½Ã½ºÅÛ¿¡ ´ëÇØ¼ loginÀ» Çã¿ëÇÏ´Â °ÍÀº ÁøÂ¥ ¾ÈÁÁÀº »ý°¢ÀÌ´Ù. ¸¸¾à À̰ÍÀÌ
Çã¿ëµÈ´Ù¸é, ±× ¸Ó½Å¿¡¼ È£½ºÆÃÇÏ´Â ¸ðµç »çÀÌÆ®°¡ À§Çè¿¡ ºüÁú ¼ö ÀÖ´Ù. ¸¸¾à ƯÁ¤ »çÀÌÆ®¸¦
»ç¿ëÀÚ¿¡ ÀÇÇØ °ü¸®µÉ ¼ö ÀÖµµ·Ï ¼³Á¤ÇϰíÀÚ ÇÑ´Ù¸é, ssh¸¦ ÅëÇØ ·Î±×ÀÎÇÒ ¼ö ÀÖ´Â »ç¿ëÀÚµéÀ»
Ãß°¡, »èÁ¦, º¯°æ °¡´ÉÇÏ°Ô ÇØÁÙ ¼ö ÀÖ´Â °¡»ó ÇÁ·Î¼¼½º¿¡ ´ëÇÑ ÇÁ·Î±×·¥À»(½ºÅ©¸³Æ®°¡ ¾Æ´Ñ)
ÀÛ¼ºÇÏ´Â °ÍÀÌ ÁÁÀ» °ÍÀÌ´Ù. ÀÌ ÇÁ·Î±×·¥Àº ¸Þ´º ±âµ¿ ¹æ½Ä(menu driven)ÀÌ µÇ¾î¾ß Çϸç,
ÄܼÖÀ» Çã°¡ÇÏÁö ¾Ê°í, root·Î ½ÇÇàµÇ´Â °ÍÀ» ±ÝÁö½ÃÄÑ¾ß ÇÑ´Ù. ±×·¯±â À§Çؼ´Â
ÆÄÀÏÀÇ ¼ÒÀ¯±ÇÀ» root¿¡¼ ¸î¸î ´Ù¸¥ »ç¿ëÀÚ·Î ¹Ù²Ü Çʿ䰡 ÀÖ´Ù. ÀÌ·± Á¶Ä¡´Â °¡»ó ½Ã½ºÅÛÀ»
Á¶±ÝÀÌ¶óµµ ¾ÈÀüÇÏ°Ô ¸¸µç´Ù. Àý´ë root°¡ telnetÀ̳ª ssh¸¦ ÅëÇØ Á¢¼ÓÇÏ´Â °ÍÀ» Çã¿ëÇÏÁö
¸»¶ó. ÀÌ·± Á¶Ä¡´Â Àç¾ÓÀ» ºÒ·¯¿Ã °ÍÀÌ´Ù. ¸¸¾à °¡»ó ½Ã½ºÅÛ¿¡¼ ºÒ°¡ÇÇÇÏ°Ô telnetÀ»
»ç¿ëÇÒ Çʿ䰡 ÀÖ´Ù¸é ÇÇÇØ°¡ ÃÖ¼ÒÈ µÉ ¼ö ÀÖ´Â ¸Ó½ÅÀ» ¼±ÅÃÇ϶ó. Á¤»óÀûÀÎ °ü¸®ÀÚ¶ó¸é
ÀÌ·¸°Ô±îÁö À̾߱âÇߴµ¥¿¡µµ ÅÚ³ÝÀ» Á¦°øÇÏÁö´Â ¾ÊÀ¸¸®¶ó ¹Ï°í, ´õÀÌ»ó ½Ã°£³¶ºñ´Â
ÇÏÁö ¾Ê°Ú´Ù.
<p>
<bf>Q16</bf>.
virtuald³ª Virtual-Services HOWTO¿¡ ´ëÇÑ ¸ÞÀϸµ ¸®½ºÆ®, À¥ÆäÀÌÁö, rpm, tar µîÀÇ Á¤º¸°¡
ÀÖ³ª¿ä?
<p>
<bf>A16</bf>.
ÇöÀç´Â ¾Æ¹«°Íµµ ¾ø´Ù. ÀÌ HOWTO ¹®¼°¡ ³»°¡ ÇöÀç ÇϰíÀÖ´Â °¡»ó ¼ºñ½º¿Í °ü·ÃµÈ
ÇÁ·ÎÁ§Æ®ÀÇ ÀüºÎÀÌ´Ù. ³ª ¿ª½Ã ³»°¡ ´Ù·çÁö ¸øÇÑ ºÎºÐ¿¡ ´ëÇÑ HOWTO¸¦ ã°í ÀÖ´Ù.
<p>
<bf>Q17</bf>.
ÀÏ¹Ý À¯Àú·Î virtexec¸¦ ½ÇÇàÇÏ·Á Çß´õ´Ï <tt> chroot: operation not permitted </tt>
¸Þ½ÃÁö°¡ ³ª¿É´Ï´Ù. ¿ÖÁÒ?
<p>
<bf>A17</bf>.
<tt> Chroot </tt>´Â root¿¡°Ô Á¦ÇÑµÈ ½Ã½ºÅÛ ÄÝÀÌ´Ù. ½´ÆÛ À¯Àú¸¸ÀÌ À̰ÍÀ» ½ÇÇà½Ãų ¼ö ÀÖ´Ù.
virtexec ½ºÅ©¸³Æ®´Â <tt> chroot </tt> ÇÁ·Î±×·¥À» ½ÇÇà½Ã۱⠶§¹®¿¡ ÀÌ ½ºÅ©¸³Æ®¸¦
½ÇÇà½Ã۰íÀÚ ÇÑ´Ù¸é ½´ÆÛ À¯ÀúÀÇ ¾ÆÀ̵𰡠ÇÊ¿äÇÏ´Ù.
<p>
<bf>Q18</bf>. pop°ú sendmailÀ» ¼³Á¤Çߴµ¥, popÀÌ Á¦´ë·Î ÀÛµ¿ÇÏÁö ¾Ê´Â°Í °°±º¿ä.
¾î¶»°Ô ´ëóÇÒ±î¿ä?
<p>
<bf>A18</bf>.
¸î¸î pop ÇÁ·Î±×·¥µéÀº /usr/spool/mailÀ» ¸ÞÀÏ ÆÄÀϵéÀ» ³õ±â À§ÇØ »ç¿ëÇÑ´Ù. ³»°¡ ¾Ë±â·Î´Â
qpopÀÇ °æ¿ì ÀÌ ¹®Á¦¸¦ ÇØ°áÇϱâ À§ÇØ ¼öµ¿À¸·Î ÆíÁýÀ» ÇØÁÖ¾î¾ß ÇÑ´Ù. ¼Ò½º Äڵ带 ´Ù½Ã
ÄÄÆÄÀÏÇϰųª /virtual/domain1.com/usr/spool À» /virtual/domain1.com/var/spool·Î
ÇÏµå ¸µÅ© ½ÃŰ¸é µÈ´Ù.
<p>
<bf>Q19</bf>.
³ª´Â ´ç½ÅÀÌ ¸»ÇÑ ÇÁ·Î±×·¥À» ¾²Áö ¾Ê°í, ´ë½Å XXX¶ó´Â ÇÁ·Î±×·¥À» ½è´Âµ¥,
ÀÛµ¿ÀÌ µÇÁö ¾Ê´Â±º¿ä. ¿ÖÁÒ?
<p>
<bf>A19</bf>.
³ª´Â °¡±ÞÀûÀÌ¸é ³Î¸® »ç¿ëµÇ´Â ÀϹÝÀûÀÎ ¼¹öµé¿¡ ´ëÇØ ±â¼úÇÏ·Á°í Çß´Ù. ÇÏÁö¸¸,
³ª´Â ¸ðµç »ç¶÷µéÀÌ ÀÚ½ÅÀÌ Æ¯º°È÷ ÁÁ¾ÆÇÏ´Â ¼¹ö°¡ ÀÖ´Ù´Â °Íµµ ¾Ë°í ÀÖ´Ù. ÀÌ·±
°æ¿ì °¡±ÞÀû ¸¹Àº Á¤º¸¸¦ ³ª¿¡°Ô º¸³»Áشٸé, ´ç½ÅÀÇ ¹®Á¦Á¡À» Ç®±â À§ÇÑ ½Ãµµ¸¦
ÇÒ °ÍÀ̰í, ´õºÒ¾î ÀÌ FAQ¿¡ ¹®¼È ÇÏ´Â ÀÛ¾÷À» ÇÒ °ÍÀÌ´Ù. ³ª¿¡°Ô º¸³¾ Á¤º¸ °¡¿îµ¥
°¡Àå Áß¿äÇÑ °ÍÀº ´ç½ÅÀÌ ½ÇÇà½ÃŲ ¹öÀüÀÇ ÇÁ·Î±×·¥À» ¾îµð¿¡¼ ¾ò¾ú´Â°¡ ÇÏ´Â Á¡ÀÌ´Ù.
(ftp://ftp.domain1.com/subdir/subdir/file.tgzÀÇ Çü½ÄÀ¸·Î º¸³»¶ó)
<p>
<bf>Q20</bf>.
virtexec°¡ ½ÇÇàµÉ ¶§ <tt> symlink not a virt function </tt>¶ó´Â ¸Þ½ÃÁö°¡
¹ß»ýÇÕ´Ï´Ù. ÀÌ°Ô ¾î¶² ¶æÀ̰í, ±×°ÍÀ» ¾î¶»°Ô ¼öÁ¤ÇØ¾ß Çմϱî?
<p>
<bf>A20</bf>.
virtexec´Â óÀ½ 4°³ÀÇ ¹®ÀÚ¸¦ 0¹øÂ° argument·Î ÃëÇÏ°í ³ª¸ÓÁö À̸§À» °¡»ó ȯ°æ¿¡¼
½ÇÇà½ÃŰ°Ô µÈ´Ù. ÇÑ ¿¹·Î virtpaswd´Â passwd¸¦ ½ÇÇà½ÃŲ´Ù. µû¶ó¼ ¸¸¾à óÀ½ Á¦°ÅÇÏ´Â
³× ¹®ÀÚ°¡ <tt> virt </tt>°¡ ¾Æ´Ï¶ó¸é ¿¡·¯ ¸Þ½ÃÁö¸¦ ³»º¸³»°Ô µÈ´Ù. virtexec´Â ¼Ð
½ºÅ©¸³Æ®·Î ¾²¿©Á® Àֱ⠶§¹®¿¡ ÀÌÇØÇϱ⠽¬¿ï °ÍÀÌ´Ù. bash³ª ±âŸ ¼ÐµéÀÇ
¸Þ´º¾ó ÆäÀÌÁö°¡ ¼Ð ½ºÅ©¸³Æ® ÇÁ·Î±×·¡¹Ö¿¡ ´ëÇÑ Áú¹®¿¡ ´äÀÌ µÉ ¼ö ÀÖÀ» °ÍÀÌ´Ù.
<p>
<bf>Q21</bf>.
virtuald¿Í´Â »ó°üÀÌ ¾øÁö¸¸ QmailÀ̳ª SAMBA, Apache µî¿¡ ´ëÇØ¼ Áú¹®ÀÌ ÀÖ½À´Ï´Ù.
<p>
<bf>A21</bf>.
À§¿¡¼ ¸»ÇÑ ¸ðµç ÇÁ·Î±×·¥µéÀº ÈǸ¢ÇÑ ¹®¼µéÀ» ÀÌ¹Ì °¡Áö°í ÀÖ´Ù. ¸î¸î ÇÁ·Î±×·¥ÀÇ
°æ¿ì¿¡´Â www.(ÆÐŰÁö À̸§).org ¿Í °°ÀÌ Àü¿ë À¥»çÀÌÆ®±îÁö ¸¶·ÃµÇ¾î ÀÖ´Ù. ±×·¸°Ô
°¡»ó ¼ºñ½º¿Í °ü°è¾ø´Â Áú¹®µé¿¡ ´ëÇØ¼´Â ÀÌµé »çÀÌÆ®¿¡¼ Àû´çÇÑ Áú¹®Ã³¸¦ ã±â ¹Ù¶õ´Ù.
<p>
<bf>Q22</bf>.
¸î°³ÀÇ µµ¸ÞÀÎ ¾Ù¸®¾î½º¸¦ domain1.com¿¡ °¡Áö°í Àִµ¥, ¸ÅÀÏÀÌ ÀÚ²Ù µÇµ¹¾Æ¿É´Ï´Ù.
¿Ö ±×·²±î¿ä?
<p>
<bf>A22</bf>.
Virtmaildelivery´Â Àü´ÞµÇ´Â ȯ°æ º¯¼öµé¿¡ ÀÇÇØ¼ ¸ÞÀÏÀ» º¸³¾ /virtual/domain1.com
µð·ºÅ丮¸¦ ÆÇ´ÜÇÑ´Ù. À̰ÍÀº ¸ÞÀÏÀÇ ÁÖ¼Ò¸¦ È®ÀÎÇϱâ À§ÇØ ¾î¶² DNS È®ÀÎ ÀýÂ÷µµ °®Áö ¾Ê´Â´Ù.
ÇÏÁö¸¸, ¸¸¾à ÁÖ¼Ò°¡ submail.mail.domain1.comÀÌ µÈ´Ù¸é, virtmaildelivery´Â ÁÖ¼Ò¿¡ ´ëÇØ¼
È®ÀÎÀ» Çϰí, Â÷·Ê´ë·Î mail.domain1.com, domain1.com, comÀ» È®ÀÎÇÏ¸é¼ ÁÖ¼Ò¸¦ °Ë»öÇϰÔ
µÈ´Ù. ÀÌ·± ¹æ¹ýÀ¸·Î´Â Á¤ÇØÁø ¾Ù¸®¾î½ÌÀÇ ÁÖ¼Ò¸¦ Á¤È®ÇÏ°Ô ¾Ë¾Æ³¾ ¼ö ¾ø´Ù.
<p>
ÇÏÁö¸¸, ¸¸¾à ¼ºêµµ¸ÞÀÎÀÇ ÇüŰ¡ ¾Æ´Ñ µµ¸ÞÀÎ ¾Ù¸®¾î½º¸¦ °¡Áö°í ÀÖ´Ù¸é, ´ÙÀ½°ú °°Àº
½Éº¼¸¯ ¸µÅ©¸¦ ÅëÇØ ±¸ÇöÀÌ °¡´ÉÇÏ´Ù:
<verb>
cd /virtual
ln -s domain1.com domain1alias.com
</verb>
virtmaildelivery´Â µÎ µð·ºÅ丮¸¦ ¸ðµÎ Á¸ÀçÇÏ´Â µð·ºÅ丮·Î ÀνÄÇÒ °ÍÀ̰í
(ÇÑÂÊÀº ½Éº¼¸¯ ¸µÅ©ÀÓ¿¡µµ ºÒ±¸Çϰí), ¸ÞÀÏÀº user@domain1.com°ú user@domainalias.com
¸ðµÎ¿¡°Ô º¸³»Áú ¼ö ÀÖ°Ô µÈ´Ù. virtexec´Â µÎ µµ¸ÞÀÎ ¸ðµÎ¸¦ ´ÙÀ̾ó·Î±× ¹Ú½º¿¡ Ç¥½ÃÇÑ´Ù´Â
Á¡À» ÁÖÀÇÇ϶ó. µÎ ÆÄÀÏ ½Ã½ºÅÛÀÌ °°Àº °ÍÀ̱ä ÇÏÁö¸¸, ´ç½ÅÀº µÎ µµ¸ÞÀÎ °¡¿îµ¥ Çϳª¸¦
¼±ÅÃÇÒ ¼ö ÀÖ´Ù.
<!-- Ending -->
</article>
|
It's later than you think. |











