web主机配置
1关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
vim /etc/selinux/config
2安装nginx
yum -y install nginx
rpm -ql nginx //检查是否安装成功
3写入测试页面
echo "我是马启萍,给我打钱" > /usr/share/nginx/html/index.html
nginx //启动服务
4测试
客户端访问
curl 192.168.81.17(web地址)
dns主机配置
1关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
vim /etc/selinux/config
2下载安装包
yum -y install bind
rpm -ql bind //查看是否安装成功
systemctl start named //开启服务
3备份文件
cp /etc/named.conf /etc/named.conf.bak
cp /etc/named.rfc1912.zones /etc/named.rfc1912.zones.bak
4配置文件
vim /etc/named.conf
vim /etc/named.rfc1912.zones
cd /var/named/
cp -p named.localhost mqp.hh.zone
vim mqp.hh.zone
5检查
named-checkconf /etc/named.conf
named-checkconf /etc/named.rfc1912.zones
named-checkzone mqp.hh.zone mqp.hh.zone
6重启服务
systemctl restart named
7测试
客户端访问
echo "nameserver 192.168.81.15(dns服务器地址)" > /etc/resolv.conf
ping www.mqp.hh
curl www.mqp.hh