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

相關推薦

  • iptables-防火,防盜,防老王

        防火墻,其實說白了將,就是用于實現linux下訪問控制的功能的,它分為兩種方式,硬件防火墻和軟件防火墻。不過無論是在哪個網絡中,防火墻工作的地方一定是在網絡的邊緣。而我們的任務就是需要去定義防火墻如何工作的,這就是防火墻的策略,規則,以達到讓它對出入網絡的IP,數據進行檢測。     目前市…

    Linux干貨 2017-05-02
  • 馬哥教育網絡班22期+第2周課程練習

    一、Linux上的文件管理類命令都有哪些,其常用的使用方法及其相關示例演示。     Linux上文件管理類命令常用的有:pwd、ls、cd、cp、touch、mv、rm、rmdir (1)pwd:顯示當前路徑,打印工作目錄(Print Working Directory) (2)ls:查看指定目錄下的內容 參數 說明 -a 列舉目錄中的…

    Linux干貨 2016-08-29
  • 上古神器vim

    概述:     在之前的篇章中,我們介紹了一些文本的處理工具,如grep、sed、cut、sort等,但是那些工具的側重點都在于有了現成的文本之后,對現有的文本進行一定條件的加工處理后,滿足我們進一步對數據的要求。但是目前為止,還沒有接觸一款專業用來編輯文本的工具,本篇就來介紹一下Linux系統上自帶的專業用來文本編輯…

    Linux干貨 2016-08-10
  • gitlab-ce白名單設置杜絕并發數過大引起的封ip故障

    gitlab-ce 7.9安裝手札以及上篇文章的問題解決 鳴謝 感謝ruby大神===》章魚的一路指點,才能撥開迷霧見云天! 章魚大人:     國內Ansible部落原創翻譯之一!     資深運維!     ROR大神!  &…

    Linux干貨 2015-09-06
  • Nginx+resin調優文檔[原創]

    為什么不選擇Apache/mod+resin?       前面一直使用該模式,mod_caucho暴露源碼的bug一直未得到徹底的解決。因此切換到Nginx+resin平臺。硬件上要求除了內存一定要足夠大(建議>4G),無其它要求(當然也不能太破,呵呵)。操作系統強烈要求安裝64位,32位操…

    Linux干貨 2015-03-27
  • 上篇博客簡單提了一下Nginx配置文件的大體組成部分,這次來好好解釋一下這些個配置文件。 一、main配置段 分類:    正常運行必備的配置    優化性能相關的配置    用于調試及定位問題相關的配置   …

    Linux干貨 2016-10-26

評論列表(1條)

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

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

欧美性久久久久