========================================================================
DNS-LAB6> 아래 조건에 해당하는 네임서버와 가상호스트 세팅하기!!
============ 조건 ==================
IP : 192.168.56.200
도메인명 : mbc.com, www.mbc.com
시스템 사용자 : mbcuser
DocumentRoot : /home/mbcuser/public_html
index.html 내용 : Welcome to mbc.com
도메인명 : kbs.com,www.kbs.com
시스템 사용자 : kbsuser
DocumentRoot : /home/kbsmbcuser/public_html
index.html 내용 : Welcome to kbs.com
도메인명 : sbs.com,www.sbs.com
시스템 사용자 : sbsuser
DocumentRoot : /home/sbsuser/public_html
index.html 내용 : Welcome to sbs.com
도메인명 : ytn.com, www.ytn.com
시스템 사용자 : ytnuser
DocumentRoot : /home/ytnuser/public_html
index.html 내용 : Welcome to ytn.com
============ 조건 ==================
-- 전체 작업 순서 --
1. DNS 작업
2. WEB 작업
-- 전체 작업 순서 --
-- WEB 작업 순서 --
1. 사용자 생성
2. 사용자 디렉토리의 권한 변경
3. index.html 생성
4. 가상호스트 설정
5. 웹서버 재시작
6. 확인
-- WEB 작업 순서 --
# for i in sbs kbs mbc ytn
> do
> dig @localhost ${i}.com +short
> dig @localhost www.${i}.com +short
> done
192.168.56.200
192.168.56.200
192.168.56.200
192.168.56.200
192.168.56.200
192.168.56.200
192.168.56.200
192.168.56.200
1. 사용자 생성
# useradd sbsuser
# passwd sbsuser
# useradd kbsuser
# passwd kbsuser
# useradd mbcuser
# passwd mbcuser
# useradd ytnuser
# passwd ytnuser
2. 사용자 디렉토리의 권한 변경
# chmod 711 /home/sbsuser
# chmod 711 /home/kbsuser
# chmod 711 /home/mbcuser
# chmod 711 /home/ytnuser
3. index.html 생성
# install -m 644 -o sbsuser -g sbsuser /dev/null ~sbsuser/public_html/index.html
# touch ~kbsuser/public_html/index.html
# chown kbsuser.kbsuser ~kbsuser/public_html/index.html
# install -m 644 -o mbcuser -g mbcuser /dev/null ~mbcuser/public_html/index.html
# install -m 644 -o ytnuser -g ytnuser /dev/null ~ytnuser/public_html/index.html
# echo 'Welcome to sbs.com' > ~sbsuser/public_html/index.html
# echo 'Welcome to kbs.com' > ~kbsuser/public_html/index.html
# echo 'Welcome to mbc.com' > ~mbcuser/public_html/index.html
# echo 'Welcome to ytn.com' > ~ytnuser/public_html/index.html
- Directory 권한 : 711
- index.html 권한 : 644
# ls -ld /home/*user
# ls -ld /home/*user/public_html
# ls -ld /home/*user/public_html/index.html
4. 가상호스트 설정
- /home/*/public_html 디렉토리의 접근권한을 허용한다.
- 가상호스트에 관련된 모듈의 주석을 제거한다.
- 가상호스트에 관련된 include 지사자의 주석을 제거한다.
# vi /usr/local/apache/conf/httpd.conf
-- /usr/local/apache/conf/httpd.conf --
<Directory /home/*/public_html>
AllowOverride none
Require all granted
</Directory>
:
LoadModule vhost_alias_module modules/mod_vhost_alias.so
:
Include conf/extra/httpd-vhosts.conf
:
-- /usr/local/apache/conf/httpd.conf --
- 가상호스트를 설정한다.
# vi /usr/local/apache/conf/extra/httpd-vhosts.conf
-- /usr/local/apache/conf/extra/httpd-vhosts.conf --
<VirtualHost *:80>
ServerAdmin webmaster@sbs.com
DocumentRoot /home/sbsuser/public_html
ServerName sbs.com
ServerAlias www.sbs.com
ErrorLog logs/sbs.com-error_log
CustomLog logs/sbs.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@kbs.com
DocumentRoot /home/kbsuser/public_html
ServerName kbs.com
ServerAlias www.kbs.com
ErrorLog logs/kbs.com-error_log
CustomLog logs/kbs.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@mbc.com
DocumentRoot /home/mbcuser/public_html
ServerName mbc.com
ServerAlias www.mbc.com
ErrorLog logs/mbc.com-error_log
CustomLog logs/mbc.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@ytn.com
DocumentRoot /home/ytnuser/public_html
ServerName ytn.com
ServerAlias www.ytn.com
ErrorLog logs/ytn.com-error_log
CustomLog logs/ytn.com-access_log common
</VirtualHost>
-- /usr/local/apache/conf/extra/httpd-vhosts.conf --
5. 웹서버 재시작
# apachectl configtest
Syntax OK
# apachectl restart
# httpd -S
6. 확인
- localhost 확인 (Guest OS)
# yum -y install lynx
# vi /etc/resolv.conf
-- /etc/resolv.conf --
nameserver 127.0.0.1
-- /etc/resolv.conf --
# lynx --dump sbs.com
# lynx --dump www.sbs.com
# lynx --dump kbs.com
# lynx --dump www.kbs.com
# lynx --dump mbc.com
# lynx --dump www.mbc.com
# lynx --dump ytn.com
# lynx --dump www.ytn.com
- remote 확인 (Host OS)
네트워크 -> 네임서버를 192.168.56.200 (리눅스 네임서버 IP) 으로 수정!
웹브라우저로 확인한다.
========================================================================
========================================================================
DNS-LAB6> 아래 조건에 해당하는 네임서버와 가상호스트 세팅하기!!
--> 해보길..
============ 조건 ==================
-- DNS 세팅 --
도메인명 : kbstar.com
IP 주소 : 192.168.56.200
forward zone file : kbstar.com.zone
호스트명 : www.kbstar.com 192.168.56.200
-- WEB 세팅 --
도메인명 : kbstar.com, www.kbstar.com
시스템 사용자 : kbstar
DocumentRoot : /home/kbstar/public_html
index.html 내용 : Welcome to kbstar.com
-- DNS 작업 순서 --
1. 설정파일에 도메인 영역 추가
2. forward zone 파일 생성
3. 심볼릭 링크생성
4. 네임서버 설정 확인
5. 네임서버 재시작
6. 확인
-- DNS 작업 순서 --
-- WEB 작업 순서 --
1. 사용자를 생성
2. 사용자 디렉토리의 권한을 변경
3. index.html 생성
4. 웹 설정파일에서 가상호스트를 세팅
5. 아파치 재시작
6. 확인
-- WEB 작업 순서 --
-- DNS 작업 순서 --
1. 설정파일에 도메인 영역 추가
# vi /etc/named.rfc1912
-- /etc/named.rfc1912 --
:
:
zone "kbstar.com" IN {
type master;
file "kbstar.com.zone";
allow-update { none; };
};
-- /etc/named.rfc1912 --
2. forward zone 파일 생성
# cd /var/named/chroot/var/named
# cp -a sbs.com.zone kbstar.com.zone
# vi kbstart.com.zone
-- kbstart.com.zone --
$TTL 60
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS @
IN A 192.168.56.200
www IN A 192.168.56.200
-- kbstart.com.zone --
3. 심볼릭 링크생성
# ln -s /var/named/chroot/var/named/kbstar.com.zone /var/named
4. 네임서버 설정 확인
# named-checkconf /etc/named.rfc1912.zones
# named-checkzone kbstar.com kbstar.com.zone
zone kbstar.com/IN: loaded serial 42
OK
5. 네임서버 재시작
# /etc/init.d/named restart
6. 확인
# dig kbstar.com +short
192.168.56.200 <--
# nslookup kbstar.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: kbstar.com
Address: 192.168.56.200 <--
# host kbstar.com
kbstar.com has address 192.168.56.200 <--
-- WEB 작업 순서 --
1. 사용자를 생성
# useradd kbstar
2. 사용자 디렉토리의 권한을 변경
# chmod 711 /home/kbstar
3. index.html 생성
# echo "Welcome to kbstar.com" > /home/kbstar/public_html/index.html
4. 웹 설정파일에서 가상호스트를 세팅
# vi /usr/local/apache/conf/httpd.conf
-- /usr/local/apache/conf/httpd.conf --
:
:
<VirtualHost *:80>
DocumentRoot /home/kbstar/public_html
ServerName kbstar.com
ServerAlias www.kbstar.com
</VirtualHost>
-- /usr/local/apache/conf/httpd.conf --
5. 아파치 재시작
# apachectl configtest
# apachectl restart
6. 확인
- local 확인
# lynx --dump kbstar.com
Welcome to kbstar.com
# lynx --dump www.kbstar.com
Welcome to kbstar.com
- remote 확인
cmd -> ipconfig/flushdns
========================================================================
========================================================================
DNS-LAB5> 아래 조건에 해당하는 도메인명에 대한 네임서버 세팅하기!!
--> 해보길..
!!! 리눅스에서 IP를 여러개 잡는 방법 !!!
!!! 형식 : ifconfig eth1:숫자 IP주소 !!!
!!! # ifconfig eth1:2 192.168.56.101 !!!
!!! # ifconfig eth1:3 192.168.56.103 !!!
-- 작업 조건 --
리눅스 IP : 192.168.56.101, 192.168.56.102, 192.168.56.103
forward zone file : kbs.com_zone
도메인명 : kbs.com 192.168.56.103
호스트명 : www.kbs.com 192.168.56.103
호스트명 : db.kbs.com 192.168.56.101
forward zone file : mbc.com_zone
도메인명 : mbc.com 192.168.56.102
호스트명 : www.mbc.com 192.168.56.102
호스트명 : db.mbc.com 192.168.56.101
호스트명 : bbs.mbc.com 192.168.56.103
-- 작업 조건 --
-- 작업 순서 --
1. 설정파일에 도메인 영역 추가
2. forward zone 파일 생성
3. 심볼릭 링크생성
4. 네임서버 재시작
5. 확인
-- 작업 순서 --
1. 설정파일에 도메인 영역 추가
# vi /etc/named.rfc1912.zones
-- /etc/named.rfc1912.zones --
:
:
zone "kbs.com" IN {
type master;
file "kbs.com_zone";
allow-update { none; };
};
zone "mbc.com" IN {
type master;
file "mbc.com_zone";
allow-update { none; };
};
-- /etc/named.rfc1912.zones --
2. forward zone 파일 생성
# cd /var/named/chroot/var/named
# cp -a localhost.zone kbs.com_zone
# vi kbs.com_zone
-- kbs.com_zone --
$TTL 60
@ IN SOA ns1 root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns1
IN A 192.168.56.103
www IN A 192.168.56.103
db IN A 192.168.56.101
-- kbs.com_zone --
# cp -a localhost.zone mbc.com_zone
# vi mbc.com_zone
-- mbc.com_zone --
$TTL 60
@ IN SOA ns1 root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ns1
IN A 192.168.56.102
www IN A 192.168.56.102
db IN A 192.168.56.101
bbs IN A 192.168.56.103
-- mbc.com_zone --
3. 심볼릭 링크생성
# ln -s /var/named/chroot/var/named/kbs.com_zone /var/named
# ln -s /var/named/chroot/var/named/mbc.com_zone /var/named
# ls -l /var/named/chroot/var/named/{mbc,kbs,sbs}.com_zone <-- 권한 확인
-rw-r----- 1 root named 223 Jul 17 12:24 kbs.com_zone
-rw-r----- 1 root named 249 Jul 17 12:25 mbc.com_zone
-rw-r----- 1 root named 300 Jul 17 12:24 sbs.com_zone
4. 네임서버 재시작
# /etc/init.d/named restart
# netstat -nltup <-- 네임서버 데몬 확인
5. 확인
# dig @localhost kbs.com +short <-- 192.168.56.103
# dig @localhost www.kbs.com +short <-- 192.168.56.103
# dig @localhost db.kbs.com +short <-- 192.168.56.101
# dig @localhost mbc.com +short <-- 192.168.56.102
# dig @localhost www.mbc.com +short <-- 192.168.56.102
# dig @localhost db.mbc.com +short <-- 192.168.56.101
# dig @localhost bbs.mbc.com +short <-- 192.168.56.103
========================================================================
========================================================================
DNS-LAB5> zone transfer 를 이용한 zone 파일 확인
# cat /var/named/sbs.com.zone
-- /var/named/sbs.com.zone --
$TTL 60
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS @
www IN A 192.168.56.200
IN A 192.168.56.180
test.sbs.com IN A 192.168.56.254
admin IN A 192.168.56.201
file IN A 192.168.56.202
data IN A 192.168.56.203
db IN A 192.168.56.204
-- /var/named/sbs.com.zone --
- 192.168.56.180 과 test.sbs.com 이 어떻게 나오는지 확인
# dig sbs.com axfr
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5 <<>> sbs.com axfr
;; global options: printcmd
sbs.com. 60 IN SOA sbs.com. root.sbs.com. 42 10800 900 604800 86400
sbs.com. 60 IN NS sbs.com.
admin.sbs.com. 60 IN A 192.168.56.201
test.sbs.com.sbs.com. 60 IN A 192.168.56.254
data.sbs.com. 60 IN A 192.168.56.203
db.sbs.com. 60 IN A 192.168.56.204
file.sbs.com. 60 IN A 192.168.56.202
www.sbs.com. 60 IN A 192.168.56.180
www.sbs.com. 60 IN A 192.168.56.200
sbs.com. 60 IN SOA sbs.com. root.sbs.com. 42 10800 900 604800 86400
;; Query time: 2 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu May 15 03:14:51 2014
;; XFR size: 10 records (messages 1)
zone 파일에 대한 여러 정보가 나타난다
보안상 zone transfer 기능을 막는게 좋다
아니면 특정 사람에게만 zone transfer가
허용되도록 설정하면 된다
========================================================================
========================================================================
DNS-LAB5> 도메인을 위임해보자.
nameserver 1 : 192.168.56.200
nameserver 2 : 192.168.56.210
nameserver1# ifconfig eth1:1 192.168.56.200
nameserver2# ifconfig eth1:1 192.168.56.210
-- 순서 --
1. nameserver1 도메인 위임을 설정
2. nameserver2 nameserver를 구축
3. nameserver2 해당 도메인을 설정
4. 확인
1. nameserver1 도메인 위임을 설정
nameserver1# vi /var/named/sbs.com.zone
-- /var/named/sbs.com.zone --
$TTL 60
@ IN SOA @ root ( 42 3H 15M 1W 1D )
IN NS ns
IN A 192.168.56.200
ns IN A 192.168.56.200
www IN A 192.168.56.200
ns20 IN NS ns.ns20
ns30 IN NS ns.ns30
ns.ns20 IN A 192.168.56.210
ns.ns30 IN A 192.168.56.210
-- /var/named/sbs.com.zone --
nameserver1# /etc/init.d/named restart
2. nameserver2 nameserver를 구축
nameserver2# yum -y groupinstall "DNS name server"
nameserver2# yum -y install caching-nameserver
nameserver2# vi /etc/named.caching-nameserver.conf
-- /etc/named.caching-nameserver.conf --
:
:
listen-on port 53 { any; };
//listen-on-v6 port 53 { ::1; };
allow-query { any; };
allow-query-cache { any; };
match-clients { any; };
match-destinations { any; };
:
:
-- /etc/named.caching-nameserver.conf --
3. nameserver2 해당 도메인을 설정
nameserver2# vi /etc/named.rfc1912.zones
-- /etc/named.rfc1912.zones --
:
:
zone "ns20.sbs.com" IN {
type master;
file "ns20.sbs.com.zone";
allow-update { none; };
};
zone "ns30.sbs.com" IN {
type master;
file "ns30.sbs.com.zone";
allow-update { none; };
};
-- /etc/named.rfc1912.zones --
nameserver2# cd /var/named/chroot/var/named
nameserver2# cp -a localhost.zone ns20.sbs.com.zone
nameserver2# vi ns20.sbs.com.zone
-- ns20.sbs.com.zone --
$TTL 60
@ IN SOA @ root ( 42 3H 15M 1W 1D )
IN NS ns
IN A 192.168.56.210
www IN A 192.168.56.210
-- ns20.sbs.com.zone --
nameserver2# cp -a ns20.sbs.com.zone ns30.sbs.com.zone
nameserver2# vi ns30.sbs.com.zone
-- ns30.sbs.com.zone --
$TTL 60
@ IN SOA @ root ( 42 3H 15M 1W 1D )
IN NS ns
IN A 192.168.56.210
www IN A 192.168.56.210
-- ns30.sbs.com.zone --
nameserver2# ln -s /var/named/chroot/var/named/ns20.sbs.com.zone /var/named/
nameserver2# ln -s /var/named/chroot/var/named/ns30.sbs.com.zone /var/named/
nameserver2# /etc/init.d/named restart
4. 확인
nameserver2# vi /etc/resolv.conf
-- /etc/resolv.conf --
nameserver 127.0.0.1
-- /etc/resolv.conf --
nameserver1# dig @192.168.56.210 ns20.sbs.com +short
192.168.56.210
nameserver1# dig @192.168.56.210 www.ns20.sbs.com +short
192.168.56.210
nameserver2# dig ns20.sbs.com +short
192.168.56.210
nameserver2# dig www.ns20.sbs.com +short
192.168.56.210
1번 네임 서버의 ns20.sbs.com 이 IN NS ns.ns20 으로 되어있다
그리고 ns.ns20의 주소는 2번 네임 서버의 주소로 되어있다.
ns20.sbs.com의 sbs.com을 보고 1번 네임 서버로 와서 ns20을 찾으면 2번 네임서버가 알고 있다고
거기 가보라고함
그럼 2번 네임 서버는 그걸 받아서 ns20.sbs.com / www.ns20.sbs.com 의 IP주소 알려줌
========================================================================
========================================================================
DNS-LAB5> com 도메인을 구축해보자.
--> 해보길..
cnn : ns.cnn.com 192.168.56.200
bbc : ns.bbc.com 192.168.56.210
:
:
nameserver 1 : 192.168.56.200
nameserver 2 : 192.168.56.210
nameserver1# ifconfig eth1:1 192.168.56.200
nameserver2# ifconfig eth1:1 192.168.56.210
-- com DNS 작업 순서 --
1. 설정파일에 도메인 영역 추가
2. forward zone 파일 생성
3. 심볼릭 링크생성
4. 네임서버 설정 확인
5. 네임서버 재시작
6. 확인
-- com DNS 작업 순서 --
-- cnn,bbc DNS 작업 순서 --
1. 설정파일에 도메인 영역 추가
2. forward zone 파일 생성
3. 심볼릭 링크생성
4. 네임서버 설정 확인
5. 네임서버 재시작
-- cnn,bbc 작업 순서 --
-- com DNS 작업 순서 --
1. 설정파일에 도메인 영역 추가
nameserver1# vi /etc/named.rfc1912.zones
-- /etc/named.rfc1912.zones --
:
:
zone "com" IN {
type master;
file "com.zone";
allow-update { none; };
};
-- /etc/named.rfc1912.zones --
2. forward zone 파일 생성
nameserver1# cd /var/named/chroot/var/named
nameserver1# vi com.zone
-- com.zone --
$TTL 60
@ IN SOA @ root ( 42 3H 15M 1W 1D )
IN NS ns
ns IN A 192.168.56.200
cnn IN NS ns.cnn
ns.cnn IN A 192.168.56.200
bbc IN NS ns.bbc
ns.bbc IN A 192.168.56.210
-- com.zone --
3. 심볼릭 링크생성
nameserver1# ln -s /var/named/chroot/var/named/com.zone /var/named/
4. 네임서버 설정 확인
nameserver1# named-checkconf /etc/named.rfc1912.zones
nameserver1# named-checkzone com com.zone
zone com/IN: loaded serial 42
OK
5. 네임서버 재시작
nameserver1# /etc/init.d/named restart
-- com DNS 작업 순서 끝 --
-- bbc DNS 작업 순서 --
1. 설정파일에 도메인 영역 추가
nameserver2# vi /etc/named.rfc1912.zones
-- /etc/named.rfc1912.zones --
:
:
zone "bbc.com" IN {
type master;
file "bbc.com.zone";
allow-update { none; };
};
-- /etc/named.rfc1912.zones --
2. forward zone 파일 생성
nameserver2# cd /var/named/chroot/var/named
nameserver2# vi bbc.com.zone
-- bbc.com.zone --
$TTL 60
@ IN SOA @ root ( 42 3H 15M 1W 1D )
IN NS ns
IN A 192.168.56.210
www IN A 192.168.56.210
-- bbc.com.zone --
3. 심볼릭 링크생성
nameserver2# ln -s /var/named/chroot/var/named/bbc.com.zone /var/named/
4. 네임서버 설정 확인
nameserver2# named-checkconf /etc/named.rfc1912.zones
nameserver2# named-checkzone bbc.com bbc.com.zone
zone com/IN: loaded serial 42
OK
5. 네임서버 재시작
nameserver2# /etc/init.d/named restart
6. 확인
nameserver1# dig bbc.com
nameserver1# dig bbc.com ns
nameserver1# dig www.bbc.com
nameserver2# dig bbc.com
nameserver2# dig bbc.com ns
nameserver2# dig www.bbc.com
-- bbc 작업 순서 끝 --
cnn 도 설정해서 완료하시오.
========================================================================
========================================================================
DNS-LAB> 리버스존을 만들어보자.
nameserver2# vi /etc/named.rfc1912.zones
-- /etc/named.rfc1912.zones --
:
:
zone "56.168.192.in-addr.arpa" IN {
type master;
file "bbc.com.rev";
allow-update { none; };
};
-- /etc/named.rfc1912.zones --
nameserver2# cd /var/named/chroot/var/named
nameserver2# cp -a named.local bbc.com.rev
nameserver2# vi bbc.com.rev
-- bbc.com.rev --
$TTL 60
@ IN SOA @ root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns
210 IN PTR ns
210 IN PTR www
210 IN PTR bbc.com.
-- bbc.com.rev --
nameserver2# ln -s /var/named/chroot/var/named/bbc.com.rev /var/named/bbc.com.rev
nameserver2# /etc/init.d/named restart
nameserver2# dig -x 192.168.56.210 +short
bbc.com.
www.56.168.192.in-addr.arpa.
ns.56.168.192.in-addr.arpa.
========================================================================
========================================================================
DNS-LAB5> 아래 조건에 해!!!
!!! 리눅스에서 IP를 여러개 잡는 방법 !!!
!!! 형식 : ifconfig eth1:숫자 IP주소 !!!
!!! VB1# ifconfig eth1:2 192.168.0.102 !!!
!!! VB1# ifconfig eth1:3 192.168.0.103 !!!
!!! VB2# ifconfig eth1 192.168.0.104 !!!
1번 서버 VB1
2번 서버 VB2
-- 작업 조건 --
VB #1 리눅스 IP : 192.168.0.101, 192.168.0.102, 192.168.0.103
VB #2 리눅스 IP : 192.168.0.104
도메인명 : kbs.com (VB #1 리눅스)
호스트명 : www.kbs.com (VB #1 리눅스)
호스트명 : db.kbs.com (VB #2 리눅스)
도메인명 : mbc.com (VB #1 리눅스)
호스트명 : www.mbc.com (VB #1 리눅스)
호스트명 : db.mbc.com (VB #2 리눅스)
호스트명 : bbs.mbc.com (VB #2 리눅스)
- VB #1 작업 -
1. 사용자 생성
# useradd kbsuser
# chmod 701 ~kbsuser
# vi ~kbsuser/public_html/index.html
-- ~kbsuser/public_html/index.html --
Welcome to kbs.com !
-- ~kbsuser/public_html/index.html --
2. 아파치 가상호스트 세팅
# vi /usr/local/apache/conf/httpd.conf
-- /usr/local/apache/conf/httpd.conf --
:
:
<VirtualHost *:80>
ServerAdmin webmaster@kbs.com
DocumentRoot /home/kbsuser/public_html
ServerName kbs.com
ServerAlias www.kbs.com
ErrorLog logs/kbs.com-error_log
CustomLog logs/kbs.com-access_log common
</VirtualHost>
-- /usr/local/apache/conf/httpd.conf --
# apachectl configtest
Syntax OK
# apachectl restart
# vi ~kbsuser/public_html/index.html
-- ~kbsuser/public_html/index.html --
Welcome to kbs.com !
<iframe frameborder=0 src=http://192.168.56.104:8000 width=100% height=100%>
-- ~kbsuser/public_html/index.html --
- VB #2 작업 -
# setup
<-- selinux Disabled
# yum -y groupinstall "Web server"
# vi /etc/httpd/conf/httpd.conf
:
:
Listen 8000 <-- 134 번 라인
# apachectl configtest
Syntax OK
# apachectl start
# netstat -nlt <-- 8000 번 포트 확인
:
:
tcp 0 0 :::8000 :::* LISTEN 2990/httpd
========================================================================
========================================================================
DNS-LAB> 2차 네임서버를 구축해보자.
1차 네임서버 IP : 192.168.56.200
2차 네임서버 IP : 192.168.56.210
-- 순서 --
1. 1차 네임서버 설정
2. 2차 네임서버 설정
1. 1차 네임서버 설정
- zone transfer 를 허용할 IP를 지정한다
DNS1(56.200) # vi /etc/named.caching-nameserver.conf
-- /etc/named.caching-nameserver.conf --
options {
:
:
allow-transfer { 192.168.56.210 ; };
}
-- /etc/named.caching-nameserver.conf --
2. 2차 네임서버 설정
- 1차 네임서버의 IP를 설정한다.
DNS2(56.210) # vi /etc/named.rfc1912.zones
-- /etc/named.rfc1912.zones --
zone "sbs.com" IN {
type slave;
file "slaves/sbs.com.zone";
masters { 192.168.56.200; };};
zone "kbs.com" IN {
type slave;
file "slaves/kbs.com.zone";
masters { 192.168.56.200; };
};
zone "mbc.com" IN {
type slave;
file "slaves/mbc.com.zone";
masters { 192.168.56.200; };
};
-- /etc/named.rfc1912.zones --
DNS2(56.210) # /etc/init.d/named restart
DNS2(56.210) # ls -l /var/named/chroot/var/named/slaves
total 12
-rw-r--r-- 1 named named 313 May 15 08:32 kbs.com.zone
-rw-r--r-- 1 named named 361 May 15 08:32 mbc.com.zone
-rw-r--r-- 1 named named 496 May 15 08:32 sbs.com.zone
DNS2(56.210) # cat /var/named/chroot/var/named/slaves/kbs.com.zone
$ORIGIN .
$TTL 60 ; 1 minute
kbs.com IN SOA kbs.com. root.kbs.com. (
42 ; serial
10800 ; refresh (3 hours)
900 ; retry (15 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS kbs.com.
A 192.168.56.200
$ORIGIN kbs.com.
www A 192.168.56.200
========================================================================