1、自建yum仓库,分别为网络源和本地源

  • 网络源

    #### 1. 在/etc/yum.repos.d/路径下建立文件aliyun.repo写入以下内容:
    
            [base]
            name=CentOS-$releasever - Base - mirrors.aliyun.com
            failovermethod=priority
            baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
            gpgcheck=1
            gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
    
  • 本地源

    #### 1. 备份默认yum源配置文件
    
            [[email protected] ~]# cd /etc/yum.repos.d
            [[email protected] yum.repos.d]# mkdir backup
            [[email protected] yum.repos.d]# mv ./*.repo backup/
    
    #### 2. 挂载光盘
    
            [[email protected] yum.repos.d]# mkdir /mnt/cdrom
            [[email protected] yum.repos.d]# mount /dev/sr0 /mnt/cdrom
    
    #### 3. 配置光盘作为本地yum源
        在/etc/yum.repos.d/路径下建立文件base.repo写入以下内容:  
        
            [base-local]  
            name=cdrom base  
            baseurl=file:///mnt/cdrom/  
            gpgcheck=0  
            gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7
    

2、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交。

  1. 安装"Development Tools"包组、apr-devel包、apr-util-devel包和pcre-devel包

        ~]# yum -y group install "Development Tools"
        ~]# yum -y install apr-devel apr-util-devel pcre-devel
        
  2. 用wget从https://httpd.apache.org/download.cgi下载httpd源码包

        ~]# wget https://downloads.apache.org//httpd/httpd-2.4.46.tar.bz2
    
  3. 解压缩源码包,切换至httpd源码目录并编译安装

        ~]# tar jxf httpd-2.4.46.tar.bz2
        ~]# cd httpd-2.4.46
        httpd-2.4.46]# ./configure --with-apr=/usr/bin/apr-1-config --with-apr-util=/usr/bin/apu-1-config --with-pcre=/usr/bin/pcre-config
        httpd-2.4.46]# make
        
    ![编译完成](https://pic.zkliang.com/httpd_maked.png)
        
        httpd-2.4.46]# make install
        
    ![安装完成](https://pic.zkliang.com/httpd_installed.png)
    
  4. 测试启动httpd

        httpd-2.4.46]# /usr/local/apache2/bin/apachectl start
    
    ![启动完成](https://pic.zkliang.com/httpd_started.png)
    
  5. 完成,已可连接至服务器

3、创建一个2G的文件系统,块大小为2048byte,预留1%可用空间,文件系统 ext4,卷标为TEST,要求此分区开机后自动挂载至/test目录,且默认有acl挂载选项

~]# fdisk /dev/sdb
# 创建一个分区;
~]# lsblk
# 查看创建的分区块设备;
~]# mke2fs -b 2048 -L TEST -t ext4 /dev/sdb1;
~]# dumpe2fs /dev/sdb1 | more
# 查看文件系统信息;
~]# blkid
# 查看文件系统;
~]# vim /etc/fstab
# 添加配置文件实现自动挂载;
~]# df -h
# 查看挂载的文件系统;