歷經一個寶貴的早上,終於把Apache這個可愛的東東裝上了
下面直接上小弟的步驟:
首先下載包:http://httpd.apache.org/download.cgi
解壓不說了哈,下面開始編譯吧
#./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite ……檢查編輯環境時出現:
...其中的過程省略點哈
checking for APR... no
configure: error: APR not found . Please read the documentation.
可以用./configure –help | grep apr 查看幫助。
--with-included-apr Use bundled copies of APR/APR-Util
--with-apr=PATH prefix for installed APR or the full path to apr-config
--with-apr-util=PATH prefix for installed APU or the full path to
安裝APR(Apache Portable Runtime )
下載:http://apr.apache.org/download.cgi
#cd /tmp/52lamp/ //源碼存放位置
#tar -zxvf apr-1.4.2.tar.gz //unzip -o apr-1.4.2.zip
#cd apr-1.4.2
#./configure
#make
#make install
再次檢查編譯環境出現
checking for APR-util... no
configure: error: APR-util not found . Please read the documentation.
#./configure –help | grep apr-util
--with-apr-util=PATH prefix for installed APU or the full path to
下載:http://download.chinaunix.net/download/0001000/472.shtml
#tar -zxvf apr-util-0.9.12.tar.gz
#cd apr-util-0.9.12
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
#make
#make install
--prefix=/usr/local/apache2 --enable-so --enable-rewrite仍提示APR-util not found,增加--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/bin/apu-1-config後出現
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
#./configure –help | grep pcre
--with-pcre=PATH Use external PCRE library
下載:http://sourceforge.net/projects/pcre
#unzip -o pcre-8.10.zip
#cd pcre-8.10
#./configure --prefix=/usr/local/pcre 這時候報錯了:
configure: error: You need a C++ compiler for C++ support
yum install -y gcc gcc-c++
額,又報[Errno 256] No more mirrors to try這個錯了,哈哈...真好玩,敲一句 yum cleam all 就ok啦!
於是 繼續 yum install -y gcc gcc-c++
唉這時候又報錯了:
這時候則需要編輯文件:/etc/yum.repo.d/packagekit-media.repo,在最後添加“enabled=0”,禁用此repo配置。
由於這個文件的權限是-r--r--r--,則需要 chmod 644 pachagekit-media.repo,這樣就可以添加“enabled=0”了,或者直接將其刪除也行...
現在 安裝pcre這個東東就沒問題了
#make
#make install
繼續安裝Apache,./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite 時加上參數 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-pcre=/usr/local/pcre
本以爲可以喝杯咖啡的了,沒想到又報這個錯了:
哦,一看,原來是我剛纔安裝的APR-util 這個版本過低了,那我下載個1.3.0以上的吧:
http://download.csdn.net/download/chenhaizhao21/4182301
下載好之後,我直接卸載之前安裝的那個APR-util , rm -rf apr-util ,再安裝這個1.3.12版本的就行了...
呼。。。
這時候
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --with-apr=/usr/local/apr/
--with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-pcre=/usr/local/pcre
就沒問題啦
上個圖圖吧: