偶是新手,将自己的实做写下来,请大家斧正。
源码安装的方法大致就是那些了,我们由于后面要安装php,并将php作为动态链接库,因此会加些参数
shell>tar -zxvf * 用tar命令解压
shell>cd /* 进入刚刚解压好的目录
shell>./configure --prefix=/usr/local/apache --enable-so --enable-rewrite 生成makefile文件并指定安装目录
Error:configure: error: APR not found. Please read the documentation.
搜集资料,是没有安装apr
shell>yum list | grep apr
apr.i386 1.2.7-11.el5_6.5 installed
apr.x86_64 1.2.7-11.el5_6.5 installed
apr-util.i386 1.2.7-11.el5_5.2 instal led
apr-util.x86_64 1.2.7-11.el5_5.2 installed
xorg-x11-drv-dynapro.x86_64 1.1.0-2 installed
apr-devel.i386 1.2.7-11.el5_6.5 base
apr-devel.x86_64 1.2.7-11.el5_6.5 base
apr-docs.x86_64 1.2.7-11.el5_6.5 base
apr-util-devel.i386 1.2.7-11.el5_5.2 base
apr-util-devel.x86_64 1.2.7-11.el5_5.2 base
apr-util-docs.x86_64 1.2.7-11.el5_5.2 base
apr-util-mysql.x86_64 1.2.7-11.el5_5.2 base
我用的是centos5.X系统
shell>yum install apr-devel.x86_64 apr-util-devel.x86_64 安装apr
shell>./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
shell>yum install pcre-devel.x86_64 安装pcre
shell>./configure --prefix=/usr/local/apache --enable-so --enable-rewrite
configure: error: APR version 1.3.0 or later is required
那么很明显这个错误时因为apr的版本比较新造成的,解决方法是安装较新的apr
shell>vim INSTALL
有这样一段话:Consider if you want to use a previously installed APR and
APR-Util (such as those provided with many OSes) or if you
need to use the APR and APR-Util from the apr.apache.org
project. If the latter, download the latest versions and
unpack them to ./srclib/apr and ./srclib/apr-util (no
version numbers in the directory names) and use
./configure's --with-included-apr option.
在srclib下面创建两个目录,apr和apr-util,并下载最新版本source解压缩到相应目录
shell>./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --with-included-apr
Ok ,you get you want.
shell>make clean & make
shell>make install
到这里成功安装apache了
剩下的工作就是添加man路径和path路径了。
well done!!