apache2.4的特殊之处
Apache 2.4的源文件中,删除了必要的apr和apr-util等程序包,直接编译2.4的时候,会提示各种出错。
2.4的官方文档有详细的描述
APR and APR-Util
Make sure you have APR and APR-Util already installed on your system. If you don’t, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR, unpack them into /httpd_source_tree_root/srclib/apr and /httpd_source_tree_root/srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under /httpd_source_tree_root/srclib/apr/) and use ./configure’s –with-included-apr option. On some platforms, you may have to install the corresponding -dev packages to allow httpd to build against your installed copy of APR and APR-Util.
Perl-Compatible Regular Expressions Library (PCRE)
This library is required but not longer bundled with httpd. Download the source code from http://www.pcre.org, or install a Port or Package. If your build system can’t find the pcre-config script installed by the PCRE build, point to it using the –with-pcre parameter. On some platforms, you may have to install the corresponding -dev package to allow httpd to build against your installed copy of PCRE.
大致意思为
编译Apache 2.4前,确保APR和APR-Util已经安装,如果没有安装,或者不想使用系统提供的APR版本,从APR网站下载最新版本的APR和APR-Util,将它们解压缩到apache2.4源代码的srclib目录,不能带版本号,即
/httpd-source-tree-root/srblic/apr/
。
apache用到PCRE,2.4版本没有包括PCRE模块。从PCRE上下载源代码,编译安装。
apache ./configure的时候,使用–with-included-apr包含apr源码,使用–with-pcre指定编译安装后的PCRE位置。
下面简单记录ubuntu下编译安装apache 2.4的过程
环境准备
1 | apt-get update |
pcre下载有点麻烦,http下载方式被墙,ftp方式还可以用。找到下载链接后,直接wget。
编译pcre到/apache2/pcre
1 | cd /apache2 |
编译apache2到/apache2/httpd
1 |
|