linux成功安装Apache的漫长过程,终于解决所有的报错

历经一个宝贵的早上,终于把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


就没问题啦

上个图图吧微笑



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章