轉(zhuǎn)帖|其它|編輯:王香|2017-07-11 11:52:44.000|閱讀 577 次
概述:今天的文章將要給大家介紹Centos6.8下編譯安裝Apache 2.4.25的過程,內(nèi)容很詳細(xì),希望對大家有幫助。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
一、下載源碼安裝包
# cd /usr/local/src # wget '//mirror.bit.edu.cn/apache//httpd/httpd-2.4.25.tar.gz'
二、解壓安裝
# tar zxf httpd-2.4.25.tar.gz # cd httpd-2.4.25 # ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-mpm=worker
在這過程中報(bào)錯(cuò)如下:
checking for chosen layout... Apache checking for working mkdir -p... yes checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: configure: Configuring Apache Portable Runtime library... configure: checking for APR... no configure: error: APR not found. Please read the documentation.
解決APR not found 過程如下:
# cd /usr/local/src # wget //archive.apache.org/dist/apr/apr-1.5.2.tar.gz # tar zxf apr-1.5.2.tar.gz # ./configure --prefix=/usr/local/apr # make && make install
在編譯apr的的過程中報(bào)錯(cuò)如下:
configure: creating ./config.status config.status: creating Makefile config.status: creating include/apr.h config.status: creating build/apr_rules.mk config.status: creating build/pkg/pkginfo config.status: creating apr-1-config config.status: creating apr.pc config.status: creating test/Makefile config.status: creating test/internal/Makefile config.status: creating include/arch/unix/apr_private.h config.status: executing libtool commands rm: cannot remove `libtoolT': No such file or directory config.status: executing default commands
解決方法如下:
在configure里面 RM='$RM -f' 這里的$RM后面一定有一個(gè)空格。 如果后面沒有空格,直接連接減號,就依然會(huì)報(bào)錯(cuò)。把RM='$RM'改為RM='$RM -f'
接著重新編譯Apache:
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-mpm=worker --with-apr=/usr/local/apr
報(bào)錯(cuò)如下:
checking for chosen layout... Apache checking for working mkdir -p... yes checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: configure: Configuring Apache Portable Runtime library... configure: checking for APR... yes setting CC to "gcc" setting CPP to "gcc -E" setting CFLAGS to " -g -O2 -pthread" setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE" setting LDFLAGS to " " configure: configure: Configuring Apache Portable Runtime Utility library... configure: checking for APR-util... no configure: error: APR-util not found. Please read the documentation.
解決APR-util not found過程:
# wget '//archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz' # tar zxf apr-util-1.5.2.tar.gz # cd apr-util-1.5.2 # ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config # make && make install
編譯完成后,我們再次重新編譯Apache:
# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
enable-so 允許apache支持動(dòng)態(tài)模塊 enable-rewrite 支持URL重定向 with-mpm=worker apache進(jìn)程模型為worker 默認(rèn)為prefork
最后:
# make && make install
熱門格式轉(zhuǎn)換工具在線訂購特惠中點(diǎn)擊查看>>>>
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn