第四周学习作业
Posted 三石头
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第四周学习作业相关的知识,希望对你有一定的参考价值。
1. 自建yum仓库,分别为网络源和本地源
配置网络源:
##备份系统自带的yum源文件
[root@centos84 yum.repos.d]# mkdir ~/yum_bak
[root@centos84 yum.repos.d]# mv * ~/yum_bak
##通过wget命令直接下载阿里云yum源
[root@centos84 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
--2021-12-12 06:28:20-- https://mirrors.aliyun.com/repo/Centos-8.repo
Connecting to 172.30.232.251:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 2595 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
/etc/yum.repos.d/CentOS-Base.repo 100%[==================================================================================>] 2.53K --.-KB/s in 0s
2021-12-12 06:28:20 (48.6 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2595/2595]
##清理缓存,加载缓存
[root@centos84 yum.repos.d]# yum clean all
[root@centos84 yum.repos.d]# yum makecache
CentOS-8 - Base - mirrors.aliyun.com 12 MB/s | 3.5 MB 00:00
CentOS-8 - Extras - mirrors.aliyun.com 72 kB/s | 10 kB 00:00
CentOS-8 - AppStream - mirrors.aliyun.com 15 MB/s | 8.2 MB 00:00
Metadata cache created.
##列出可用的yum源
[root@centos84 ~]# yum repolist
repo id repo name
AppStream CentOS-8 - AppStream - mirrors.aliyun.com
base CentOS-8 - Base - mirrors.aliyun.com
extras CentOS-8 - Extras - mirrors.aliyun.com
配置本地源
##挂在光盘到/mnt 下
[root@centos84 ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@centos84 ~]# vi /etc/yum.repos.d/cl8.repo
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS
enbale=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
enable=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[root@centos84 yum.repos.d]# yum clean all
Repository AppStream is listed more than once in the configuration
13 files removed
[root@centos84 yum.repos.d]# yum makecache
Repository AppStream is listed more than once in the configuration
CentOS-8 - Base - mirrors.aliyun.com 3.7 MB/s | 3.5 MB 00:00
CentOS-8 - Extras - mirrors.aliyun.com 39 kB/s | 10 kB 00:00
CentOS-8 - AppStream - mirrors.aliyun.com 20 MB/s | 8.2 MB 00:00
BaseOS 195 MB/s | 2.5 MB 00:00
Metadata cache created.
[root@centos84 yum.repos.d]#
[root@centos84 yum.repos.d]# yum repolist
Repository AppStream is listed more than once in the configuration
repo id repo name
AppStream CentOS-8 - AppStream - mirrors.aliyun.com
BaseOS BaseOS
base CentOS-8 - Base - mirrors.aliyun.com
extras CentOS-8 - Extras - mirrors.aliyun.com
2、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交
##使用wget 下载Apache httpd 2.4.51 Released源码包
[root@centos84 data]# wget https://dlcdn.apache.org//httpd/httpd-2.4.51.tar.bz2
--2021-12-12 07:00:42-- https://dlcdn.apache.org//httpd/httpd-2.4.51.tar.bz2
Connecting to 172.30.232.251:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: 7653609 (7.3M) [application/x-bzip2]
Saving to: ‘httpd-2.4.51.tar.bz2’
httpd-2.4.51.tar.bz2 100%[==================================================================================>] 7.30M 111KB/s in 84s
2021-12-12 07:02:07 (88.6 KB/s) - ‘httpd-2.4.51.tar.bz2’ saved [7653609/7653609]
##安装编译环境依赖包
yum install gcc make autoconf apr-devel apr-util-devel pcre-devel openssl-devel redhat-rpm-config
##临时关闭selinux
[root@centos84 ~]# setenforce 0
##解压httpd 2.4.51
[root@centos84 data]# tar -jxvf httpd-2.4.51.tar.bz2
httpd-2.4.51/
httpd-2.4.51/acinclude.m4
httpd-2.4.51/README.cmake
httpd-2.4.51/INSTALL
……
httpd-2.4.51/test/modules/http2/htdocs/noh2/index.html
httpd-2.4.51/test/modules/http2/htdocs/noh2/alive.json
httpd-2.4.51/test/modules/http2/mod_h2test/mod_h2test.c
httpd-2.4.51/test/modules/http2/mod_h2test/mod_h2test.h
[root@centos84 data]# cd httpd-2.4.51/
##配置
[root@centos84 httpd-2.4.51]# ./configure --prefix=/usr/local/http24 --sysconfdir=/etc/httpd --enable-ssl
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
……
configure: summary of build options:
Server Version: 2.4.51
Install prefix: /usr/local/http24
C compiler: gcc
CFLAGS: -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E
##编译并发4个任务执行
[root@centos84 httpd-2.4.51]# make -j 4
Making all in srclib
make[1]: Entering directory /data/httpd-2.4.51/srclib
make[1]: Leaving directory /data/httpd-2.4.51/srclib
Making all in os
make[1]: Entering directory /data/httpd-2.4.51/os
Making all in unix
软件项目管理第四周作业2017-2018-1 20155305 《信息安全系统设计基础》第四周学习总结(课堂提交作业未来得及提交码云链接myod补充博客)