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

相关推荐

  • Linux获取命令帮助方法全揽

    Linux获取命令帮助方法全揽 Linux命令分类 内置命令:shell程序自带的命令 外部命令:独立的可执行程序,在linux系统中存在与命令名称相同的可执行文件,需要shell程序通过环境变量解析到对应的可执行性文件后才可执行 可使用type COMMAND查看命令的分类 获取帮助的方法 内置命令获取帮助 命令格式:help COMMAND 外部命令获取…

    Linux干货 2017-07-02
  • 马哥教育网络21期+第十一周练习博客(下)

    马哥教育网络21期+第十一周练习博客(下) 3、描述DNS查询过程以及DNS服务器类别。 DNS:Domain Name Service 通俗的称为地址解析,使用TCP和UDP的53端口,是属于应用层的协议; DNS查询有2种方式:     递归查询:至发送一次请求,就能找到最终的结果的查…

    Linux干货 2016-09-26
  • grep简述

    grep(Globel Search Regular Expression and Printing out the line) 它能使用正则表达式搜索文本,并把匹配的行打印出来。 grep包括grep、egrep和fgrep。 egrep表示扩展的grep,相比grep支持更多的匹配模式, “grep -E”相当于egrep。 fgrep是fast gre…

    2017-04-06
  • Linux下常用安全策略设置的六个方法

    安全第一”对于linux管理界乃至计算机也都是一个首要考虑的问题。加密的安全性依赖于密码本身而非算法!而且,此处说到的安全是指数据的完整性,由此,数据的认证安全和完整性高于数据的私密安全,也就是说数据发送者的不确定性以及数据的完整性得不到保证的话,数据的私密性当无从谈起! 1. 禁止系统响应任何从外部/内部来的ping请求攻击者一般首先通过ping命令检测此…

    Linux干货 2017-07-31
  • 磁盘分区管理之磁盘基础知识1

    1、磁盘基础知识 1.1 磁头 磁头是利用气流漂浮在盘片上,并没有接触到盘片,因而可以在各轨间高速来回移动,但如果磁头距离盘片太高,读取的信号就会太弱;太低又会磨到盘片表面,所以盘片表面必须相当光滑平整,任何异物和尘埃均会使得磁头摩擦到表面而造成数据永久性损坏。 硬盘读写磁头为了能在磁盘表面高速来回移动读取数据,则需漂浮在磁盘表面上,但是不能接触,接触就会造…

    Linux干货 2016-09-07
  • class14磁盘管理(一)

    一、硬盘基础知识及分区类型 1、磁盘结构 设备文件 I/O Ports: I/O 设备地址 一切皆文件:   open(), read(), write(), close() 设备类型: 块设备:block,存取单位“块”,磁盘 字符设备:char,存取单位“字符”,键…

    Linux干货 2016-08-29

评论列表(1条)

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

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