修改DNS的配置文件;
[root@localhost named]# vi abc.com.zone
$TTL 86400
@ IN SOA dns.abc.com. root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns.abc.com.
IN A 10.123.34.119
dns IN A 10.123.34.119
www IN A 10.123.34.119
info IN A 10.123.34.119
sales IN A 10.123.34.219
:wq
修改Apache配置文件;
[root@localhost ~]# vi /etc/httpd/conf/httpd.conf
Alias /icons/ "/var/www/icons/"
Alias /info "/var/www/info/"
Alias /sales "/var/www/sales/"
NameVirtualHost 10.123.34.119
ServerName www.abc.com
<VirtualHost 10.123.34.219>
DocumentRoot /var/www/sales
ServerName sales.abc.com
</VirtualHost>
<VirtualHost 10.123.34.119>
DocumentRoot /var/www/info
ServerName info.abc.com
</VirtualHost>
新建相关网页;
[root@localhost www]# mkdir info
[root@localhost www]# mkdir sales
[root@localhost www]# vi info/index.html
this is a info website!!!!!!
p1
this is a info website!!!!!!1
this is a info website!!!!!!1
:wq
[root@localhost www]# vi sales/index.html
this is a sales website!!!
this is a sales website!!!
this is a sales website!!!
:wq
重新启动服务;
进行验证。
重启服务并验证。