实验:搭建一个基于http://www.zuoye.com或者http://wwww.zuoye.com访问的web网站,网站首页在/www/zuoye/,该web服务器的域名由ns.zuoye.com域名解析服务器解析。
systemctl stop firewalld
setenforce 0
mkdir /www/zuoye/ -p
echo this is www.zuoye.com > /www/zuoye/index.html
yum install -y httpd
yum install -y bind
编辑配置文件
编辑配置文件:vim /etc/httpd/conf.d/host.conf:
<VirtualHost 192.168.183.128:80>
DocumentRoot “/www/zuoye”
ServerName www.zuoye.com
<Directory /www/zuoye>
AllowOverride none
Require all granted
重启服务 systemctl restart httpd
编辑配置文件 vim /etc/named.conf1(复制/etc/named.conf -a 得到的)
options {
listen-on port 53 { 192.168.183.128; };
directory “/var/named”;
};
zone “zuoye.com” IN {
type master;
file “named.zuoye.com”;
};
vim /var/named/named.zuoye.com
$TTL 1D
@ IN SOA @ admain.zuoye.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns.zuoye.com.
A 192.168.183.128
ns A 192.168.183.128
www A 192.168.183.128
wwww CNAM www
重启服务systemctl restart named
用host www.zuoye.com 或者dig -t www.zuoye.com
nslookup www.zuoye.com 测试
curl 192.168.183.128