今天安装了下Apache2.4。
有需要的朋友可以在这里下载:
http://down.51cto.com/data/660006
安装环境:
Redhat 5: Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
所需安装包:
apr-1.4.6.tar.gz apr-util-1.5.1.tar.gz httpd-2.4.3.tar.bz2安装步骤:
1、安装apr-1.4.6.tar.gz
#tar zxvf apr-1.4.6.tar.gz #cd apr-1.4.6 #ls #./configure --prefix=/usr/local/apache24/apr #make #make install解释:--prefix指定安装路径,将apr包安装在/usr/local/apache24/apr
2、安装apr-util-1.5.1.tar.gz
#tar zxvf apr-util-1.5.1.tar.gz #cd apr-util-1.5.1 #ls #./configure --prefix=/usr/local/apache24/apr-util --with-apr=/usr/local/apache24/apr/ #make && make install解释:--prefix指定安装路径,将apr包安装在/usr/local/apache24/apr-util。
--with指定与当前安装包的关联文件路径。如果没有--with这一项,会提示错误:
checking for APR... no
configure: error: APR not found. Please read the documentation.
3、安装httpd-2.4.3.tar.gz
#tar -jxvf httpd-2.4.3.tar.bz2 #cd httpd-2.4.3 #ls #./configure --prefix=/usr/local/apache24/apache2.4 --with-apr=/usr/local/apache24/apr/ --with-apr-util=/usr/local/apache24/apr-util/ #make && make install
这个就不用解释了,跟第2步一样。否则会提示:
configure: error: APR not found. Please read the documentation. 或是 configure: error: APR-util not found. Please read the documentation这两个错误。不知道 它所需要的apr包和apr-util在哪?
4、测试
进到Apache安装目录,启动Apache服务。 #cd /usr/local/apache24/apache2.4/bin #./apachectl start 然后打开浏览器输入192.168.0.100(这ip是我的机器ip,要是在本机上也可以输127.0.0.1) 就会看到下面的结果了。
可能出现问题:
1、configure: error: APR version 1.3.0 or later is required
说明apr的版本太低,需要安装较高版本的apr-uti或是apr
2、configure: error: in `/opt/apr-1.4.6':
configure: error: no acceptable C compiler found in $PATH
说明未安装gcc,需要安装gcc。那就这个Linux的系统盘或是iso文件,挂载上来,要是挂上了,在/media下面会有CDROM目录。如果没挂上的话,那就只能打开Linux系统盘或是iso文件,然后进到Server下面,会找到gcc的rpm安装包,然后以此安装:
#cd Server/ #ls #rpm -ivh libgcc-4.1.1-52.el5.i386.rpm #rpm -ivh glibc-devel-2.5-12.i386.rpm #rpm -ivh glibc-headers-2.5-12.i386.rpm #rpm -ivh glibc-devel-2.5-12.i386.rpm #rpm -ivh gcc-4.1.1-52.el5.i386.rpm3、configure: error: pcre-config for libpcre not found. PCRE is required and available from
跟上一个一样,进到Server里: [root@localhost Server]# rpm -ivh pcre-devel-6.6-1.1.i386.rpm warning: pcre-devel-6.6-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:pcre-devel ########################################### [100%] [root@localhost Server]# rpm -ivh pcre- pcre-6.6-1.1.i386.rpm pcre-devel-6.6-1.1.i386.rpm [root@localhost Server]# rpm -ivh pcre-6.6-1.1.i386.rpm warning: pcre-6.6-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] package pcre-6.6-1.1 is already installed [root@localhost Server]#4、安装时可能会提示缺少libgomp、cpp这两个库文件。
同样还是进到Server文件夹里:
#rpm -ivh libgomp-4.1.1-52.el5.i386.rpm #rpm -ivh cpp-4.1.1-52.el5.i386.rpm
5、出现configure: error: APR not found. Please read the documentation.和configure: error: APR-util not found. Please read the documentation这个错误。