制作本地yum源与编译安装http

1、制作本地yum源(centos7)

[root@centos7 ~]# yum install -y lftp   #安装lftp程序
lftp 10.1.0.1:~> cd pub/Sources/sources/xen/   
lftp 10.1.0.1:/pub/Sources/sources/xen> !mkdir -p /testdir/yum/repo   #在自己的虚拟机创建yum仓库
lftp 10.1.0.1:/pub/Sources/sources/xen> lcd /testdir/yum/repo/    #进入自己的虚拟机仓库
lftp 10.1.0.1:/pub/Sources/sources/xen> !pwd    #查看当前虚拟机所在的工作目录
lftp 10.1.0.1:/pub/Sources/sources/xen> mget *   #下载当前该目录下的文件到自己的虚拟机工作目录下也就是自建的yum仓库
lftp 10.1.0.1:/pub/Sources/sources/xen> exit
[root@centos7 ~]# yum -y install createrepo   #安装creterepo程序
[root@centos7 ~]# createrepo /testdir/yum/repo/   #创建yum仓库的元数据
[root@centos7 ~]# ls -l /testdir/yum/repo/
total 35692
drwxr-xr-x. 2 root root     4096 Aug 24 12:13 repodata   #创建yum仓库的元数据后,会生成repodata这个目录
-rw-r--r--. 1 root root 18134427 Feb  3  2015 xen-4.4.1.tar.gz
-rw-r--r--. 1 root root 18404933 Feb  3  2015 xen-4.5.0.tar.gz
[root@centos7 ~]# mkdir -p /etc/yum.repos.d/back && mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/back   
[root@centos7 ~]# echo -e "[base]\nname=centos7\nbaseurl=file:///testdir/yum/repo/" > /etc/yum.repos.d/base.repo   #自定义yum仓库的配置文件
[root@centos7 ~]# yum repolist   #更新yum仓库

2、编译安装http(源码包版本2.2)

[root@centos7 ~]# lftp 10.1.0.1
lftp 10.1.0.1:/pub/Sources/sources/httpd> lcd /tmp/
lftp 10.1.0.1:/pub/Sources/sources/httpd> !pwd
lftp 10.1.0.1:/pub/Sources/sources/httpd> get httpd-2.2.29.tar.bz2
lftp 10.1.0.1:/pub/Sources/sources/httpd> exit
[root@centos7 ~]# tar -jxf /tmp/httpd-2.2.29.tar.bz2
[root@centos7 ~]# cd /tmp/httpd-2.2.29/
[root@centos7 httpd-2.2.29]# ./configure --prefix=/usr/local/http2 --sysconfdir=/etc/http2/
[root@centos7 httpd-2.2.29]# make && make install
[root@centos7 httpd-2.2.29]# sed -ri '22 a \MANDATORY_MANPATH                       /usr/local/http2/man' /etc/man_db.conf
[root@centos7 httpd-2.2.29]# ln -s /usr/local/http2/include/ /usr/include/http2
[root@centos7 httpd-2.2.29]# echo "/usr/local/http2/lib/" > /etc/ld.so.conf.d/http2.conf
[root@centos7 httpd-2.2.29]# echo 'PATH=$PATH:/usr/local/http2/bin' > /etc/profile.d/http2.sh && source /etc/profile.d/http2.sh
[root@centos7 httpd-2.2.29]# apachectl start
[root@centos7 httpd-2.2.29]# iptables -F
[root@centos7 httpd-2.2.29]# yum install -y links
[root@centos7 include]# links 10.1.255.80

作业:

1、输入若干个数值存入数组中,采用冒泡算法进行升序或降序排序

2、删除kernel包后,无法启动,并恢复之

3、源码安装apache

[root@centos7 ~]# yum install -y gcc
[root@centos7 testdir]# wget  
[root@centos7 testdir]# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
[root@centos7 testdir]# wget 
[root@centos7 testdir]# tar -xf apr-1.5.2.tar.gz && cd apr-1.5.2 
[root@centos7 apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@centos7 apr-1.5.2]# make && make install
[root@centos7 apr-1.5.2]# cd ..
[root@centos7 testdir]# tar -xf apr-util-1.5.4.tar.gz && cd apr-util-1.5.4
[root@centos7 apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@centos7 apr-util-1.5.4]# make && make install
[root@centos7 apr-util-1.5.4]# cd ../
[root@centos7 testdir]# tar -xf pcre2-10.20.tar.gz && cd pcre2-10.20
[root@centos7 pcre2-10.20]# ./configure --prefix=/usr/local/pcre
[root@centos7 pcre2-10.20]# make && make install
[root@centos7 pcre2-10.20]# cd ..
[root@centos7 testdir]# tar -xf httpd-2.4.23.tar.gz && cd httpd-2.4.23
[root@centos7 httpd-2.4.23]# ./configure --prefix=/usr/local/http2 \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
[root@centos7 httpd-2.4.23]# make && make install

原创文章,作者:Aleen,如若转载,请注明出处:http://www.178linux.com/39725

(0)
AleenAleen
上一篇 2016-08-25
下一篇 2016-08-25

相关推荐

  • LINUX课堂笔记(第一周)

    2018.03.05 LINUX: 切换虚拟终端:CTRL+ALT+F[1-6] 查看当前得终端设备命令:tty 查看内存: cat /proc/meminfo free -h 查看分区: cat /proc/partitions lsblk 查看CPU: lscpu cat /proc/cpuinfo 查看版本 cat /etc/centos-releas…

    Linux干货 2018-03-15
  • 马哥教育网络班20期 第9周课程练习

    1、写一个脚本,判断当前系统上所有用户的shell是否为可登录shell(即用户的shell不是/sbin/nologin);分别这两类用户的个数;通过字符串比较来实现; #!/bin/bash #the purpose of program : # #08/11/2016  PATH=/bin:/sbin:…

    Linux干货 2016-08-15
  • ansible原理及简单应用

    一、基础介绍 1、简介 ansible是新出现的自动化运维工具,基于python开发,集合了众多运维工具(puppet、cfengine、chef、func、fabric)的优点,实现了批量系统配置、批量程序部署、批量运行命令等功能。ansible是基于模块工作的,本身没有批量部署的能力。真正具有批量部署的是ansible所运行的模块,ansible只是提供…

    Linux干货 2016-01-13
  • 第七周作业

    1、简述linux操作系统启动流程 CentOS 启动流程图: 通电自检 power on system test(POST)–> BIOS –> 主机加电以后会将各个部件运转起来,然后通过COMS上的软件程序BIOS(Basic Input Output System)检测每个设备cpu、内存、硬盘进行故障检查并进行硬件…

    2018-02-07
  • RPM及YUM工具介绍及使用(下)

    YUM工具 YUM工作原理 YUM工具的出现就是为了解决rpm工具不能够自动解决软件包之间的依赖关系这一难题的。它的工作原理大致如下:YUM透过分析RPM的标头资料,根据各软件的相关性找出软件所依赖的软件列表,然后去下载速度最快的yum仓库中下载所有相关RPM软件包,然后完成相应软件的安装。同时yum工具和rpm工具一样,也可以提供对软件包的查询,安装、升级…

    Linux干货 2016-12-26
  • 8.6正则表达式grep及其他文本处理命令练习

    正则表达式grep及其他文本处理命令练习 上课练习 1 1、centos 6找出ifconfig命令结果中本机的IPv4地址 [root@qzx ~]# ifconfig|head -n 2|tail -n 1|tr -s ' [:alpha:]'&…

    Linux干货 2016-08-07

评论列表(1条)

  • 马哥教育
    马哥教育 2016-08-26 13:41

    文章通过实例操作,加深了自己对编译安装的理解。源码包编译安装时一个基本能力,故我们需要自己多加练习,多多总结自己在编译过程中遇到的问题,以便于以后在遇到同样的情形,我们能快速定义问题所在,同时文章需要多一些理论的东西,理论才能决定我们走的多远,没有理论支持的操作,实践只是停留在模仿。