linux做硬盘仓库,创建yum仓库与逻辑磁盘分区

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

网络源:

1、首先创建yum仓库:

[centos@localhost ~]$ yum install createrepo

2、将原来的yum网络源禁用。

[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak

3、编辑CentOS-Base.repo

[base]

name=Base Repo on mirrors.bjtu.edu.cn

baseurl=http://mirror.bjtu.edu.cn/centos/$releasever/os/$basearch

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]

name=Base Repo on mirrors.bjtu.edu.cn

baseurl=http://mirror.bjtu.edu.cn/centos/$releasever/updates/$basearch

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]

name=Base Repo on mirrors.bjtu.edu.cn

baseurl=http://mirror.bjtu.edu.cn/centos/$releasever/extras/$basearch

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[centosplus]

name=Base Repo on mirrors.bjtu.edu.cn

baseurl=http://mirror.bjtu.edu.cn/centos/$releasever/centosplus/$basearch

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

本地源:

1、挂载光盘镜像到本地。

[centos@localhost ~]$ mount -r /dev/cdrom /home/os

2、修改CentOS-Media.repo

[c7-media]

name=CentOS-$releasever - Media

baseurl=file:///media/CentOS/

file:///home/os/

file:///media/cdrecorder/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

3、禁用网络yum源

[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Media.repo.Bak

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

1、检查是否已安装httpd2.4

[root@nihao ~]# rpm -qa | grep httpd

2、安装开发工具

[root@nihao ~]# yum groupinstall 'Development Tools'

[root@nihao sources]# tar xvf httpd-2.4.43.tar.gz

5、下载apr包并安装

[root@localhost ~]# wget http://archive.apache.org/dist/apr/apr-1.7.0.tar.gz

[root@localhost download]# tar -xvf ./apr-1.7.0.tar.gz

[root@localhost ~]# ./configure prefix=/usr/local/apr

[root@localhost download]# make && make install

6、下载apr-util包并安装

[root@localhost ~]# wget http://archive.apache.org/dist/apr/apr-util-1.3.4.tar.gz

[root@localhost download]# tar -xvf ./apr-util-1.3.4.tar.gz

[root@localhost ~]# ./configure prefix=/usr/local/apr --with-apr=/usr/local/apr/bin

[root@localhost download]# make && make install

7、下载pcre包

网址链接:https://ftp.pcre.org/pub/pcre/

8、安装pcre包

[root@localhost download]# unzip pcre2-10.35.zip

[root@localhost pcre2-10.35]# ./configure prefix=/usr/local/pcre

[root@localhost pcre2-10.35]# make && make install

9、安装http2.4

注意:安装过程中出现:

exports.c:2436:13: error: redefinition of ‘ap_hack_apr_xml_quote_elem’

const void *ap_hack_apr_xml_quote_elem = (const void *)apr_xml_quote_elem;

^

exports.c:2048:13: note: previous definition of ‘ap_hack_apr_xml_quote_elem’ was here

const void *ap_hack_apr_xml_quote_elem = (const void *)apr_xml_quote_elem;

^

exports.c:2437:13: error: redefinition of ‘ap_hack_apr_xml_insert_uri’

const void *ap_hack_apr_xml_insert_uri = (const void *)apr_xml_insert_uri;

^

exports.c:2049:13: note: previous definition of ‘ap_hack_apr_xml_insert_uri’ was here

const void *ap_hack_apr_xml_insert_uri = (const void *)apr_xml_insert_uri;

^

exports.c:2446:13: error: redefinition of ‘ap_hack_apu_version’

const void *ap_hack_apu_version = (const void *)apu_version;

^

exports.c:2058:13: note: previous definition of ‘ap_hack_apu_version’ was here

const void *ap_hack_apu_version = (const void *)apu_version;

^

exports.c:2447:13: error: redefinition of ‘ap_hack_apu_version_string’

const void *ap_hack_apu_version_string = (const void *)apu_version_string;

解决:安装apr-util1.4.1版本以上的,我安装了apr-util1.3.4导致出错。

[root@localhost httpd-2.4.43]# ./configure --prefix=/usr/local/apache --with-pcre=/usr/local/pcre --with-apr-util=/usr/local/apr-util

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

10、启动httpd服务,验证安装成功

[root@localhost ~]# /usr/local/apache/bin/apachectl start

[root@localhost ~]# curl http://localhost:80

It works!

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

1、创建2G的文件系统分区

[root@localhost ~]# fdisk /dev/sdb

Command (m for help): n

Select (default p): p

First sector (4196352-20971519, default 4196352):

Using default value 4196352

Last sector, +sectors or +size{K,M,G} (4196352-20971519, default 20971519): +20G

2、设置块大小为2048byte,预留1%可用空间,文件系统 ext4,卷标为TEST

[root@localhost ~]# mke2fs -t ext4 -L 'TEST' -m 1 -b 2048 /dev/sdb1

3、开机后自动挂载至/test目录,且默认有acl挂载选项

[root@localhost etc]# cat /etc/fstab

UUID=TEST /home/other ext4 defaults,acl 0 0

四、创建一个至少有两个PV组成的大小为20G的名为testvg的VG;要求PE大小 为16MB, 而后在卷组中创建大小为5G的逻辑卷testlv;挂载至/users目录

1、创建两个PV组成的大小为20G的名为testvg的VG要求PE大小 为16MB

[root@localhost ~]# pvcreate /dev/sdc1 /dev/sdc2

Physical volume "/dev/sdc1" successfully created.

Physical volume "/dev/sdc2" successfully created.

[root@localhost ~]# vgcreate --physicalextentsize 16M testvg /dev/sdc1 /dev/sdc2

Volume group "testvg" successfully created

2、创建大小为5G的逻辑卷testlv;挂载至/users目录

[root@localhost ~]# lvcreate -L 5G -n testlv testvg

[root@localhost testvg]# mount /dev/testvg/testlv /users/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值