Apache2.4的安装步骤

今天安装了下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在哪?

只不过将Apache安装在/usr/local/apache24/apache2.4中

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.rpm
3、configure: error: pcre-config for libpcre not found. PCRE is required and available from
说明缺少pcre关联包,需要安装。
跟上一个一样,进到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这个错误。

转载于:https://my.oschina.net/skyjilygao/blog/101560

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值