5)执行configure脚本
简要介绍一些 ./configure -h 查看出来的参数。
--prefix=/usr/local/apache 设定安装目录。
--enable-module=so》打开so模块。
--enable-deflate=shared》支持网页压缩
--enable-cache》支持缓存
--enable-file-cache》支持文件缓存
--enable-mem-cache》支持记忆缓存
--enable-disk-caceh》支持磁盘缓存
--enable-static-support 》支持静态链接。默认是动态链接。
--enable-static-htpasswd》基于认证的用户文件
--enable-static-htdigest》链接编译htdigest-用户管理用户文件。
--enable-static-rotatelogs》用于滚动日志的。
--enable-static-logresolve》用于解析日志的
--enable-static-htdbm 》用于操作DBM密码数据库。
--enable-static-ab 》链接apache服务性能测试工具的。
--with-mpm=worker》以worker工作模式运行。常用的有prefork和worker
--enable是启用--disable就是禁用了。
编译:
./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so 安装遇到的错误如下:

解决办法是少apr包。
1)wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
tar -zxf apr-1.4.5.tar.gz
cd apr-1.4.5
./configure --prefix=/usr/local/apr
make
make install
在此执行又报错:

解决办法:
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
unzip -o pcre-8.10.zip
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make && make install
在此执行编译需要加上上面新安装的包的路径。
./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --with-apr=/usr/local/apr --with-pcre=/usr/local/pcre

没有error成功。
6)安装
make && make install
安装完成了。
定义二进制访问:
vim /etc/profile.d/apache.sh
PATH=/usr/local/apache/bin:/usr/local/apache/sbin:$PATH
source /etc/profile.d/apache.sh让文件生效。
apachetl start启动
netstat -tanl 查看80端口。
http://server 访问显示work成功。apache就搭建好了。
