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