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 autodetect2.创建软raid ,制作物理卷
安装mdadm软件包
[root@localhost ~]# mdadm -C /dev/md5 -l 5 -n 3 /dev/sd[bcd]1
mdadm: Defaulting to version 1.2 metadatamdadm: 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/fstabUUID=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.conf97 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
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 wangruiDisk quotas for user wangrui (uid 1000):
Filesystem blocks soft hard inodes soft hard [root@localhost data]# quota -usvDisk 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