[웹/메일서버] apm+dns+sendmail on RH7.1
<<apm+dns+sendmail on RH7.1>>
-제가한 설정들이 정확하지는 않을 겁니다..
그러나 도움이 되시리라 믿습니다.
혹.. 잘못된 점이 있으면 고수님들의 애정어린 충고 바랍니다.
[1.APM +Zend+GD+FreeType]
(설치할 파일들)
1) apache_1.3.19.tar.gz
2) php-4.0.4pl.tar.gz
3) mysql-3.23.37.tar.gz
4) imap.tar.Z
5) gd_1.8.3.tar.gz
6) freetype-1.3.1.tar.gz
7) ZendOptimizer-1[1].0.0-PHP_4.0.4-Linux_glibc21-i386.tar.gz
(설치 환경)
-RedHat 7.0
-pentium 500, 256RAM
-설치할 파일들을 /tmp에 모두 두세요.
-rpm -e 명령을 써서 전에 깔려 있던 apache,php,mysql을 제거하여 주세
요.
(설치)
1.imap 설치
tmp># tar xvzf imap.tar.gz
tmp># mv ./imap/ /usr/local/imap
tmp># cd /usr/local/imap
tmp># make slx
tmp># cp ipopd/ipop2d /usr/sbin
tmp># cp ipopd/ipop3d /usr/sbin
tmp># cp imapd/imapd /usr/sbin
tmp># cd /etc/xinetd.d
xinetd.d># vim imapd
service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += DURATION USERID
log_on_failure += USERID
}
xinetd.d># vim ipop3d
service pop3
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += /USERID
log_on_failure += USERID
}
xinetd.d># vim /etc/services
…
pop3110/tcp pop-3 #POP version 3
pop3110/udp pop-3
…
imap2 143/tcp imap#Interim Mail Access Proto v2
imap2 143/udp imap
…
xinetd.d># ./etc/rc.d/init.d/xinetd restart
2. mysql 설치
tmp># tar xvzf mysql-3.23.37.tar.gz
tmp># cd mysql-3.23.37
mysql># ./configure –prefix=/usr/local/mysql –with-
char=euc_kr —
enable-large-files
mysql># make; make install
mysql># ./usr/local/mysql/bin/mysql_install_db(처음 한번만 실행
해준
다.root패스워드는 알아서)
3. gd 설치
tmp># tar xvzf gd-1.8.3.tar.gz
tmp># mv ./gd/ /usr/local/gd
gd># make all
gd># cp libgd.a /usr/local/lib
gd># mkdir /usr/local/include
gd># cp *.h /usr/local/include
4. freetype 설치
tmp># tar xvzf freetype_1.3.1.tar.gz
tmp># mv ./freetype/ /usr/local/freetype
tmp># cd /usr/lcoal/freetype
freetype># ./configure
freetype># make; make install
5. php 설치
(아파치를 먼저 configure 시켜준다)
tmp># tar xvzf apache_1.3.19.tar.gz
tmp># tar xvzf php-4.0.4pl.tar.gz
tmp># cd apache
apache>#./configure –prefix=/usr/local/apache
apache># cd /tmp/php
php># ./configure\\
–with-mysql=/usr/local/mysql\\
–with-apache=/tmp/apache_1.3.19\\
–with-gd=/usr/local/gd\\
–with-freetype=/usr/local/freetype\\
–with-imap=/usr/local/imap\\
–with-language=korean\\
–with-charset=euc_kr\\
–with-config-file=/usr/local/lib\\
–with-track-debug
php># make; make install
6. apache 설치
tmp># cd apache
apache># ./configure\\
–prefix=/usr/local/apache\\
–activate-module=src/modules/php4/libphp4.a\\
–enable-rule=SHARED_CORE\\
–enable-module=so\\
–enable-shared=max
apache># make; make install
tmp># vi /usr/local/apache/conf/httpd.conf
(아래 부분에 “#”를 지우고 수정)
1) ServerName localhost
==>php4 부분
2) AddType appliation/x-httpd-
php .php .php3 .php4 .PHP .html .htm .inc
3) AddType text/htm .shtml
AddHandler Server-parse .shtml
7. ZendOptimizer 설치
tmp># tar xvzf ZendOptimizer~~
tmp># cd ZendOptimizer
Zend~># mkdir /usr/local/Zend
Zend~># mkdir /usr/local/Zend/lib
Zend~># cp ZendOptimizer.so /usr/local/lib
tmp>#cd php
php>#cp php.ini-dist /usr/local/lib/php.ini
php># vi /usr/local/lib/php.ini(아래부분)
[Zend Optimizer]
Zend_optimizer.optimization_level=7
Zend_extension=”/usr/local/Zend/lib/ZendOptimizer.so”
[2.DNS]
-IP:111.222.333.444
-GW:111.222.333.555
-domain:peterworld.pe.kr
1./etc/resolv.conf 설정
search peterworld.pe.kr
nameserver 111.222.333.444
nameserver 168.126.63.1 <==코넷의 네임서버
nameserver 128.138.243.151 <==콜로라도대학교의 네임서버
2./etc/host.conf 설정
order hosts,bind
multi on
3./etc/named.conf
// generated by named-bootconf.pl
options {
directory “/var/named”;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query- source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// 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; };
};
key “key” {
algorithm hmac-md5;
secret “bgvOxxRSlsWyLEGMkjjCDgPDbKfOgpDSHltRnTPptpGHFkwNQrgFpG
Vba00g”;
};
zone “333.222.111.in-addr.arpa” IN {
type master;
file “zone-333.222.111”;
allow-update { none; };
};
zone “peterworld.pe.kr” IN {
type master;
file “peterworld.zone”;
allow-update { none; };
};
4./var/named/named.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ;
Serial
28800 ;
Refresh
14400 ;
Retry
3600000 ;
Expire
86400 ;
Minimum
)
IN NS localhost.
1 IN PTR localhost.
$TTL 86400
@ IN SOA ns.peterworld.pe.kr. root.peterworld.pe.kr. (
1997022700 ;
Serial
28800 ;
Refresh
14400 ;
Retry
3600000 ;
Expire
86400 ;
Minimum
)
;Name Server
IN NS ns.peterworld.pe.kr.
IN MX 10 peterworld.pe.kr.
;in-addr-arpa
444 IN PTR peterworld.pe.kr.
6./var/named/peterworld.zone
$TTL 86400
@ IN SOA ns.peterworld.pe.kr.
root.peterworld.pe.kr. (
1997022700 ;
Serial
28800 ;
Refresh
14400 ;
Retry
3600000 ;
Expire
86400 ;
Minimum
)
;Name Server
IN NS ns.peterworld.pe.kr.
IN MX 10 peterworld.pe.kr.
;Host name & Informations
localhost IN A 127.0.01
@ IN A 111.222.333.444
ns IN A 111.222.333.444
IN HINFO “i686 Pentium” “Linux”
;
www IN A 111.222.333.444
* IN A 111.222.333.444
7./var/named/zone-333.222.111
$TTL 86400
@ IN SOA ns.peterworld.pe.kr.
root.peterworld.pe.kr. (
1997022700 ;
Serial
28800 ;
Refresh
14400 ;
Retry
3600000 ;
Expire
86400 ;
Minimum
)
;Name Server
IN NS ns.peterworld.pe.kr.
444 IN PTR peterworld.pe.kr.
8./usr/local/apache/conf/httpd.conf 수정
ServerName peterworld.pe.kr
ServerRoot root at
peterworld.pe.kr
==>아파치 재 가동 하세요.
[3.sendmail 설정]
1.qpopper설치(ftp.qualcomm.com/eudora/servers/unix/popper)
==>qpopper을 /usr/local/src 에 갖다 둡니다.
src>#tar xvzf qpopper3.1.2.tar.gz
src>#cd qpopper
qpopper>#./configure –enable-specialauth\\
–enable-bulletins=/var/spool/mail\\
–enable-servermode
qpopper>#make
qpopper>#cp popper/popper /usr/local/lib
/etc/services 파일을 아래와 같이 수정합니다.
#pop-2 109/tcp postoffice # POP version 2
#pop-2 109/udp
#pop-3 110/tcp #POP version 3
#pop-3 110/udp
pop3 110/tcp #popper
/etc/mail/access 파일을 아래와 같이 수정합니다.
localhost.localdomain RELAY
localhost RELAY
peterworld.pe.kr OK
111.222 RELAY
==>수정하고 난뒤 아래의 명령을 내려주십시오.
#makemap hash /etc/mail/access < /etc/mail/access
/etc/mail/virtusertable 아래와 같이 수정합니다.
webmaster at
peterworld.pe.kr peter
==>수정하고 난뒤 아래의 명령을 내려주십시오.
#makemap hash /etc/mail/virtusertable
< /etc/mail/virtusertable
/etc/mail/sendmail.mc
#DAEMON_OPTIONS(‘Port=smtp, Addr=127.0.0.1, Name=MTA’) <==주석
처리 한후 아래의 명령을 내려 주세요.
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
/etc/sendmail.cf 아래의 부분들을 찾아 수정 및 주석처리
#SMTP DaemonOptions
O DaemonPortOptions=Name=MTA
O DaemonPortOptions=Port=587, Name=MSA, M=E
<==위의 두줄 추가
#R$ $#error $@5.7.1 $:”550 Realying denied”
<==주석처리
/etc/hosts.allow
ALL : ALL
<===테스트를 위해 일단 모두 열어 둡니다…난중에 알아서 설정하세요.
[3.sendmail 설정]
1.qpopper설치(ftp.qualcomm.com/eudora/servers/unix/popper)
==>qpopper을 /usr/local/src 에 갖다 둡니다.
src>#tar xvzf qpopper3.1.2.tar.gz
src>#cd qpopper
qpopper>#./configure –enable-specialauth\\
–enable-bulletins=/var/spool/mail\\
–enable-servermode
qpopper>#make
qpopper>#cp popper/popper /usr/local/lib
/etc/services 파일을 아래와 같이 수정합니다.
#pop-2 109/tcp postoffice # POP version 2
#pop-2 109/udp
#pop-3 110/tcp #POP version 3
#pop-3 110/udp
pop3 110/tcp #popper
/etc/mail/access 파일을 아래와 같이 수정합니다.
localhost.localdomain RELAY
localhost RELAY
peterworld.pe.kr OK
111.222 RELAY
==>수정하고 난뒤 아래의 명령을 내려주십시오.
#makemap hash /etc/mail/access < /etc/mail/access
/etc/mail/virtusertable 아래와 같이 수정합니다.
webmaster at
peterworld.pe.kr peter
==>수정하고 난뒤 아래의 명령을 내려주십시오.
#makemap hash /etc/mail/virtusertable
< /etc/mail/virtusertable
/etc/mail/sendmail.mc
#DAEMON_OPTIONS(‘Port=smtp, Addr=127.0.0.1, Name=MTA’) <==주석
처리 한후 아래의 명령을 내려 주세요.
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
/etc/sendmail.cf 아래의 부분들을 찾아 수정 및 주석처리
#SMTP DaemonOptions
O DaemonPortOptions=Name=MTA
O DaemonPortOptions=Port=587, Name=MSA, M=E
<==위의 두줄 추가
#R$ $#error $@5.7.1 $:”550 Realying denied”
<==주석처리
/etc/hosts.allow
ALL : ALL
<===테스트를 위해 일단 모두 열어 둡니다…난중에 알아서 설정하세요.
/etc/xinetd.d/ipop3 <==아래처럼 수정
service pop3
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += USERID
log_on_failure += USERID
disable = no
}
/etc/xinetd.d/pop-3 <==pop-3화일을 만들어 아래와 같이 적어 줍니다.
service pop-3
{
socket_type = stream
protocol = tcp
wait = nowait
user = root
server = /usr/local/lib/popper
server_args = popper -s
}
/etc/rc.d/init.d/ipchains stop
/etc/rc.d/init.d/iptables stop
/etc/rc.d/init.d/xinetd restart
/etc/rc.d/init.d/sendmail start
/etc/rc.d/init.d/named start
해주시고 확인해 보세요…