扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
[root@centos01 ~]# yum -y install bind bind-chroot bind-utils
[root@centos01 ~]# cp /etc/named.conf /etc/named.conf.bak
[root@centos01 ~]# echo "" > /etc/named.conf
options{
listen-on port 53 { any; };
directory "/var/named";
};
zone "benet.com" IN {
type master;
file "benet.com.zone";
allow-transfer { 192.168.100.20; };
};
zone "accp.com" IN {
type master;
file "accp.com.zone";
allow-transfer { 192.168.100.20; };
};
[root@centos01 ~]# named-checkconf -z /etc/named.conf
[root@centos01 ~]# vim /var/named/benet.com.zone
$TTL 86400
@ SOA benet.com. root.benet.com(
2020020910
1H
15M
1W
1D
)
@ NS centos01.benet.com.
NS centos02.benet.com.
centos01 A 192.168.100.10
centos02 A 192.168.100.20
ftp A 192.168.100.10
www A 192.168.100.10
[root@centos01 ~]# named-checkzone benet.com /var/named/benet.com.zone
zone benet.com/IN: loaded serial 2020020910
OK
[root@centos01 ~]# chmod 755 /var/named/benet.com.zone
[root@centos01 ~]# chown named:named /var/named/benet.com.zone
[root@centos01 ~]#cp /var/named/benet.com.zone /var/named/accp.com.zone
[root@centos01 ~]# vim /var/named/accp.com.zone
$TTL 86400
@ SOA accp.com. root.accp.com(
2020020910
1H
15M
1W
1D
)
@ NS centos01.accp.com.
NS centos02.accp.com.
centos01 A 192.168.100.10
ftp A 192.168.100.10
www A 192.168.100.10
[root@centos01 ~]# named-checkzone accp.com /var/named/accp.com.zone
zone accp.com/IN: loaded serial 2020020910
OK
[root@centos01 ~]# systemctl start named
[root@centos01 ~]# systemctl enable named
[root@centos01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens32
DNS1=192.168.100.20
DNS2=192.168.100.10
[root@centos01 ~]# systemctl restart network
[root@centos01 ~]# systemctl restart named
[root@centos02 ~]# yum -y install bind bind-chroot bind-utils
[root@centos02 ~]# cp /etc/named.conf /etc/named.conf.bak
[root@centos02 ~]# echo "" > /etc/named.conf
[root@centos02 ~]# vim /etc/named.conf
options {
listen-on port 53 { any; };
directory "/var/named";
};
zone "benet.com" IN {
type slave;
file "slaves/benet.com.zone";
masters { 192.168.100.10; };
};
zone "accp.com" IN {
type slave;
file "slaves/accp.com.zone";
masters { 192.168.100.10; };
};
[root@centos02 ~]# systemctl start named
[root@centos02 ~]# systemctl enable named
[root@centos02 ~]# cd /var/named/
[root@centos02 named]# ls
chroot data dynamic named.ca named.empty named.localhost named.loopback slaves
[root@centos02 named]# cd slaves/
[root@centos02 slaves]# ls
accp.com.zone benet.com.zone
[root@centos02 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens32
DNS1=192.168.100.10
DNS2=192.168.100.20
[root@centos02 ~]# systemctl restart network
[root@centos02 ~]# systemctl restart named
[root@centos01 ~]# nslookup ftp.benet.com
Server: 192.168.100.20
Address: 192.168.100.20#53
Name: ftp.benet.com
Address: 192.168.100.10
创新互联公司主营大冶网站建设的网络公司,主营网站建设方案,成都App制作,大冶h5重庆小程序开发公司搭建,大冶网站营销推广欢迎大冶等地区企业咨询
[root@centos02 ~]# nslookup ftp.accp.com
Server: 192.168.100.10
Address: 192.168.100.10#53
Name: ftp.accp.com
Address: 192.168.100.10
[root@centos01 ~]# tar zxvf /mnt/httpd-2.2.17.tar.gz -C /usr/src/
[root@centos01 ~]# cd /usr/src/httpd-2.2.17/
[root@centos01 httpd-2.2.17]# ./configure
--prefix=/usr/local/httpd
--enable-so --enable-rewrite
-enable-charset-lite
--enable-cgi
[root@centos01 httpd-2.2.17]# make && make install
[root@centos01 ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin/
[root@centos01 ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
[root@centos01 ~]# chmod +x /etc/init.d/httpd
[root@centos01 ~]# vim /etc/init.d/httpd
#chkconfig:35 80 20
[root@centos01 ~]# chkconfig --add httpd
[root@centos01 ~]# chkconfig --level 35 httpd on
[root@centos01 ~]# systemctl start httpd
[root@centos01 ~]# mkdir /var/www
[root@centos01 ~]# mkdir /var/www/benetcom
[root@centos01 ~]# mkdir /var/www/accpcom
[root@centos01 ~]# echo "www.benet.com" > /var/www/benetcom/index.html
[root@centos01 ~]# echo "www.accp.com" > /var/www/accpcom/index.html
[root@centos01 ~]# vim /usr/local/httpd/conf/httpd.conf
98 ServerName 192.168.100.10:80
389 Include conf/extra/httpd-vhosts.conf
[root@centos01 ~]# vim /usr/local/httpd/conf/extra/httpd-vhosts.conf
NameVirtualHost 192.168.100.10:80
Order allow,deny
allow from all
DocumentRoot "/var/www/benetcom/"
ServerName www.benet.com
CustomLog "logs/www.benet.com_access_log" common
DocumentRoot "/var/www/accpcom/"
ServerName www.accp.com
CustomLog "logs/www.accp.com_access_log" common
[root@centos01 ~]# systemctl restart httpd
[root@centos01 ~]# httpd -t
Syntax OK
—————— 本文至此结束,感谢阅读 ——————
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流