dns等服务器搭建

1.分区

[root@localhost ~]# fdisk -l |grep /dev/sd
磁盘 /dev/sda:32.2 GB, 32212254720 字节,62914560 个扇区
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    62914559    30407680   8e  Linux LVM
磁盘 /dev/sdb:21.5 GB, 21474836480 字节,41943040 个扇区
/dev/sdb1            2048    41943039    20970496   fd  Linux raid autodetect
磁盘 /dev/sdc:21.5 GB, 21474836480 字节,41943040 个扇区
/dev/sdc1            2048    41943039    20970496   fd  Linux raid autodetect
磁盘 /dev/sdd:21.5 GB, 21474836480 字节,41943040 个扇区
/dev/sdd1            2048    41943039    20970496   fd  Linux raid autodetect

2.创建软raid  ,制作物理卷

安装mdadm软件包

[root@localhost ~]# mdadm -C /dev/md5  -l 5 -n 3   /dev/sd[bcd]1
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md5 started.
[root@localhost ~]# pvcreate /dev/md5
  Physical volume "/dev/md5" successfully created.
[root@localhost ~]# vgcreate   myvg  /dev/md5
  Volume group "myvg" successfully created

[root@localhost ~]# lvcreate  -L 35G -n mylv  myvg
  Logical volume "mylv" created.

 

3.格式化,挂载,开机自启等。

[root@localhost ~]# mkfs -t ext4 /dev/myvg/mylv

[root@localhost ~]# blkid /dev/myvg/mylv
/dev/myvg/mylv: UUID="6eec321a-2105-4368-b33e-2ae92ce36b45" TYPE="ext4"
[root@localhost ~]# blkid /dev/myvg/mylv>> /etc/fstab
[root@localhost ~]# vi //etc/fstab

UUID=6eec321a-2105-4368-b33e-2ae92ce36b45   /aaa  ext4   defaults   0 0

[root@localhost ~]# mount /dev/myvg/mylv  /aaa

 

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

 

4.安装apache服务

[root@localhost ~]# ls
anaconda-ks.cfg  httpd-2.2.17.tar.gz

[root@localhost httpd-2.2.17]# yum -y install gcc gcc-c++
[root@localhost ~]# tar xf httpd-2.2.17.tar.gz  -C /usr/src
[root@localhost ~]# cd /usr/src/httpd-2.2.17/
[root@localhost httpd-2.2.17]# ./configure --prefix=/usr/local/httpd/htdocs

[root@localhost httpd-2.2.17]# make&&make install

[root@localhost htdocs]# cd /usr/local/httpd/htdocs/conf
[root@localhost conf]# cp  httpd.conf{,.bak}
[root@localhost conf]# vi /usr/local/httpd/htdocs/conf/httpd.conf

97 ServerName www.example.com:80

[root@localhost ~]# /usr/local/httpd/htdocs/bin/apachectl start
[root@localhost ~]# yum -y install lynx

[root@localhost ~]# lynx 127.0.0.1

dns等服务器搭建_第1张图片

 

5.磁盘配额

[root@localhost ~]# yum -y install quota

[root@localhost data]# vi /etc/fstab

UUID=d3805c6e-2323-4b14-bf7f-20fb9e71697a  /aaa   ext4  defaults,usrquota,grpquota 0 0

[root@localhost data]# quotacheck  -avug

[root@localhost data]# quotaon -a
[root@localhost data]# edquota -u wangrui

Disk quotas for user wangrui (uid 1000):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
 [root@localhost data]# quota -usv
Disk quotas for user root (uid 0):
     Filesystem   space   quota   limit   grace   files   quota   limit   grace
/dev/mapper/myvg-mylv
                    20K      0K      0K               2       0       0        /dev/mapper/myvg-mylv             0        80M       100M          0      80      0

[root@localhost data]# cd /usr/local/httpd/htdocs/
[root@localhost htdocs]# vi index.html

 

转载于:https://www.cnblogs.com/wrwrwrwr/p/11379423.html

你可能感兴趣的:(dns等服务器搭建)