制作本地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

相关推荐

  • 命令组合实战

    1 列出/etc/下以。conf结尾的文件 [redsun@jiange root]$ ls  /etc/*.conf | tr 'a-z' 'A-Z'  | sed 's/ETC/etc/' > /tmp/etc.conf [redsun@jiange root]$ mo…

    Linux干货 2016-11-13
  • sed 流编辑器使用详解

    一、Stream EDitor, 行编辑器   sed是一种流编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有改变,除非你使用重定向存储输出…

    2016-08-10
  • 磁盘管理(1)

    1、磁盘结构(机械硬盘) (1)磁盘构成: 磁臂(机械手臂):连接并固定磁头 马达(电机):可以转动盘片,让磁臂上的磁头可以在盘片上读写数据 扇区:最小的物理存储单位,每个扇区为512bytes 磁头:可以读写数据 盘片:主要记录数据 柱面:将扇区组成一个圆就是柱面,柱面是分区的最小单位 (2)磁盘接口 并口:IDE  SCSI&nbsp…

    Linux干货 2016-08-30
  • Linux中高级文件系统管理

    一、磁盘配额管理             定义:限制普通用户对某个目录写空间大小的限制     1、此策略是针对文件系统,并非硬盘     2、可以根据不同组和不同用户进行不同的策…

    Linux干货 2016-08-29
  • 18-系统启动故障修复-实践

    说明:重启时可以选择性在vmlinuz所在行末尾添加 selinux=0;或者直接编辑/etc/selinus/config文件,更改 SELINUX=disabled 关闭SELINUX。可以避免打标签,节省启动时间 以下操作都需要进入bootloader引导加载项修改内核启动参数,在vmlinuz所在行末尾添加一个启动选项 如何进入bootloader引…

    2017-04-02
  • 马哥教育网络班22期第3周课程作业

    1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。 [root@MyCloudServer ~]# who | cut -d " " -f1 |sort -u root 2、取出最后登录到当前系统的用…

    Linux干货 2016-09-19

评论列表(1条)

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

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