[root@ns1 /]# yum install httpd* -y
[root@ns1 /]# vim /var/www/html/index.html
This is my web server[root@ns1 /]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@ns1 /]# vim /var/named/chroot/var/named/tsbd.fz
www IN CNAME ns1.tsbd.com.
[root@ns1 home]# /etc/init.d/named restart
Stopping named: . [ OK ]
Starting named: [ OK ]
[root@ns1 /]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@ns1 ~]# cd /var/www/html/
[root@ns1 html]# ls
index.html squint
[root@ns1 html]# mkdir tsbd
[root@ns1 html]# ls
tsbd index.html squint
[root@ns1 html]# cd tsbd/
[root@ns1 cric]# vim index.html
Test Server
[root@ns1 cric]# vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.50.20:80
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
<VirtualHost www.tsbd.com:80>
ServerAdmin webmaster@www.tsbd.com
DocumentRoot /var/www/html/tsbd
ServerName www.tsbd.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
[root@ns1 html]# vim /var/named/chroot/var/named/tsbd.fz
www IN CNAME ns1.tsbd.com.
[root@ns1 ~]# vim /var/named/chroot/etc/named.conf
zone "chsaiful.com" IN {type master;
file "chsaiful.fz";
allow-update { none; };
};
[root@ns1 ~]# cp /var/named/chroot/var/named/abcd.fz chsaiful.fz
[root@ns1 html]# cd /var/www/html/
[root@ns1 html]# ls
index.html squint tsbd
[root@ns1 html]# mkdir chsaiful
[root@ns1 html]# ls
chsaiful index.html squint tsbd
[root@ns1 html]# cd chsaiful/
[root@ns1 chsaiful]# vim index.html
HELLO THIS IS VIRTUAL HOSTING
[root@ns1 cric]# vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.50.20:80
<VirtualHost www.chsaiful.com:80>
ServerAdmin webmaster@ns1.chsaiful.com
DocumentRoot /var/www/html/chsaiful
ServerName www.chsaiful.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
[root@ns1 home]# /etc/init.d/named restart
Stopping named: . [ OK ]
Starting named: [ OK ]
[root@ns1 /]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
webmail IN CNAME mail.abcd.com.
20 IN PTR mail.abcd.com.
NameVirtualHost 192.168.50.20:80
<VirtualHost 192.168.50.20:80>
ServerAdmin webmaster@mail.abcd.com
DocumentRoot /usr/share/squirrelmail
ServerName 192.168.50.20
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
Webserver PC :
[root@mail chsaiful]# vim /etc/resolv.conf
nameserver 192.168.50.20
[root@mail chsaiful]# cd /var/www/html/
[root@mail html]# ll
total 16drwxr-xr-x 2 root root 4096 Dec 6 01:42 chsaiful
-rw-r--r-- 1 root root 189 Nov 21 12:27 robots.txtdrwxr-xr-x 2 root root 4096 Dec 6 00:42 tsmominul
drwxr-xr-x 2 root root 4096 Dec 6 00:44 tsrajan[root@ns1 cric]# vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.50.30:80
<VirtualHost www.tsmominul.com:80>
ServerAdmin webmaster@www.tsmominul.com
DocumentRoot /var/www/html/tsmominul
ServerName www.tsmominul.com
# ErrorLog logs/dummy-host.example.com-error_log# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost www.tsrajan.com:80>
ServerAdmin webmaster@www.tsrajan.com
DocumentRoot /var/www/html/tsrajan
ServerName www.tsrajan.com
# ErrorLog logs/dummy-host.example.com-error_log# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
[root@mail chsaiful]# /etc/init.d/httpd restartDNS Server Configuration for both webserver :
zone "tsmominul.com" IN {
type master;
file "tsmominul.fz";
allow-update { none; };
};
zone "tsrajan.com" IN {
type master;
file "tsrajan.fz";
allow-update { none; };
};
[root@ns1 named]# cp abcd.fz tsmominul.fz
[root@ns1 named]# cp abcd.fz tsrajan.fz
[root@ns1 named]# chgrp named tsmominul.fz
[root@ns1 named]# chgrp named tsrajan.fz
[root@ns1 named]# vim /var/named/chroot/var/named/abcd.fz
www IN A 192.168.50.30
www IN A 192.168.50.30
[root@ns1 named]# vim /var/named/chroot/var/named/abcd.rz
30 IN PTR www.tsmominul.com.
30 IN PTR www.tsrajan.com.
[root@ns1 named]# /etc/init.d/named restart