apache的安装及相关的错误解决方案

apache的安装:

1: 下载apache sever
wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.4.tar.gz

2: 解压缩:
cd /usr/local/
tar -zvxf httpd-2.4.4.tar.gz

3:编译安装
cd /usr/local/httpd-2.4.4

./configure --prefix=/usr/local/apache --enable-module=so --enable-mods-shared=all --enable-so --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support --enable-static-htpasswd --enable-static-htdigest --enable-static-rotatelogs --enable-static-logresolve --enable-static-htdbm --enable-static-ab --enable-static-checkgid --enable-mod_cgi --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-ssl --enable-proxy --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-pcre=/usr/local/pcre/bin/pcre-config --with-mpm=worker

4:安装

make && make install

5:启动

/usr/local/apache/bin
./apachectl start

*************************************************************************************************************************************

缺乏相关的依赖:

1.下载所需软件包:
wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
wget http://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

 a:解决apr not found问题

[root@xt test]# tar -zxf apr-1.4.5.tar.gz 
[root@xt test]# cd  apr-1.4.5 
[root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr 
[root@xt apr-1.4.5]# make && make install    

b:解决APR-util not found问题
[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz 
[root@xt test]# cd apr-util-1.3.12 
[root@xt apr-util-1.3.12]#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config 
[root@xt apr-util-1.3.12]# make && make install 
 
 c:解决pcre问题
[root@xt test]#unzip -o pcre-8.10.zip 
[root@xt test]#cd pcre-8.10 
[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre  --with-apr=/usr/local/apr/bin/apr-1-config
[root@xt pcre-8.10]#make && make install


编译apach的时候,加上这些
--with-apr=/usr/local/apr/bin/apr-1-config
--with-apr=/usr/local/apr-util/bin/apu-1-confi
--with-pcre=/usr/local/pcre/bin/pcre-confi

----------------------------------------------------------------------------------------------------

 缺乏相应的环境:

1:安装gcc

checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/tools':
configure: error: no acceptable C compiler found in $PATH


安装gcc编译器即可: # yum -y install gcc

----------------------------------------------------------------------------------------------------

2:安装gcc++编译环境

安装gcc++编译器即可: # yum install -y gcc-c++

----------------------------------------------------------------------------------------------------

3:其他编译环境

configure: error: XXX has been requested but can not be built due to prerequisite failures

1:mod_deflate :

      centos下可以采用yum install zlib-devel, ubuntu下可以采用apt-get install zlib1g-dev.


2:mod_ssl:

       解决办法 yum install openssl-devel  yum update openssl

猜你喜欢

转载自shiguanghui.iteye.com/blog/1856915
今日推荐