RedHat安装Apache Http Server实践

来源:互联网 发布:长沙百度seo 编辑:程序博客网 时间:2024/04/30 03:12

简述:在Linux RedHat系统使用Apache Http Server源码安装过程中,老遇到RedHat系统中缺少包的问题,在这里记录下来,以免遇到同样问题的同志可以参考。

准备工作:

下载httpd:wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.2.21.tar.gz

下载APR:wget http://archive.apache.org/dist/apr/apr-1.4.2.tar.gz 

 下载ARP Util:wget http://archive.apache.org/dist/apr/apr-util-1.3.10.tar.gz 

 下载PCRE:wget http://optimate.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.zip

 4个依懒的包下载:apr-1.4.2.tar.gz,apr-util-1.3.10.tar.gz,httpd-2.4.7.tar.bz2,pcre-8.33.zip


1.在执行Apache Http Server报:APR错误

#./configure --prefix ##检查编辑环境时出现:
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 )
下载:wget http://archive.apache.org/dist/apr/apr-1.4.2.tar.gz 
#tar -zxvf apr-1.4.2.tar.gz #unzip -o apr-1.4.2.zip#cd apr-1.4.2#./configure#make#make install

2.再次执行配置时报:APR-Util错误
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

下载:wget http://archive.apache.org/dist/apr/apr-util-1.3.10.tar.gz 
#tar -zxvf apr-util-1.3.10.tar.gz#cd apr-util-1.3.10#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr#make#make install

3.再次执行时还是报错:pcre-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


下载:wget http://optimate.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.zip
#unzip -o pcre-8.33.zip#cd  pcre-8.33#./configure --prefix=/usr/local/pcre#make#make install

4.这次再次执行时应该不会报错了,祝你安装成功。不过安装时最好加上一些参数:
#./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre

5.接下来就是启动Apache http Server了。如果没有配置conf/httpd.conf会报错,先配置conf/httpd.conf文件
#vi conf/httpd.conf ##找到ServerName,添加一行代码:ServerName localhost:80#apachectl start

文章推荐:http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/install.html


0 0