在Apache服务器上基于不同IP地址架设两个WEB网站

 

修改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

重新启动服务;

进行验证。

重启服务并验证。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值