標籤:httpd openssl
1、解決依賴關係
httpd-2.4.5需要較新版本的apr和apr-util,因此需要事先對其進行升級。升級方式有兩種,一種是通過原始碼編譯安裝,一種是直接升級rpm包。這裡選擇使用編譯原始碼的方式進行
(1) 編譯安裝apr
# tar xf apr-1.4.6.tar.bz2
# cd apr-1.4.6
# ./configure --prefix=/usr/local/apr
# make && make install
(2) 編譯安裝apr-util
# tar xf apr-util-1.5.2.tar.bz2
# cd apr-util-1.5.2
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make && make install
httpd-2.4.5編譯過程也要依賴於pcre-devel軟體包,需要事先安裝。此軟體包系統光碟片內建,因此,找到並安裝即可。
2、編譯安裝httpd-2.4.5
首先下載httpd-2.4.5到本地,下載路徑為wget http://mirrors.sohu.com/apache/httpd-2.4.5.tar.bz2而後執行如下命令進行編譯安裝過程:
# tar xf httpd-2.4.4.tar.bz2
# cd httpd-2.4.4
# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enables-modules=most --enable-mpms-shared=most --with-mpm=event
在編譯安裝時出現一些錯誤,
問題一:
checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failure
百度了下原來沒有安裝opessl-devel,使用yum安裝
#yum -y install opessl-devel openssl 問題即可解決。
問題二:
configure: error: MPM most does not support dynamic loading.
此時將--enbale-mpm-shared改為all即可
最後make && makeinstall
完成後啟動服務即可進行測試
本文出自 “沐木” 部落格,請務必保留此出處http://sxhxt.blog.51cto.com/5126000/1913875
源碼編譯apache 2.4.5 出現的問題