#图右侧为做题前环境配置
#命令为红色
#命令加载内容为绿色
#vi编辑内容为蓝色
1、用户需把/dev/myvg/mylv逻辑卷以支持磁盘配额的方式挂载到网页目录下
[[email protected] ~]# vi /etc/fstab
/dev/myvg/mylv /usr/local/httpd/htdocs/ xfs defaults,usrquota,grpquota 0 0
[[email protected] ~]# mount -a
2、在网页目录下创建测试文件index.html,内容为用户名称,通过浏览器访问测试
[[email protected] ~]# cd /usr/local/httpd/htdocs/
[[email protected] htdocs]# vi index.html
3、创建用户账户,对LVM配置磁盘配额限制用户磁盘容量为软限制80M;硬限制100M、文件数量软限制为80个;硬限制为100个。
[[email protected] htdocs]# useradd laowang
[[email protected] htdocs]# passwd laowang
[[email protected] ~]# edquota -u laowang /dev/myvg/mylv
Disk quotas for user laowang (uid 1001):
Filesystem blocks soft hard inodes soft hard
/dev/mapper/myvg-mylv 0 81920 102400 0 80 100
[[email protected] ~]# quotaon -auvg
4、构建主从DNS域名解析环境
5、主从DNS都可将www.study.com域名解析为192.168.200.113
6、客户机可通过浏览器访问www.study.com得到WEB服务器相应内容
7、主域名服务器要同时担任缓存域名服务器功能
8、客户机通过nslookup域名测试工具可解析到www.jd.com等网站的域名解析结果
4、5、6、7、8结合在一起做了
主服务器加缓存服务器功能配置
[[email protected] ~]rpm -qa | grep -w bind
bind-libs-lite-9.9.4-50.el7.x86_64
bind-utils-9.9.4-50.el7.x86_64
]bind-license-9.9.4-50.el7.noarch
bind-libs-9.9.4-50.el7.x86_64
[[email protected] ~]# yum -y install bind
[[email protected] ~]# vi /etc/named.conf
options {
listen-on port 53 { 192.168.200.111; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; };
recursion yes;
};
zone "." IN {
type hint;
file "named.ca";
};
zone "study.com" IN {
type master;
file "study.zheng";
allow-transfer { 192.168.200.112; };
};
zone "200.168.192.in-addr.arpa" IN {
type master;
file "study.fan";
allow-transfer { 192.168.200.112; };
};
[[email protected] ~]# named-checkconf /etc/named.conf
[roo[email protected] ~]# cd /var/named/
[[email protected] ~]# cp named.localhost study.zheng
$TTL 1D
@ IN SOA study.com. admin.study.com. (
100 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns1.study.com.
NS ns2.study.com.
MX 10 mail.stydu.com.
mail A 192.168.200.114
www A 192.168.200.113
ns1 A 192.168.200.111
ns2 A 192.168.200.112
[[email protected] ~]# cp study.zheng study.fan
$TTL 1D
@ IN SOA study.com. admin.study.com. (
108 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns1.study.com.
IN NS ns2.study.com.
IN MX 10 mail.study.com.
114 IN PTR mail.study.com.
113 IN PTR www.study.com.
111 IN PTR ns1.study.com.
112 IN PTR ns2.study.com.
[[email protected] named]# named-checkzone study.com /var/named/study.zheng
[[email protected] named]# named-checkzone study.com /var/named/study.fan
[[email protected] named]# systemctl restart named
主服务器加缓存服务器功能配置完毕
从服务器配置
[[email protected] ~]rpm -qa | grep -w bind
bind-libs-lite-9.9.4-50.el7.x86_64
bind-utils-9.9.4-50.el7.x86_64
bind-license-9.9.4-50.el7.noarch
bind-libs-9.9.4-50.el7.x86_64
[[email protected] ~]# yum -y install bind
[[email protected] ~]# vi /etc/named.conf
options {
directory "/var/named";
};
zone "study.com" IN {
type slave;
file "slaves/study.zheng";
masters { 192.168.200.111; };
};
zone "200.168.192.in-addr.arpa" IN {
type slave;
file "slaves/study.fan";
masters { 192.168.200.111; };
};
[[email protected] ~]# named-checkconf /etc/named.conf
[[email protected] named]# systemctl restart named
从服务器配置完毕
测试机window7测试(正、反解析,主服务器、从服务器为DNS解析)
原文地址:https://www.cnblogs.com/shinian12138/p/11372020.html