À̵¿: Home à os0101

 

ÁÖ¼Ò: http://www.kernel.bz/os/01/os0101.htm

 

Á¦¸ñ: ¸®´ª½º À¥»çÀÌÆ® ±¸ÃàÀ» À§ÇÑ ÆÐŰÁö ¼³Ä¡¹æ¹ý

ÀúÀÛ±ÇÀº ÀúÀÚ¿¡°Ô ÀÖ½À´Ï´Ù

ÀúÀÚ: Á¤ÀçÁØ(rgbi3307@nate.com)

ÃÖ±Ù¼öÁ¤ÀÏ:2008-12-07

 

 

¸®´ª½º À¥»çÀÌÆ® ±¸ÃàÀ» À§ÇÑ ÆÐŰÁö ¼³Ä¡¹æ¹ý

 

¼³Ä¡¹öÀü: Linux 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux

RedHat Linux9ÀÇ ¸ðµç ÆÐŰÁö(Full)¸¦ ¼³Ä¡ÇÑ ´ÙÀ½¿¡, ¾Æ·¡¿Í °°Àº ¼ø¼­·Î ÀÛ¾÷ÇÑ´Ù.

1. MASQUERADE ¼³Á¤

2. xinetd ¼³Ä¡

3. DNS ¼³Á¤

4. FTP(ProFtp) ¼³Ä¡

5. MySql ¼³Ä¡

6. Apache_SSL_PHP ¼³Ä¡

7. Qmail ¼³Ä¡

 

 

1. MASQUERADE ¼³Á¤

Linux ¸Ó½ÅÀ» ÄÉÀÌÆ®¿þÀÌ·Î ¼³Á¤ÇÏ¿© Local Area Network¸¦ ±¸ÃàÇÑ´Ù.  À̶§, ³×Æ®¿öÅ© Ä«µå´Â 2°³°¡ ¼³Ä¡µÈ´Ù.

 

eth0´Â DHCP·Î ¼³Á¤

/etc/sysconfig/network-scripts/ifcfg-eth0 ÆÄÀÏÆíÁý

DEVICE=eth0

BOOTPROTO=dhcp

ONBOOT=yes

ifup eth0 ¸í·ÉÀ¸·Î ù¹øÂ° ³×Æ®¿öũīµå ¼³Á¤

 

eth1´Â 192.168.0.1 ³»ºÎ IP·Î ¼³Á¤

/etc/sysconfig/network-scripts/ifcfg-eth1 ÆÄÀÏÆíÁý

DEVICE=eth1

USERCTL=no

ONBOOT=yes

BOOTPROTO=none

BROADCAST=192.168.0.255

NETWORK=192.168.0.0

NETMASK=255.255.255.0

IPADDR=192.168.0.1

ifup eth1 ¸í·ÉÀ¸·Î µÎ¹øÂ° ³×Æ®¿öũīµå ¼³Á¤ ÈÄ, ifconfig ¸í·ÉÀ¸·Î ¼³Á¤³»¿ë È®ÀÎ.

IP MASQUERADE (NAT) ½ÇÇà

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P FORWARD DROP

iptables -A FORWARD -i eth1 -j ACCEPT

iptables -A FORWARD -o eth1 -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

//iptables È®ÀÎ

iptables -t nat -L

À§ÀÇ ½ÇÇà³»¿ëÀ» /etc/rc.d/rc.local ÆÄÀÏ¿¡ ÀúÀåÇÏ¿© ºÎÆÃ½Ã ÀÚµ¿À¸·Î ¼³Á¤µÇµµ·Ï ÇÑ´Ù.

 

2. xinetd ¼³Ä¡

xinetd(eXtended InterNET services Daemon)¸¦ ¼³Ä¡ÇÏ¿© ¸®´ª½º ³×Æ®¿öÅ© º¸¾È±â´ÉÀ» °­È­ÇÑ´Ù. 

 

»çÀÌÆ®: http://www.xinetd.org/

Âü°í»çÀÌÆ®: http://www.linuxlab.co.kr/docs/01-06-5.htm

¼³Ä¡¹öÀü: xinetd-2.3.12

 

xinetd ¼³Ä¡

//¹öÀüÈ®ÀÎÇÏ¿©, ±âÁ¸¿¡ RPMÀ¸·Î ¼³Ä¡µÇ¾î ÀÖ´Ù¸é »èÁ¦ÇÑ´Ù.

xinetd –version 

rpm -qa | grep xinetd

rpm -e --nodeps xinetd

 

tar xvzf ./xinetd-2.3.12.tar.gz

cd xinetd-2.3.12

./configure --prefix=/usr --sysconfdir=/etc --with-loadavg --with-libwrap

make

make install

 

//ȯ°æ¼³Á¤ ¹× ½ÇÇà

cd xinetd

cp ./sample.conf /etc/xinetd.conf.sample

cd ..

cd contrib

cp ./xinetd /etc/rc.d/init.d/

/etc/rc.d/init.d/xinetd start

xinetd –version  //¹öÀüÈ®ÀÎ

 

//µð·ºÅ丮 Á¢±Ù Á¦ÇÑ

chmod 600 /etc/xinetd.conf

chmod -R 600 /etc/xinetd.d/

 

//·Î±×

#/var/log/xinetd_log

 

/etc/xinetd.conf ȯ°æ¼³Á¤ ÆÄÀÏ

#

# Simple configuration file for xinetd

#

# Some defaults, and include /etc/xinetd.d/

 

defaults

{

        instances               = 60

        log_type                = SYSLOG authpriv

        log_on_success          = HOST PID

        log_on_failure          = HOST

        cps                     = 25 30

}

 

includedir /etc/xinetd.d

 

/etc/xinetd.d/* ¼³Á¤°æ·Î

amanda       cups-lpd     eklogin  ipop3        pop3s       rsh       swat          xinetd_d_bak

amandaidx    daytime      finger   klogin       proftpd     rsync     talk

amidxtape    daytime-udp  gssftp   krb5-telnet  qmail-pop3  servers   telnet

chargen      dbskkd-cdb   imap     kshell       qmail-smtp  services  tftp.rpmsave

chargen-udp  echo         imaps    ktalk        rexec       sgi_fam   time

comsat       echo-udp     ipop2    ntalk        rlogin      sshd      time-udp

 

/etc/rc.d/rc.local ÆÄÀÏ¿¡ ÀúÀåÇÏ¿© ºÎÆÃ½Ã xinetd ÀÚµ¿½ÇÇà

/etc/rc.d/init.d/xinetd start

 

 

3. DNS ¼³Á¤

DNS(Data Name Server)´Â ¸®´ª½º¿¡¼­ ¼³Ä¡µÈ °ÍÀ» Ȱ¿ëÇÏ¿© ¼³Á¤ÇÑ´Ù.

 

/etc/hosts ÆÄÀÏÆíÁý

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1       localhost       localhost.localdomain

118.33.196.89   demian.bz       demian.bz

 

/etc/host.conf ÆÄÀÏÆíÁý

order hosts,bind

multi off

nospoof on

trim demian.bz

 

/etc/resolv.conf ÆÄÀÏÈ®ÀÎ

; generated by /sbin/dhclient-script

search kornet

nameserver 168.126.63.1

nameserver 168.126.63.2

 

/etc/named.conf ȯ°æ¼³Á¤ ÆÄÀÏÆíÁý

//

// a caching only nameserver config

//

zone "." IN {

        type hint;

        file "named.ca";

};

 

zone "localhost" IN {

        type master;

        file "localhost.zone";

        allow-update { none; };

};

 

zone "0.0.127.in-addr.arpa" IN {

        type master;

        file "named.local";

        allow-update { none; };

};

 

controls {

        inet * allow { any ; } keys { demian ; };

};

 

key "demian" {

        algorithm hmac-md5;

        secret "hy4WmmLIV6uM25X0GLJzHQ==";

};

 

zone "demian.bz" {

        type master;

        file "demian.bz";

        //allow-update { demian; };     //error

};

 

zone "196.33.118.in-addr.arpa" {

        type master;

        file "demian.rev";

        //allow-update { demian; };     //error

};

 

zone "whiteoffice.net" {

        type master;

        file "whiteoffice.net";

        //allow-update { whiteoffice; };        //error

};

 

/var/named/* °æ·Î¾ÈÀÇ ÆÄÀϵé

-rw-r--r--    1 root     root          363 11¿ù 28 14:21 demian.bz

-rw-r--r--    1 root     root          222 11¿ù 28 10:23 demian.rev

-rw-r--r--    1 named    named         195  1¿ù 25  2003 localhost.zone

-rw-r--r--    1 named    named        2499  1¿ù 25  2003 named.ca

-rw-r--r--    1 named    named         433  1¿ù 25  2003 named.local

-rw-r--r--    1 root     root          282 11¿ù 28 14:23 whiteoffice.net

 

/var/named/demian.bz ÆÄÀÏÆíÁý

$TTL    86400

@       IN      SOA     ns.demian.bz.   jungjj.demian.bz. (

 

                1       ;Serial

                43200   ;Refresh

                3600    ;Retry

                604800  ;Expire

                86400 ) ;TTL

 

        IN      NS      ns1.demian.bz.

        IN      NS      ns2.demian.bz.

        IN      NS      ns3.whiteoffice.net.

        IN      MX 10   demian.bz.

 

@       IN      A       118.33.196.89 

www     IN      A       118.33.196.89 

ftp     IN      CNAME   www

crm     IN      A       118.33.196.89

 

/var/named/demian.rev ÆÄÀÏÆíÁý

$TTL    43200

@       IN      SOA     ns.demian.bz.   jungjj.demian.bz. (

 

                2       ;Serial

                43200   ;Refresh

                3600    ;Retry

                604800  ;Expire

                86400 ) ;TTL

 

        IN      NS      ns1.demian.bz.

        IN      NS      ns2.demian.bz.

 

89      IN      PTR     ns.demian.bz.

89      IN      PTR     www

 

/var/named/whiteoffice.net ÆÄÀÏÆíÁý

$TTL    86400

@       IN      SOA     ns.whiteoffice.net.     jungjj.whiteoffice.net. (

 

                3       ;Serial

                43200   ;Refresh

                3600    ;Retry

                604800  ;Expire

                86400 ) ;TTL

 

        IN      NS      ns3.whiteoffice.net.

        IN      MX 10   whiteoffice.net.

 

@       IN      A       61.100.180.38 

www     IN      A       61.100.180.38 

ftp     IN      CNAME   www

 

DNS ½ÇÇà ¹× È®ÀÎ

//DNS ½ÇÇà

/etc/rc.d/init.d/named start

ps aux | grep named

 

//¼³Á¤È®ÀÎ

host demian.bz

host www.demian.bz

host crm.demian.bz

host whiteoffice.net

host www.whiteoffice.net

 

host 118.33.196.89 //Host 89.196.33.118.in-addr.arpa not found: 3(NXDOMAIN)

nslookup –sil

 

//dnssec-keygen -a hmac-md5 -b 128 -n HOST activemart.

//cat Kactivemart.+157+01756.private

 

/etc/rc.d/rc.local ÆÄÀÏ¿¡ µî·ÏÇÏ¿© ºÎÆÃ½Ã ÀÚµ¿½ÇÇà

/etc/rc.d/init.d/named start

 

 

4. FTP(ProFtp) ¼³Ä¡

»çÀÌÆ®: http://www.proftpd.org/

¼³Ä¡¹öÀü: proftpd-1.2.4

 

ProFtp ¼³Ä¡

//ÀÌ¹Ì ¼³Ä¡µÇ¾î ÀÖ´Â FTP RPMµéÀÌ ÀÖÀ¸¸é »èÁ¦ÇÔ

rpm -qa | grep ftp

rpm -e --nodeps ncftp-3.0.2-1

rpm -e --nodeps anonftp-4.0-4

rpm -e --nodeps ftp-0.17-7

 

//¼³Ä¡

tar xvzf ./proftpd-1.2.4.tar.gz

cd proftpd-1.2.4

./configure --prefix=/usr/local/proftpd

make

make install

 

 

/usr/local/proftpd/etc/proftpd.conf ȯ°æ¼³Á¤ ÆÄÀÏÆíÁý

# This is a basic ProFTPD configuration file (rename it to

# 'proftpd.conf' for actual use.  It establishes a single server

# and a single anonymous login.  It assumes that you have a user/group

# "nobody" and "ftp" for normal operation and anon.

 

ServerName                      "whiteoffice FTP service"

#ServerType                     standalone

ServerType                      inetd

DefaultServer                   on

 

# Port 21 is the standard FTP port.

Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files

# from being group and world writable.

Umask                           022

 

# To prevent DoS attacks, set the maximum number of child processes

# to 30.  If you need to allow more than 30 concurrent connections

# at once, simply increase this value.  Note that this ONLY works

# in standalone mode, in inetd mode you should use an inetd server

# that allows you to limit maximum number of processes per service

# (such as xinetd)

MaxInstances                    60

 

# Set the user and group that the server normally runs at.

User                            nobody

Group                           nobody

 

RootLogin                       off

DefaultRoot                     ~ !whiteoffice

 

# Normally, we want files to be overwriteable.

<Directory /*>

  AllowOverwrite                on

</Directory>

 

# A basic anonymous configuration, no upload directories.

<Anonymous ~ftp>

  User                          ftp

  Group                         ftp

  # We want clients to be able to login with "anonymous" as well as "ftp"

  UserAlias                     anonymous ftp

 

  # Limit the maximum number of anonymous logins

  MaxClients                    9999 "MaxClients %m"

 

# We want 'welcome.msg' displayed at login, and '.message' displayed

# in each newly chdired directory.

  DisplayLogin                  welcome.msg

  DisplayFirstChdir             .message

 

  # Limit WRITE everywhere in the anonymous chroot

  <Limit WRITE>

    DenyAll

  </Limit>

 

</Anonymous>

 

/etc/xinetd.d/proftpd ÆÄÀÏÆíÁý(ServerType inetd·Î ¼³Á¤½Ã)

service ftp

{

        disable                 = no

        flags                   = REUSE

        protocol                = tcp

        socket_type             = stream

        instances               = 30

        wait                    = no

        user                    = root

#       server                  = /usr/sbin/in.proftpd

        server                  = /usr/local/proftpd/sbin/proftpd

        port                    = 21

        log_on_success          = HOST PID

}

 

xinetd¿¡¼­ ProFtpd ½ÇÇà

cd /etc/xinetd.d/

ln -s ./proftpd /usr/sbin/in.proftpd

 

//xinetd·Î ½ÇÇà

/etc/rc.d/init.d/xinetd restart

 

//½ÇÇàÈ®ÀÎ

telnet localhost 21

 

Trying 127.0.0.1...

Connected to localhost (127.0.0.1).

Escape character is '^]'.

220 ProFTPD 1.2.4 Server (whiteoffice FTP service) [demian.bz]

 

 

 

5. MySql ¼³Ä¡

»çÀÌÆ®: http://www.mysql.org (http://dev.mysql.com/)

¼³Ä¡¹öÀü: mysql-3.23.58

 

MySql ¼³Ä¡

tar xvzf mysql-3.23.58.tar.gz

cd mysql-3.23.58

./configure --prefix=/usr/local/mysql --with-charset=euc_kr --localstatedir=/usr/local/mysql/data \

--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock

make

make install

 

//DB»ý¼º ¹× ½ÇÇà

./scripts/mysql_install_db

/usr/local/mysql/bin/safe_mysqld --user=root &

 

//½ÇÇàÈ®ÀÎ

ps aux | grep mysql

 

//Á¢±Ù¾ÏÈ£ ¼³Á¤

/usr/local/mysql/bin/mysqladmin -u root -p password 'passwd'

/usr/local/mysql/bin/mysqladmin -u root -h whiteoffice.net -p password 'passwd'

 

/etc/rc.d/rc.local ÆÄÀÏ¿¡ µî·ÏÇÏ¿© ºÎÆÃ½Ã MySql ÀÚµ¿½ÇÇà

/usr/local/mysql/bin/safe_mysqld --user=root &

 

 

 

6. Apache_SSL_PHP ¼³Ä¡

¾ÆÆÄÄ¡ »çÀÌÆ®: http://www.apache.org/

OpenSSL »çÀÌÆ®: http://www.openssl.org/

ModSSL »çÀÌÆ®: http://www.modssl.org/

PHP »çÀÌÆ®: http://www.php.net/

 

¼³Ä¡¹öÀü:

libiconv-1.9.1

openssl-0.9.6j

mod_ssl-2.8.15-1.3.28

apache_1.3.28

php-4.3.3

 

¼³Ä¡Çϱâ

tar xvzf libiconv-1.9.1.tar.gz

tar xvzf openssl-0.9.6j.tar.gz

tar xvzf mod_ssl-2.8.15-1.3.28.tar.gz

tar xvzf apache_1.3.28.tar.gz

tar xvzf php-4.3.3.tar.gz

 

//libiconv (PHP ¶óÀ̺귯¸® ¼³Ä¡, --with-iconv=/usr/local)

cd libiconv-1.9.1

./configure --prefix=/usr/local

make

make install

 

//openssl ¼³Ä¡

cd ..

cd openssl-0.9.6j

./Configure

./config

make

make install

 

//mod_ssl ¼³Ä¡

cd ..

cd mod_ssl-2.8.15-1.3.28

./configure --with-apache=../apache_1.3.28

 

//apache ¼³Ä¡Áغñ

cd ..

cd apache_1.3.28

./configure --prefix=/usr/local/apache

 

//php4 ¼³Ä¡

cd ..

cd php-4.3.3

CFLAGS='-O2 -I/usr/local/ssl/include' ./configure --with-apache=../apache_1.3.28 \

 --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/lib --enable-memory-limit=yes \

 --enable-debug=no --with-iconv=/usr/local

gmake

gmake install

 

//apache ¼³Ä¡

cd ..

cd apache_1.3.28

SSL_BASE=/usr/local/ssl ./configure --prefix=/usr/local/apache \

        --enable-module=ssl --activate-module=src/modules/php4/libmodphp4.a

make

//¶óÀ̺귯¸® ¿À·ù ¹ß»ý

 

//Àçºôµå

SSL_BASE=/usr/local/ssl ./configure --prefix=/usr/local/apache \

        --enable-module=ssl --activate-module=src/modules/php4/libphp4.module \

        --activate-module=src/modules/php4/libmodphp4.a

make

//¶óÀ̺귯¸® ¿À·ù ¹ß»ý

 

cp ./src/modules/php4/ibmodphp4.a ./src/modules/php4/libphp4.a

 

//Àçºôµå

SSL_BASE=/usr/local/ssl ./configure --prefix=/usr/local/apache \

        --enable-module=ssl --activate-module=src/modules/php4/libphp4.a \

make

make certificate

make install

 

//¾ÆÆÄÄ¡ ½ÇÇà

#/usr/local/apache/bin/apachectl start

/usr/local/apache/bin/apachectl startssl

ps aux | grep apache

 

//PHP standalone ¼³Ä¡

cd ..

cd php-4.3.3

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql \

--with-config-file-path=/usr/local/lib --enable-memory-limit=yes \

--enable-debug=no --with-iconv=/usr/local

gmake

gmake install

 

 

/etc/rc.d/rc.local ÆÄÀÏ¿¡ µî·ÏÇÏ¿© ºÎÆÃ½Ã ¾ÆÆÄÄ¡ ÀÚµ¿½ÇÇà

/usr/local/apache/bin/apachectl start

 

 

 

7. Qmail ¼³Ä¡

»çÀÌÆ®: http://www.qmail.org/

¼³Ä¡¹öÀü:

daemontools-0.76 (ÂüÁ¶: http://cr.yp.to/daemontools.html)

ucspi-tcp-0.88 (ÂüÁ¶: http://cr.yp.to/ucspi-tcp.html)

qmail-1.03

checkpassword-0.81

 

 

¼³Ä¡ÆÄÀÏ ´Ù¿î·Îµå

wget http://www.baslug.org/vega/qmail/file/daemontools-0.76.tar.gz

wget http://www.baslug.org/vega/qmail/file/ucspi-tcp-0.88.tar.gz

wget http://www.baslug.org/vega/qmail/file/qmail-1.03.tar.gz

wget http://www.baslug.org/vega/qmail/file/vpopmail-5.2.1.tar.gz

wget http://www.baslug.org/vega/qmail/file/autorespond-2.0.2.tar.gz

wget http://www.baslug.org/vega/qmail/file/qmailadmin-1.0.6.tar.gz

wget http://www.baslug.org/vega/qmail/file/ezmlm-0.53.tar.gz

wget http://www.baslug.org/vega/qmail/file/idx.shupp.patch.gz

wget http://www.baslug.org/vega/qmail/file/sqwebmail-3.6.0.tar.bz2

wget http://www.baslug.org/vega/qmail/file/init-scripts.tar.gz

wget http://www.baslug.org/vega/qmail/file/vega.patch

 

¼³Ä¡ÁøÇà

//daemontools ¼³Ä¡

tar -xvzf ./daemontools-0.76.tar.gz

cd admin/daemontools-0.76/src

patch < ../../../vega.patch

#patching file error.h

cd ..

package/install

 

//ucspi-tcp ¼³Ä¡

cd ..

cd ..

tar -xvzf ./ucspi-tcp-0.88.tar.gz

cd ucspi-tcp-0.88

patch < ../vega.patch

#patching file error.h

#Hunk #1 succeeded at 1 (offset -2 lines).

make

make setup check

 

//qmail ¼³Ä¡

cd ..

mkdir /var/qmail

tar -xvzf ./qmail-1.03.tar.gz

cd qmail-1.03

vi INSTALL.ids

 

INSTALL.ids ÆÄÀÏ ÆíÁý(qmail »ç¿ëÀÚ°èÁ¤)

groupadd nofiles

useradd -g nofiles -d /var/qmail/alias alias

useradd -g nofiles -d /var/qmail qmaild

useradd -g nofiles -d /var/qmail qmaill

useradd -g nofiles -d /var/qmail qmailp

groupadd qmail

useradd -g qmail -d /var/qmail qmailq

useradd -g qmail -d /var/qmail qmailr

useradd -g qmail -d /var/qmail qmails

 

qmail ¼³Ä¡

chmod 755 ./INSTALL.ids

./INSTALL.ids

 

#for vpopmail

#groupadd vchkpw

#useradd -g vchkpw vpopmail

 

patch < /var/src/tar/vega.patch

#patching file error.h

#Hunk #1 succeeded at 1 (offset -2 lines).

make

make setup check

 

qmail ȯ°æ¼³Á¤

./config

#./config-fast whiteoffice.net

./config-fast demian.bz

 

cd ~alias/

touch .qmail-postmaster .qmail-mailer-daemon .qmail-root

chmod 644 .qmail*

 

rm /etc/rc.d/rc3.d/*sendmail*

rm /etc/rc.d/rc5.d/*sendmail*

mv /usr/sbin/sendmail /usr/sbin/sendmail.old

mv /usr/lib/sendmail /usr/lib/sendmail.old

killall -TERM sendmail

ln -s /var/qmail/bin/sendmail /usr/lib/sendmail

ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

 

mkdir -p /var/log/qmail/qmail-pop3

mkdir /var/log/qmail/qmail-smtp

mkdir /var/log/qmail/qmail-local

mkdir /var/log/qmail/qmail-send

mkdir /var/lock/qmail-pop3

mkdir /var/lock/qmail-smtp

 

chown qmaill /var/log/qmail –R

cp /var/qmail/boot/home /var/qmail/rc

 

 

/var/qmail/rc ³»¿ëÆíÁý

#!/bin/sh

 

# Using splogger to send the log through syslog.

# Using qmail-local to deliver messages to ~/Mailbox by default.

 

#exec env - PATH="/var/qmail/bin:$PATH" \

#qmail-start ./Mailbox splogger qmail

exec env - PATH="/var/qmail/bin:$PATH" \

qmail-start "`cat /var/qmail/control/defaultdelivery`"

 

/var/qmail/control/defaultdelivery ÆÄÀÏ»ý¼º

./maildir/

 

qmail DNS È®ÀÎ

/var/qmail/control/rcpthosts  È®ÀÎ

localhost     

ns.demian.bz

demian.bz

 

/var/qmail/control/locals  È®ÀÎ

localhost     

ns.demian.bz

demian.bz

 

»ç¿ëÀÚ°èÁ¤ »ý¼º½Ã qmail °æ·Î ÀÚµ¿ »ý¼º

/var/qmail/bin/maildirmake /etc/skel/maildir

 

/etc/xinetd.d/qmail-smtp ÆÄÀÏ »ý¼º

service smtp

{

        disable = no

        flags                   = REUSE NAMEINARGS

        protocol                = tcp

        socket_type             = stream

        wait                    = no

        user                    = qmaild

        server                  = /var/qmail/bin/tcp-env

        server_args             = tcp-env /var/qmail/bin/qmail-smtpd

}

 

/etc/xinetd.d/qmail-pop3 ÆÄÀÏ »ý¼º

service pop3

{

        disable = no

        flags                   = REUSE NAMEINARGS

        protocol                = tcp

        socket_type             = stream

        wait                    = no

        user                    = root 

        server                  = /var/qmail/bin/qmail-popup

        server_args   = qmail-popup demian.bz /bin/checkpassword /var/qmail/bin/qmail-pop3d maildir

}

 

qmail ½ÇÇà

/etc/rc.d/init.d/xinetd restart

csh -cf '/var/qmail/rc &'

 

ps aux | grep qmail*

 

qmail ½ÇÇ൥¸ó È®ÀÎ

qmails    7990  0.4  0.1  1396  332 pts/0    S    11:15   0:00 [qmail-send]

root      7992  0.0  0.1  1360  276 pts/0    S    11:15   0:00 qmail-lspawn ./maildir/

qmailr    7993  0.0  0.1  1356  276 pts/0    S    11:15   0:00 [qmail-rspawn]

qmailq    7994  0.0  0.1  1352  288 pts/0    S    11:15   0:00 [qmail-clean]

 

qmail Á¢¼Ó È®ÀÎ

telnet localhost 25

 

#Trying 127.0.0.1...

#Connected to localhost (127.0.0.1).

#Escape character is '^]'.

#220 demian.bz ESMTP Postfix

 

 

/etc/rc.d/rc.local ÆÄÀÏ¿¡ µî·ÏÇÏ¿© ºÎÆÃ½Ã qmail ÀÚµ¿½ÇÇà

#running qmail local

csh -cf '/var/qmail/rc &'

 

 

qmail ±âŸ(·Î±× ½ºÅ©¸³Æ®) ȯ°æ¼³Á¤

//var/src/tar

cd /var/src

tar -xzf tar/init-scripts.tar.gz

cp init-scripts/rc /var/qmail/rc

chmod 755 /var/qmail/rc

mkdir /var/log/qmail

echo ./Maildir/ >/var/qmail/control/defaultdelivery

cp init-scripts/qmailctl /var/qmail/bin/

 

chmod 755 /var/qmail/bin/qmailctl

ln -s /var/qmail/bin/qmailctl /usr/bin

 

# Alcuni programmi hanno bisogno di sendmail :-)

ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

ln -s /var/qmail/bin/sendmail /usr/lib/sendmail

 

# Script per il servizio qmail

mkdir -p /var/qmail/supervise/qmail-send/log

mkdir -p /var/qmail/supervise/qmail-smtpd/log

mkdir -p /var/qmail/supervise/qmail-pop3d/log

mkdir -p /var/qmail/supervise/qmail-pop3ds/log

 

chmod +t /var/qmail/supervise/qmail-send

chmod +t /var/qmail/supervise/qmail-smtpd

chmod +t /var/qmail/supervise/qmail-pop3d/log

chmod +t /var/qmail/supervise/qmail-pop3ds/log

 

cp /var/src/init-scripts/send.run /var/qmail/supervise/qmail-send/run

cp /var/src/init-scripts/send.log.run /var/qmail/supervise/qmail-send/log/run

 

cp /var/src/init-scripts/smtpd.run /var/qmail/supervise/qmail-smtpd/run

cp /var/src/init-scripts/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run

 

cp /var/src/init-scripts/pop3d.run /var/qmail/supervise/qmail-pop3d/run

cp /var/src/init-scripts/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run

 

cp /var/src/init-scripts/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run

cp /var/src/init-scripts/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run

 

echo 20 > /var/qmail/control/concurrencyincoming

chmod 644 /var/qmail/control/concurrencyincoming

 

chmod 755 /var/qmail/supervise/qmail-send/run

chmod 755 /var/qmail/supervise/qmail-send/log/run

 

chmod 755 /var/qmail/supervise/qmail-smtpd/run

chmod 755 /var/qmail/supervise/qmail-smtpd/log/run

 

chmod 755 /var/qmail/supervise/qmail-pop3d/run

chmod 755 /var/qmail/supervise/qmail-pop3d/log/run

 

chmod 755 /var/qmail/supervise/qmail-pop3ds/run

chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run

 

mkdir -p /var/log/qmail/smtpd

mkdir -p /var/log/qmail/pop3d

mkdir -p /var/log/qmail/pop3ds

 

chown qmaill /var/log/qmail /var/log/qmail/smtpd

chown qmaill /var/log/qmail/pop3d /var/log/qmail/pop3ds

 

ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service

 

# Verifica che tutto funzioni lanciando

qmailctl stat

 

/service/qmail-send: up (pid 1000) 2 seconds

/service/qmail-send/log: up (pid 1001) 2 seconds

/service/qmail-smtpd: up (pid 1002) 1 seconds

/service/qmail-smtpd/log: up (pid 1003) 1 seconds

 

 

/etc/rc.d/rc.local ÆÄÀÏ

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

 

touch /var/lock/subsys/local

 

hostname demian.bz

 

#set MASQ

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P FORWARD DROP

iptables -A FORWARD -i eth1 -j ACCEPT

iptables -A FORWARD -o eth1 -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

 

#running xinetd

/etc/rc.d/init.d/xinetd start

 

#running DNS

/etc/rc.d/init.d/named start

 

#running qmail local

csh -cf '/var/qmail/rc &'

 

#running mysql

#/etc/rc.d/init.d/mysql.server start

/usr/local/mysql/bin/safe_mysqld --user=root &

 

#running apache

/usr/local/apache/bin/apachectl start

 

 

 

À̵¿: Home à os0101

 

ÁÖ¼Ò: http://www.kernel.bz/os/01/os0101.htm

 

Á¦¸ñ: ¸®´ª½º À¥»çÀÌÆ® ±¸ÃàÀ» À§ÇÑ ÆÐŰÁö ¼³Ä¡¹æ¹ý

ÀúÀÛ±ÇÀº ÀúÀÚ¿¡°Ô ÀÖ½À´Ï´Ù

ÀúÀÚ: Á¤ÀçÁØ(rgbi3307@nate.com)

ÃÖ±Ù¼öÁ¤ÀÏ:2008-12-07