查看yum的配置文件
[root@centos7 ~]#cat /etc/yum.conf
rpm -k
檢查包的完整性
yum倉庫這個下面建立
[root@centos7 ~]#cd /etc/yum.repos.d/
建立yum源和yum倉庫
vim /etc/yum.repos.d/base2.repopython
yun clean all清緩存
[root@centos7 yum.repos.d]#yum repolist
查看yum源列表
[root@centos7 yum.repos.d]#yum install httpd
這就能下載linux
**編譯安裝**
第一步安裝:apache
1下載源碼並解包vim
2 準備編譯環境
yum groupinstall "Development Tools"
運行.configre
程序包編譯安裝:centos
源代碼--》預處理--》編譯--》彙編---》連接---》執行緩存
configure生成makefile’
原來的httpd版本
須要安裝development Tool
yum groupinstall 「development Tool」
Yum groupinstall 軟件組 安裝指定軟件組
Yum groupremove 軟件組 卸載指定軟件組app
查看包組
[root@centos7 httpd-2.4.29]#yum grouplist
先卸載以前的版本
[root@centos7 ~]#yum remove httpdide
運行configure
configure腳本的通用功能:
一、指定安裝路徑:
–prefix=/usr/local/packagename 指定安裝路徑
–sysconfdir=/etc/packagename 指定配置文件的存放路徑
運行報錯
裝上[root@centos7 httpd-2.4.29]#yum install apr-devel
在執行,在報錯,再安裝,缺啥補啥
[root@centos7 httpd-2.4.29]#yum install apr-util-devel
安裝完成,生成Makefile文件
查看文件夾大小
[root@centos7 httpd-2.4.29]#du -sh
45M
接下來進行編譯
make -j 4
其實能夠make &&make install
下面make install安裝
[root@centos7 httpd-2.4.29]#make install
查看app下面有沒有生成目錄
[root@centos7 httpd-2.4.29]#ls /app
12 sl-5.02-1.el7.x86_64.rpm
httpd24
[root@centos7 httpd-2.4.29]#du -sh /app/httpd24
31M /app/httpd24
把httpd24下面的bin文件夾的路徑放到path變量中
再啓動APACHE服務
[root@centos7 httpd24]#apachectl
[root@centos7 httpd24]#ss -ntl
LISTEN 0 128 :::80
網頁能夠打開了
總結
$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-rewrite=shared \
--enable-speling=shared
一、configure,這一步通常用來生成 Makefile,爲下一步的編譯作準備,你能夠經過在 configure 後加上參數來對安裝進行控制,好比代碼:./configure –prefix=/usr 意思是將該軟件安裝在 /usr 下面,執行文件就會安裝在 /usr/bin (而不是默認的 /usr/local/bin),資源文件就會安裝在 /usr/share(而不是默認的/usr/local/share)。同時一些軟件的配置文件你能夠經過指定 –sys-config= 參數進行設定。有一些軟件還能夠加上 –with、–enable、–without、–disable 等等參數對編譯加以控制,你能夠經過容許 ./configure –help 察看詳細的說明幫助。
二、make,這一步就是編譯,大多數的源代碼包都通過這一步進行編譯(固然有些perl或python編寫的軟件須要調用perl或python來進行編譯)。若是 在 make 過程當中出現 error ,你就要記下錯誤代碼(注意不單單是最後一行),而後你能夠向開發者提交 bugreport(通常在 INSTALL 裏有提交地址),或者你的系統少了一些依賴庫等,這些須要本身仔細研究錯誤代碼。
三、make insatll,這條命令來進行安裝(固然有些軟件須要先運行 make check 或 make test 來進行一些測試),這一步通常須要你有 root 權限(由於要向系統寫入文件)
http://www.178linux.com/39759測試