´ÙÀ½ ÀÌÀü Â÷·Ê

10. ³×Æ®¿÷ µ¥¸óÀÇ ¼³Ä¡

10.1 SMTP ¼³Á¤Çϱâ

group°ú userÀÇ »ý¼º

¾Æ·¡¸¦ ½ÇÇàÇÏ¿© SendmailÀÌ ÇÊ¿ä·Î ÇÏ´Â groupµéÀ» ¸¸µç´Ù:

groupadd -g 1 bin
groupadd -g 2 kmem
groupadd -g 3 mail
useradd -u 1 -g bin -d /bin -s /bin/sh bin
 

µð·ºÅ丮 »ý¼º

SendmailÀº ¹ÛÀ¸·Î ³ª°¡´Â ¸ÞÀÏÀ» /var/spool/mqueue µð·ºÅ丮¿¡ ³Ö¾îµÐ´Ù. µé¾î¿À´Â ¸ÞÀÏÀº Sendmail¿¡ ÀÇÇØ Procmail·Î µ¹·ÁÁö¹Ç·Î ¿ì¸®´Â /var/mail À̶ó´Â µð·ºÅ丮µµ ÇÊ¿äÇÏ´Ù. ÀÌ µð·ºÅ丮µéÀ» »ý¼ºÇÏ°í ¾Ë¸ÂÀº ±ÇÇÑÀ» ¼³Á¤ÇÑ´Ù:

mkdir /var/spool
mkdir /var/mail
cd /var/spool; ln -s ../mail mail
chmod 700 /var/spool/mqueue
chmod 775 /var/mail
chgrp mail /var/mail
chmod 1777 /tmp
 

SendmailÀÇ ¼³Ä¡

cd src
./Build; ./Build install
 

SendmailÀÇ ¼³Á¤

SendmailÀ» ¼³Á¤ÇÏ´Â °ÍÀº ¾ÕÀÇ °Íµéó·³ ½±Áö´Â ¾Ê´Ù. SendmailÀ» ¼³Á¤ÇÏ´Â µ¿¾È ¿©·¯ºÐÀÌ °í·ÁÇØ¾ß ÇÒ »çÇ×ÀÌ ¸¹À¸¸ç ³»°¡ ±× ¸ðµç °ÍÀ» ¼³¸íÇÒ ¼ö´Â ¾ø´Ù. ÀÌ°ÍÀÌ ¿ì¸®°¡ Áö±ÝÀº ±âº»ÀûÀÌ°í Ç¥ÁØÀûÀÎ ¼³Á¤À» ÇÏ´Â ÀÌÀ¯ÀÌ´Ù. SendmailÀ» ¿©·¯ºÐÀÇ ±âÈ£¿¡ ¸Âµµ·Ï °íÄ¡°í ½Í´Ù¸é ÇÒ ¼ö ÀÖÁö¸¸ ÀÌ ¹®¼­´Â ±× ÀÛ¾÷¿¡ ÀûÇÕÇÏÁö´Â ¾Ê´Ù. ¿©·¯ºÐÀÌ Æ¯Á¤ÇÑ ±â´ÉÀ» »ç¿ëÇÏ·Á ÇÑ´Ù¸é ÀÌ¹Ì Á¸ÀçÇÏ´Â /etc/sendmail.cf (ȤÀº /etc/mail/sendmail.cf) ÆÄÀÏÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù.

OSTYPE(LFS)
FEATURE(nouucp)
define(`LOCAL_MAILER_PATH', /usr/bin/procmail)
MAILER(local)
MAILER(smtp)
 

ProcmailÀÇ ¼³Ä¡

make; make install; make install-suid
 

/etc/init.d/sendmail ºÎÆ®½ºÅ©¸³Æ®ÀÇ ÀÛ¼º

#!/bin/sh
# Begin /etc/init.d/sendmail
 
check_status()
{
  if [ $? = 0 ]
  then
    echo "OK"
  else
    echo "FAILED"
  fi
}
 
case "$1" in
  start)
    echo -n "Starting Sendmail..."
    start-stop-daemon -S -q -o -x /usr/sbin/sendmail -- -bd
    check_status
    ;;
 
  stop)
    echo -n "Stopping Sendmail..."
    start-stop-daemon -K -q -o -p /var/run/sendmail.pid
    check_status
    ;;
 
  reload)
    echo -n "Reloading Sendmail configuration file..."
    start-stop-daemon -K -q -s 1 -p /var/run/sendmail.pid
    check_status
    ;;
 
  restart)
    echo -n "Stopping Sendmail..."
    start-stop-daemon -K -q -o -p /var/run/sendmail.pid
    check_status
 
    sleep 1
 
    echo -n "Starting Sendmail..."
    start-stop-daemon -S -q -o -x /usr/sbin/sendmail -- -bd
    check_status
    ;;
 
  *)
    echo "Usage: $0 {start|stop|reload|restart}"
    exit 1
    ;;
 
esac
 
# End /etc/init.d/sendmail
 

±ÇÇÑ°ú ½Éº¼¸¯ ¸µÅ©µéÀ» ¼³Á¤ÇÑ´Ù.

cd /etc/init.d/rc2.d; ln -s ../init.d/sendmail S20sendmail
cd ../rc0.d; ln -s ../init.d/sendmail K20sendmail
cd ../rc6.d; ln -s ../init.d/sendmail K20sendmail
 

10.2 FTPÀÇ ¼³Á¤

user¿Í groupÀÇ »ý¼º

groupadd -g 65534 nogroup
groupadd -g 4 ftp
 

useradd -u 65534 -g nogroup -d /home nobody
useradd -u 4 -g ftp -s /bin/sh -m ftp
 

ProftpdÀÇ ¼³Ä¡

./configure
make; make install
 

/etc/init.d/proftpd ºÎÆ®½ºÅ©¸³Æ®ÀÇ ÀÛ¼º

#!/bin/sh
# Begin /etc/init.d/proftpd
 
check_status()
{
  if [ $? = 0 ]
  then
    echo "OK"
  else
    echo "FAILED"
  fi
}
 
case "$1" in
  start)
    echo -n "Starting Pro FTP daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/proftpd
    check_status
    ;;
 
  stop)
    echo -n "Stopping Pro FTP daemon..."
    start-stop-daemon -K -q -o -x /usr/sbin/proftpd
    check_status
    ;;
 
  restart)
    echo -n "Stopping Pro FTP daemon..."
    start-stop-daemon -K -q -o -x /usr/sbin/proftpd
    check_status
 
    sleep 1
 
    echo -n "Starting Pro FTP daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/proftpd
    check_status
    ;;
 
  *)
    echo "Usage: $0 {start|stop|restart}"
    ;;
 
esac
 
# End /etc/init.d/proftpd
 

±ÇÇÑ°ú ½Éº¼¸¯ ¸µÅ©ÀÇ ¼³Á¤

cd /etc/rc2.d; ln -s ../init.d/proftpd S40proftpd
cd ../rc0.d; ln -s ../init.d/proftpd K40proftpd
cd ../rc6.d; ln -s ../init.d/proftpd K40proftpd
 

10.3 HTTPÀÇ ¼³Á¤

ApacheÀÇ ¼³Ä¡

./configure
make; make install
 

ApacheÀÇ ¼³Á¤

¼³Á¤ÇÒ °ÍÀÌ ¸¹Áö´Â ¾Ê´Ù. ¿ì¸®°¡ ÇØ¾ß ÇÒ °ÍÀº ´ÜÁö /usr/apache/man °æ·Î¸¦ /usr/share/misc/man.conf¿¡ Ãß°¡ÇÏ´Â °Í »ÓÀÌ´Ù.

/etc/init.d/apache ºÎÆ®½ºÅ©¸³Æ®ÀÇ »ý¼º

#!/bin/sh
# Begin /etc/init.d/apache
 
case "$1" in
  start)
    echo -n "Starting Apache HTTP daemon..."
    /usr/apache/bin/apachectl start
    ;;
 
  stop)
    echo -n "Stopping Apache HTTP daemon..."
    /usr/apache/bin/apachectl stop
    ;;
 
  restart)
    echo -n "Restarting Apache HTTP daemon..."
    /usr/apache/bin/apachectl restart
    ;;
 
  force-restart)
    echo -n "Stopping Apache HTTP daemon..."
    /usr/apache/bin/apachectl stop
 
    sleep 1
 
    echo -n "Starting Apache HTTP daemon..."
    /usr/apache/bin/apachectl start
    ;;
 
  *)
    echo "Usage: $0 {start|stop|restart|force-restart}"
    ;;
 
esac
 
# End /etc/init.d/apache
 

±ÇÇÑ°ú ½Éº¼¸¯ ¸µÅ©ÀÇ ¼³Á¤

cd /etc/rc2.d; ln -s ../init.d/apache S50apache
cd ../rc0.d; ln -s ../init.d/apache K50apache
cd ../rc6.d; ln -s ../init.d/apache K50apache
 

10.4 TelnetÀÇ ¼³Á¤

telnet µ¥¸ó°ú Ŭ¶óÀ̾ðÆ®ÀÇ ¼³Ä¡

./configure
make; make install
 

/etc/inetd.conf ¼³Á¤ÆÄÀÏÀ» ¸¸µç´Ù.

# Begin /etc/inetd.conf
 
telnet stream tcp nowait root /usr/sbin/in.telnetd
 
# End /etc/inetd.conf
 

/etc/init.d/inetd ºÎÆ®½ºÅ©¸³Æ®ÀÇ »ý¼º

#!/bin/sh
# Begin /etc/init.d/inetd
 
check_status()
{
  if [ $? = 0 ]
  then
    echo "OK"
  else
    echo "FAILED"
  fi
}
 
case "$1" in
  start)
    echo -n "Starting Internet Server daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/inetd
    check_status
    ;;
 
  stop)
    echo -n "Stopping Internet Server daemon..."
    start-stop-daemon -K -q -o -p /var/run/inetd.pid
    check_status
    ;;
 
  reload)
    echo -n "Reloading Internet Server configuration file..."
    start-stop-daemon -K -q -s 1 -p /var/run/inetd.pid
    check_status
    ;;
 
  restart)
    echo -n "Stopping Internet Server daemon..."
    start-stop-daemon -K -q -o -p /var/run/inetd.pid
    check_status
 
    sleep 1
 
    echo -n "Starting Internet Server daemon..."
    start-stop-daemon -S -q -o -x /usr/sbin/inetd
    check_status
    ;;
 
  *)
    echo "Usage: $0 {start|stop|reload|restart}"
    ;;
 
esac
 
# End /etc/init.d/inetd
 

±ÇÇÑ°ú ½Éº¼¸¯ ¸µÅ©ÀÇ ¼³Á¤

cd /etc/rc2.d; ln -s ../init.d/inetd S30inetd
cd ../rc0.d; ln -s ../init.d/inetd K30inetd
cd ../rc6.d; ln -s ../init.d/inetd K30 inetd
 

10.5 PPPÀÇ ¼³Á¤

Ä¿³Î ¼³Á¤Çϱâ

¿©·¯ºÐÀÌ ÀÎÅͳݿ¡ ¿¬°áµÇ±â Àü¿¡ Ä¿³ÎÀÌ ppp¸¦ Áö¿øÇØ¾ß ÇÑ´Ù. ÀÌ´Â Ä¿³Î ¾È¿¡ ppp Áö¿øÀ» Á÷Á¢ ³Ö¾î¼­ ÄÄÆÄÀÏÇϰųª ppp µå¶óÀ̹ö¸¦ ÇÊ¿äÇÒ ¶§ ·ÎµåÇÒ ¼ö ÀÖ´Â ¸ðµâ·Î ¸¸µêÀ¸·Î½á °¡´ÉÇÏ´Ù. ¾î¶² ¹æ¹ýÀº ¼±ÅÃÇϵç ÇÊ¿äÇÏ´Ù¸é Áö±Ý Ä¿³ÎÀ» Àç ÄÄÆÄÀÏÇÏ¿© ÀÛ¾÷À» Ç϶ó. ÀÌ¹Ì ¿©·¯ºÐÀÇ LFS Ä¿³ÎÀÌ ppp¸¦ Áö¿øÇÑ´Ù¸é Ä¿³ÎÀ» Àç ¼³Á¤ÇÒ ÇÊ¿æ ¾ø´Ù.

groupÀÇ »ý¼º

PPPÀÇ ¼³Ä¡

./configure
make; make install
 

/etc/resolv.conf »ý¼º

# Begin /etc/resolv.conf
 
nameserver <IP address of your ISP's primary DNS server>
nameserver <IP address of your ISP's secundary DNS server>
 
# End /etc/resolv.conf
 

/etc/ppp/peers/provider ÆÄÀÏ ¸¸µé±â

# Begin /etc/ppp/peers/provider
 
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
/dev/ttyS1
115200
defaultroute
noipdefault
 
# End /etc/ppp/peers/provider
 

/etc/chatscripts/provider ¸¸µé±â

# Begin /etc/chatscripts/provider
 
ABORT BUSY
ABORT "NO CARRIER"
ABORT VOICE
ABORT "NO DIALTONE"
ABORT "NO ANSWER"
"" ATZ
OK ATDT <ISP's phonenumber>
TIMEOUT 35
CONNECT ''
TIMEOUT 10
ogin: \q<username>
TIMEOUT 10
assword: \q<mysecretpassword>
 
# End /etc/chatscripts/provider
 

¾ÏÈ£ ÀÎÁõ¿¡¼­ ÁÖÀÇÇÒ »çÇ×

¿¹Á¦ ½ºÅ©¸³Æ®µé¿¡¼­ º¸µíÀÌ (À̰͵éÀº ³»°¡ X¸¦ ¾²Áö ¾ÊÀ» ¶§ ½ÇÁ¦·Î »ç¿ëÇÏ´Â ½ºÅ©¸³Æ®µéÀÌ´Ù) À§¿¡¼­ ³ª´Â ³» ISP·Î papÀ̳ª chapÀ» ÅëÇÑ ÀÎÁõ ´ë½Å chatscripts¸¦ ÀÌ¿ëÇÏ¿© Á¢¼ÓÇÏ¿´´Ù. ³» ISP°¡ pap¸¦ Áö¿øÇϱä ÇÏÁö¸¸ ³ª´Â ÀÌ Àå/´ÜÁ¡À» ¸ðµÎ °¡Áø ¾à°£ ´Ù¸¥ ¹æ½ÄÀ¸·Î Çϱâ·Î °áÁ¤ÇÏ¿´´Ù. ³» °æ¿ì¿¡ ÀåÁ¡ÀÌ ´ÜÁ¡º¸´Ù ¸¹´Ù. ÀÌ ¹æ½ÄÀ¸·Î ³ª´Â ³» Á¢¼Ó °úÁ¤¿¡ ´ëÇÑ ´õ ¸¹Àº Á¦¾î±ÇÀ» °¡Áú ¼ö ÀÖ°í ¾ðÁ¦ ¾î¶² ÀÏÀÌ ÀϾ´ÂÁö¸¦ ´õ ÀÚ¼¼È÷ ¾Ë ¼ö ÀÖ¾ú´Ù.

¿¹¸¦ µé¾î ³»°¡ Á¢¼ÓÇÒ ¶§ ´ëºÎºÐ ³ª´Â tail -f /var/log/syslog ¸¦ ½ÇÇàÇÏ´Â À©µµ¿ì¸¦ ¿­¾î ³õ¾Æ¼­ »ç¿ëÀÚ ¸íÀ̳ª ¾ÏÈ£°¡ º¸³»Áö´Â ½Ã±â °°Àº °ÍµéÀ» Á÷Á¢ °üÂûÇÒ ¼ö ÀÖ´Ù.


´ÙÀ½ ÀÌÀü Â÷·Ê