制作本地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.www58058.com/39725

(0)
AleenAleen
上一篇 2016-08-25 10:09
下一篇 2016-08-25 14:48

相關推薦

  • N22-℡浮生.若夢 ╮-第二周作業

    1、Linux上的文件管理類命令都有哪些,其常用的使用方法及其相關示例演示。 cp文件復制:       常用選項:     -i:交互式復制,即覆蓋之前提醒用戶確認;     -f:強制覆蓋目標文件;  &n…

    Linux干貨 2016-09-06
  • 馬哥教育網絡班22期+第1周課程練習

    week1作業: 1.描述計算機的組成及其功能。    計算機的組成:    CPU:控制器、運算器、寄存器、CPU緩存(RAM,一級、二級、三級緩存)    控制器(Control):是整個計算機的中樞神經,其功能是對程序規 定的控制信息進行解釋,根據其要求進行控制,…

    Linux干貨 2016-08-15
  • Linux磁盤陣列RAID以及mdadm實現軟件RAID

    一、概要 RAID(磁盤陣列):由眾多價格較便宜的磁盤,組合成一個容量巨大的磁盤組,利用個別磁盤提供數據所產生加成效果來提升整個磁盤的性能。 二、RAID的級別及其優缺點 讀性能提升 寫性能提升 容錯能力 組合后空間大小 RAID0 上升 上升 無 n*單個磁盤大小 RAID1 上升 下降 有(最多壞一塊磁盤) 1*單個磁盤大小 RAID4 上升 上升 有(…

    2015-04-20
  • 馬哥教育網絡班19期第一周課程練習

    1、描述計算機的組成及其功能。 從大體上計算機是由cpu、內存、主板、I/O設備、存儲設備組成 cpu的功能就好像人的大腦,控制身體的。嚴格意義上是用來解釋計算機指令以及處理軟件中的數據的。 內存的功能就好像人的大腦記憶區、來存放眼睛看到的世界。嚴格意義上是用于暫時存放cpu中的運算數據,以及與硬盤等外部存儲器交換的數據 主板的功能就好像人的身體,來鏈接身體…

    Linux干貨 2016-06-18
  • ?redis cluster 安裝指南

    公司的很多項目在使用redis主從。由于coder的各種毀滅性操作,迫切需要一個能帶故障恢復的架構。因此新版的cluster,開始了測試。 一、Cluster 理論基礎 Cluster介紹 Redis集群是一個提供在多個Redis間節點間共享數據的程序集。 Redis集群并不支持處理多個keys的命令,因為這需要在不同的節點間移動數據,從而達不到像Redis…

    Linux干貨 2016-02-14
  • 文本處理之sed

     sed:是一種行編輯器,它在處理行時會把要處理的行讀入模式空間中,處理的是模式空間的內容,一行一行的處理,然后把處理結果顯示在屏幕中,不對原文做修改,除非強制重定向。   好處:可同時編輯一個或多個文件,簡化了對文件的反復操作。 sed用法:   格式: sed [options ]…'script&#0…

    Linux干貨 2016-08-15

評論列表(1條)

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

    文章通過實例操作,加深了自己對編譯安裝的理解。源碼包編譯安裝時一個基本能力,故我們需要自己多加練習,多多總結自己在編譯過程中遇到的問題,以便于以后在遇到同樣的情形,我們能快速定義問題所在,同時文章需要多一些理論的東西,理論才能決定我們走的多遠,沒有理論支持的操作,實踐只是停留在模仿。

欧美性久久久久