1、 一个 IP、一个域名、两个别名192.168.1.1 别名 、1 vi /etc/named.confZone”” IN Type master;File”newname1.db”2 cd /var/namedcp named.local newname1.db3 vi newname1.db$ TTL 86400 IN SOA . lz-2005101000 SerialIN ns .www IN A 192.168.1.1ooo IN CNAME www5 mkdir /www/html1mkdir /www/htm1vi /www/html1/index.html1111111111
2、11111111111111vi /www/htm1/index.html22222222222222226 service named restart7 host host host 8 vi etc/httpd/conf/httpd.conf #注:htpd.conf 要备份一份通过“/字符串”查找Listen 80ServerName NameVirtualHost 192.168.1.1DocumentRoot “/www/html1”ServerName DocumentRoot “/www/htm1”ServerName 9 httpd -t10 service httpd res
3、tart11 lynx lynx lynx 192.168.1.1lynx 192.168.1.2两个都是辅服务器第 8 步开始8 vi etc/httpd/conf/httpd.conf #注:htpd.conf 要备份一份通过“/字符串”查找Listen 80ServerName DocumentRoot “/www/html1”ServerName DocumentRoot “/www/htm1”ServerName 9 httpd -t10 service httpd restart11 lynx lynx lynx www.dog lynx 192.168.1.1lynx 192.1
4、68.1.2一个 IP、多个域名192.168.1.1 别名 另一域名 1 vi /etc/named.confZone”” IN Type master;File”newname1.db”Zone”” IN Type master;File”newname2.db”2 cd /var/namedcp named.local newname1.dbcp named.local newname2.db3 vi newname1.db$ TTL 86400 IN SOA . lz-2005101000 SerialIN ns .www IN A 192.168.1.1ooo IN CNAME
5、www4 vi newname2.db$ TTL 86400 IN SOA . lz-2005101000 SerialIN ns .www IN A 192.168.1.26 mkdir /www/html1mkdir /www/htm1vi /www/html1/index.html111111111111111111111111vi /www/htm1/index.html22222222222222226 service named restart7 host host host 8 vi etc/httpd/conf/httpd.conf #注:htpd.conf 要备份一份通过“/字符串”查找Listen 80DocumentRoot “/www/html1”ServerName DocumentRoot “/www/html1”ServerName DocumentRoot “/www/htm1”ServerName 12 httpd -t13 service httpd restart14 lynx lynx lynx www.dog lynx 192.168.1.1