制作本地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)
上一篇 2016-08-25 10:09
下一篇 2016-08-25 14:48

相关推荐

  • 冒泡算法,源码安装http,yum浅谈

    生成10个随机数,采用冒泡算法进行升序或降序排序 #!/bin/bash #author:maoxiong QQ:111111111 #verson:1.0  date:2016-08  #illustrate: declare -a array #create 10 randomnum for num in {0..9} do &nbs…

    Linux干货 2016-08-26
  • 访问控制列表ACL

     ACL是Access Control List的缩写,主要的目的是提供传统的owner、group、others的read、write、execute权限之外的具体权限设置。ACL可以针对单一用户、单一文件、单一目录来进行r、w、x的权限设置,对于需要特殊权限的使用状况非常有帮助。使用getfacl和setfacl来设置查看acl的权限。ACL权…

    Linux干货 2016-08-07
  • RPM简述

    RPM 是 Red Hat Package Manager 的缩写,本意是Red Hat 软件包管理,顾名思义是Red Hat 贡献出来的软件包管理;在Fedora 、Redhat、Mandriva、SuSE、YellowDog等主流发行版本,以及在这些版本基础上二次开发出来的发行版采用。 RPM包里面都包含什么?里面包含可执行的二进制程序,这个程序和Win…

    Linux干货 2017-08-12
  • mysql知识系列–东西比较全

     A。结构化查询语言(structured query language) B。SQL语句分类  -在MySql数据库中,SQL语句主要可以划分以下几类:  ——DDL(data definition language):数据定义语言,定义对数据库对象(库、表、列、索引)的操作  -create,drop,alter,…

    Linux干货 2017-02-14
  • 第二十天 centos7的lamp简单实现

    博客作业:CentOS 7 lamp, vhost1: pma.stuX.com, phpMyAdmin, 同时提供https服务; vhost2: wp.stuX.com, wordpress vhost3: dz.stuX.com, Discuz 环境说明: DNS是:192.168.100.7 vhosts(Centos7):192.168.100.1…

    Linux干货 2016-06-18
  • 有趣的bash脚本

    1、编写脚本/root/bin/createuser.sh,实现如下功能:使 用一个用户名做为参数,如果指定参数的用户存在,就显示 其存在,否则添加之;显示添加的用户的id号等信息 #!/bin/bash read -p “Please input username: ” n if id $n &> /dev/null;then echo “T…

    Linux干货 2017-08-25

评论列表(1条)

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

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