安装Apache的步骤 # 下载httpd-2.2.23.tar.gz安装包 # tar zxvfhttpd-2.2.23.tar.gz # cd httpd-2.2.23 # ./configure--prefix=/usr/local/apache2 # make && makeinstall 在安装过程中,执行./configure --prefix=/usr/local/apache2后出现报错信息如下: “configure: error: APR not found . Please readthe documentation” 解决办法: 1、首先需要下载三个软件包 wgethttp://archive.apache.org/dist/apr/apr-1.4.5.tar.gz wgethttp://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip 1)、第一步解决“apr not found” #tar zxvf apr-1.4.5.tar.gz #./configure –prefix=/use/local/apr #make&&makeinstall 2)、第二步解决“apr-utilnot found” # tar -zxfapr-util-1.3.12.tar.gz # cd apr-util-1.3.12 #./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config # make && make install 3)、第三步解决pcre问题 #unzip -opcre-8.10.zip #cd pcre-8.10 #./configure --prefix=/usr/local/pcre #make && make install 如果出现报错信息,以上解决步骤缺一不可 <1>、在安装pcre的时候可能遇到的问题:“libtool: line 990: g++: command not found” 解决办法:安装gcc-c++ #yum install gcc-c++ 在安装gcc-g++后我们继续make。g++问题解决了但是出现以下错误 ibtool: link: Fatalconfigurationerror. make[1]: *** [libpcrecpp.la] 错误 1 make[1]: Leaving directory `/usr/app/pcre-8.00' make: *** [all] 错误 2 现在我们需要操作的就是重新./configure并且make,如果问题依然没有得到解决并报错 /usr/bin/ld: .libs/pcrecpp.o: relocationR_X86_64_32S against `.bss'can not be used when making a shared object;recompile with -fPIC .libs/pcrecpp.o:couldnot read symbols: Bad value collect2: ld returned 1exit status make[1]: ***[libpcrecpp.la] 错误 1 make[1]: Leaving directory`/usr/app/pcre-8.00' make: *** [all] 错误 2 这次解决的办法是在配置的时候添加“--disable-shared --with-pic” # ./configure –prefix=/use/local/pcre –disable-shared–with-pic 以上问题都解决后我们可以继续安装apache了,在编译的时候我们需要加上“--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre” 如#./configure–prefix=/use/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
|