一、软件下载

二、环境检查

# rpm -qa|grep zlib
zlib-devel-1.2.3-3
zlib-1.2.3-3
# rpm -qa|grep ssl
openssl-devel-0.9.8b-10.el5
openssl-0.9.8b-10.el5
如果需要依赖包,安装其对应的devel包即可,此处仅用到zlib和ssl。另,如果有httpd包,要先卸载掉或停止其服务。

三、编译安装

1、针对安装目的的说明(来自INSTALL文件)

如果是开发者则使用此选项,--with-included-apr利于连接apache的代码或者是调试apache,其消除了由于版本或者编译中跟APR或者APR-util代码产生的不匹配;
如果从子版本编译apache,要先运行buildconf(需要Python,GNU autoconf和libtool),然后运行configure。发行包不用。
如果要在FreeBSD5.4之前编译时包含apache的threaded MPM,需要使用--enable-threads和--with-mpm 参数
在Mac上编译子版本,要使用GNU Libtool 1.4.2及以上版本
2、关于SSL加密和正则表达式(来自文件README)
    Apache2.0及以上版本在目录modules/ssl/下包含了mod_ssl模块用于配置和监听ssl网络接口的连接。(另外,一些apr-util版本在目录srclib/apr-util/ssl/下提供了ssl网络接口)带有单词crypto的包的名字,可能包含openssl加密库的目标代码。如果apache的加密功能不理想或者要排除再重分配,则可以使用包的名字包含nossl的发布包。
    Apache使用PCRE包包含的正则表达式。
3、对configure参数的说明
配置帮助表:
-h, --help显示帮助信息display this help and exit
--help=short用short参数将只显示正在运行的当前脚本的选项,而不能列出适用于Apache配置脚本所运行的外部配置脚本的选项display options specific to this package
--help=recursive使用recursive参数将显示所有程序包的简短描述display the short help of all the included packages
-V, --version显示版本display version information and exit
-q, --quiet, --silent不显示checking……信息do not print`checking...' messages
--cache-file=FILE
在指定文件中存储测试结果
cache test results in FILE [disabled]

-C, --config-cache
在文件config.cache中存储测试结果alias for `--cache file=config.cache'
-n, --no-createconfigure脚本运行结束后不输出结果文件,常用于正式编译前的测试。do not create output files
--srcdir=DIR源文件库所在目录find the sources in DIR [configure dir or `..']
安装目录:
--prefix=PREFIX体系无关文件的顶级安装目录PREFIX ,也就Apache的安装目录install architecture-independent files in PREFIX
[/usr/local/apache2]
--exec-prefix=EPREFIX体系相关文件的顶级安装目录EPREFIX ,把体系相关的文件安装到不同的位置可以方便地在不同主机之间共享体系相关的文件install architecture-dependent files in EPREFIX
[PREFIX]
默认情况下,make install 将会把所有文件分别安装到/usr/local/apache2/bin , /usr/local/apache2/lib 目录下。可以用 --prefix 指定一个不同于/usr/local/apache2的安装前缀,比如:--prefix=$HOME 。
By default, `make install' will install all the files in
`/usr/local/apache2/bin', `/usr/local/apache2/lib' etc.  You can specify
an installation prefix other than `/usr/local/apache2' using `--prefix',
for instance `--prefix=$HOME'.
详细安装目录设置:
默认安装目录参考config.layout,其中RHEL的默认目录设置如下:
    prefix:        /usr
    exec_prefix:   ${prefix}
    bindir:        ${prefix}/bin
    sbindir:       ${prefix}/sbin
    libdir:        ${prefix}/lib
    libexecdir:    ${prefix}/lib/apache
    mandir:        ${prefix}/man
    sysconfdir:    /etc/httpd/conf
    datadir:       /var/www
    installbuilddir: ${datadir}/build
    errordir:      ${datadir}/error
    iconsdir:      ${datadir}/icons
    htdocsdir:     ${datadir}/html
    manualdir:     ${datadir}/manual
    cgidir:        ${datadir}/cgi-bin
    includedir:    ${prefix}/include/apache
    localstatedir: /var
    runtimedir:    ${localstatedir}/run
    logfiledir:    ${localstatedir}/log/httpd
    proxycachedir: ${localstatedir}/cache/httpd
自设定详细安装目录
--bindir=DIR用户可执行目录DIR。用于存放对网站管理员很有帮助的htpasswd, dbmmanage之类的支持程序user executables [EPREFIX/bin]
--sbindir=DIR系统管理员可执行目录DIR ,用于存放运行HTTP服务器所必须的httpd, apachectl, suexec之类的服务程序system admin executables [EPREFIX/sbin]
--libexecdir=DIR程序可执行目录DIR ,也就是动态加载模块目录program executables [EPREFIX/libexec]
--sysconfdir=DIR只读的单一机器数据目录DIR ,用于存放httpd.conf和mime.types之类的服务器配置文件read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR可改写的体系无关数据目录DIRmodifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR可改写的单一机器数据目录DIRmodifiable single-machine data [PREFIX/var]
--libdir=DIR 对象代码库目录DIRobject code libraries [EPREFIX/lib]
--includedir=DIRApache的C头文件目录DIRC header files [PREFIX/include]
--oldincludedir=DIR非gcc的C头文件目录DIRC header files for non-gcc [/usr/include]
--datarootdir=DIRWeb服务器只读的体系无关数据根目录read-only arch.-independent data root [PREFIX/share]
--datadir=DIRWeb服务器只读的体系无关数据目录DIRread-only architecture-independent data [DATAROOTDIR]
--infodir=DIR信息文档目录DIRinfo documentation [DATAROOTDIR/info]
--localedir=DIR地区相关数据DIRlocale-dependent data [DATAROOTDIR/locale]
--mandir=DIR手册文档目录DIRman documentation [DATAROOTDIR/man]
--docdir=DIR手册目录documentation root [DATAROOTDIR/doc/PACKAGE]
--htmldir=DIRHTML格式帮助文档目录html documentation [DOCDIR]
--dvidir=DIRdvi格式帮助文档目录dvi documentation [DOCDIR]
--pdfdir=DIRpdf格式帮助文档目录pdf documentation [DOCDIR]
--psdir=DIRps格式帮助文档目录ps documentation [DOCDIR]
交叉编译选项:
这些选项用于交叉编译在其他平台上运行的Apache HTTP服务器。在同一平台上编译和运行Apache HTTP服务器通常不需要使用这些选项,脚本会自动检测并设置。
--build=BUILD指定编译工具所在系统的系统类型BUILDconfigure for building on BUILD [guessed]
--host=HOST指定Apache HTTP服务器将要进行交叉编译时运行的目标系统类型HOSTcross-compile to build programs to run on HOST [BUILD]
--target=TARGET指定交叉编译所产生的目标代码类型configure for building compilers for TARGET [HOST]
特征选项:
--disable-option-checking忽略无法识别的enable或with选项ignore unrecognized --enable/--with options
--disable-FEATURE不使用任何软件特性do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] 使用软件特性include FEATURE [ARG=yes]
--enable-layout=LAYOUT预定义的安装路径布局。选项使用config.layout文件中的配置。只使用"--enable-layout", 而不指定LAYOUT, 相当于"--enable-layout=Apache" 
--enable-v4-mapped使用相同的套接字同时处理IPv4和IPv6的连接,也就是启用地址映射。在FreeBSD、NetBSD、OpenBSD以外的平台上是默认值。Allow IPv6 sockets to handle IPv4 connections
--enable-exception-hook允许在子进程崩溃以后启用一个钩子来运行异常处理程序。Enable fatal exception hook
--enable-maintainer-mode使用所有警告和调试符号编译源代码,请勿用于正式服务器,它会影响性能。Turn on debugging and compile time warnings



--enable-pie
编译http作为一个独立的可执行文件。Build httpd as a Position Independent Executable
--enable-modules=MODULE-LIST启用的模块,用空格分别列出,或使用all,most列出所有或常用的模块。Space-separated list of modules to enable | "all" |
"most"
--enable-mods-shared=MODULE-LIST启用的共享DSO模块,用空格分别列出,或使用all,most列出所有或常用的共享DOS模块。(注1)Space-separated list of shared modules to enable |
"all" | "most"
--disable-authn-file禁用基于文件的验证控制file-based authentication control
--enable-authn-dbm启用基于DBM的验证机制DBM-based authentication control

--enable-authn-anon

启用匿名的验证机制anonymous user authentication control
--enable-authn-dbd启用基于SQL的验证机制SQL-based authentication control
--disable-authn-default禁止默认的验证机制方式backstopperauthentication backstopper
--enable-authn-alias启用别名验证auth provider alias
--disable-authz-host禁用基于主机的授权机制
host-based authorization control
--disable-authz-groupfile禁用组授权机制'require group' authorization control
--disable-authz-user禁用用户授权机制'require user' authorization control
--enable-authz-dbm基于DBM数据库的授权机制DBM-based authorization control
--enable-authz-owner基于文件所有者的授权机制'require file-owner' authorization control
--enable-authnz-ldap启用基于LDAP的的授权方式LDAP based authentication
--disable-authz-default禁用默认的backstopper授权方式authorization control backstopper
--disable-auth-basic禁用基本验证basic authentication
--enable-auth-digest启用RFC2617摘要式身份验证RFC2617 Digest authentication
--enable-isapi启用ISAPI扩展支持(注2)isapi extension support
--enable-file-cache启用文件缓存File cache
--enable-cache启用动态文件缓存dynamic file caching
--enable-disk-cache
启用磁盘缓存模块
disk caching module
--enable-mem-cache启用内存缓存模块memory caching module
--enable-dbd启用apache的DBD框架Apache DBD Framework
--enable-bucketeer水桶操作过滤器buckets manipulation filter
--enable-dumpioI/O转储过滤器I/O dump filter
--enable-echo启用回显服务ECHO server
--enable-example实例和演示模块example and demo module
--enable-case-filter启用大写转换过滤器example uppercase conversion filter
--enable-case-filter-in启用大写转换输入过滤器example uppercase conversion input filter
--enable-ext-filter扩展过滤模块external filter module
--disable-include禁用服务器端嵌入(SSI)Server Side Includes
--disable-filter禁用智能过滤Smart Filtering
--enable-substitute答复的内容重写式过滤response content rewrite-like filtering
--disable-charset-lite禁用字符集转换character set translation
--enable-charset-lite启用字符集转换character set translation
--enable-deflate压缩转换编码支持Deflate transfer encoding support
--enable-ldap启用LDAP的高速缓存和连接池服务LDAP caching and connection pooling services
--disable-log-config禁用日志配置logging configuration
--enable-log-forensic启用forensic日志记录forensic logging
--enable-logio输入和输出记录input and output logging
--disable-env禁用环境变量,清除设置环境变量clearing/setting of ENV vars
--enable-mime-magic自动确定MIME类型automagically determining MIME type
--enable-cern-meta 启用CERN类型元文件CERN-type meta files
--enable-expires头部有效期控制Expires header control
--enable-headersHTTP头控制HTTPheader control
--enable-identRFC 1413身份检查RFC 1413 identity check
--enable-usertrack用户session跟踪user-session tracking
--enable-unique-id启用每个请求唯一的IDper-request unique ids
--disable-setenvif基于头部的环境变量basing ENV vars on headers
--disable-version通过配置文件中决定http版本determining httpd version in config files
--enable-proxy apache代理模块Apache proxy module
--enable-proxy-connect apache代理连接模块Apache proxy CONNECT module
--enable-proxy-ftp apache代理ftp模块Apache proxy FTP module
--enable-proxy-httpapache代理http模块Apache proxy HTTP module
--enable-proxy-ajpapache代理ajp模块Apache proxy AJP module
--enable-proxy-balancerapache代理balancer模块Apache proxy BALANCER module
--enable-ssl启用ssl支持SSL/TLS support (mod_ssl)
--enable-distcache在mod_ssl模块中启用Distcache。磁盘缓存(Distcache)用于分布式的会话缓存。主要用在 SSL/TLS 服务器。它可以被 Apache 使用。大多数的台式机应该关闭它。Select distcache support in mod_ssl
--enable-optional-hook-export启用可选钩子输出者示例example optional hook exporter
--enable-optional-hook-import启用可选钩子输入者示例example optional hook importer
--enable-optional-fn-import启用可选函数输入者示例example optional function importer
--enable-optional-fn-export启用可选函数输出者示例example optional function exporter
--enable-static-support为所支持的二进制文件建立一个静态链接的版本Build a statically linked version of the support binaries
--enable-static-htpasswd建立静态版本的htpasswdBuild a statically linked version of htpasswd
--enable-static-htdigest建立htdigest的静态版本Build a statically linked version of htdigest
--enable-static-rotatelogs建立rotatelogs的静态版本Build a statically linked version of rotatelogs
--enable-static-logresolve建立logresolve的静态版本Build a statically linked version of logresolve
--enable-static-htdbm建立htdbm的静态版本Build a statically linked version of htdbm
--enable-static-ab建立ab的静态版本Build a statically linked version of ab
--enable-static-checkgid建立checkgid的静态版本Build a statically linked version of checkgid
--enable-static-htcacheclean建立htcacheclean的静态版本Build a statically linked version of htcacheclean
--enable-static-httxt2dbm建立httxt2dbm的静态版本Build a statically linked version of httxt2dbm
--enable-http启用http协议处理HTTP protocol handling
--disable-mime禁用映射文件扩展名到mime类型mapping of file-extension to MIME
--enable-dav启用webdav协议处理WebDAV protocol handling
--disable-status禁用进程或线程的监控process/thread monitoring
--disable-autoindex禁用目录列表directory listing
--disable-asis禁用as-is文件类型as-is filetypes
--enable-info启用服务器信息server information
--enable-suexec启用suexec,为产生的进程设置uid和gidset uid and gid for spawned processes
--disable-cgid禁用CGIDCGI scripts
--enable-cgi启用CGICGI scripts
--disable-cgi 禁用CGICGI scripts
--enable-cgid启用CGIDCGI scripts
--enable-dav-fs启用DAV文件系统提供者DAV provider for the filesystem
--enable-dav-lock启用DAV提供者的一般锁定DAV provider for generic locking
--enable-vhost-alias启用大规模的虚拟主机模块mass virtual hosting module
--disable-negotiation禁用内容协商content negotiation
--disable-dir禁用目录请求处理directory request handling
--enable-p_w_picpathmap
启用服务器端图片映射图
server-side p_w_picpathmaps
--disable-actions禁用请求上的行为触发器Action triggering on requests
--enable-speling启用常见的URL拼写错误纠正correct common URL misspellings
--disable-userdir
禁用特定用户目录的请求的映射
mapping of requests to user-specific directories
--disable-alias禁用不同文件系统部分的请求的映射mapping of requests to different filesystem parts
--enable-rewrite基本的URL操纵规则,即启用URL重写规则rule based URL manipulation
--enable-so启用DSO性能DSO capability
注:
1、模块列表:
基本(B)模块默认包含,必须明确禁用;扩展(E)/实验(X)模块默认不包含,必须明确启用
模块名称状态简要描述
mod_actions(B)基于媒体类型或请求方法,为执行CGI脚本而提供
mod_alias(B)提供从文件系统的不同部分到文档树的映射和URL重定向
mod_asis(B)发送自己包含HTTP头内容的文件
mod_auth_basic(B)使用基本认证
mod_authn_default(B)在未正确配置认证模块的情况下简单拒绝一切认证信息
mod_authn_file(B)使用纯文本文件为认证提供支持
mod_authz_default(B)在未正确配置授权支持模块的情况下简单拒绝一切授权请求
mod_authz_groupfile(B)使用纯文本文件为组提供授权支持
mod_authz_host(B)供基于主机名、IP地址、请求特征的访问控制
mod_authz_user(B)基于每个用户提供授权支持
mod_autoindex(B)自动对目录中的内容生成列表,类似于"ls"或"dir"命令
mod_cgi(B)在非线程型MPM(prefork)上提供对CGI脚本执行的支持
mod_cgid(B)在线程型MPM(worker)上用一个外部CGI守护进程执行CGI脚本
mod_dir(B)指定目录索引文件以及为目录提供"尾斜杠"重定向
mod_env(B)允许Apache修改或清除传送到CGI脚本和SSI页面的环境变量
mod_filter(B)根据上下文实际情况对输出过滤器进行动态配置
mod_p_w_picpathmap(B)处理服务器端图像映射
mod_include(B)实现服务端包含文档(SSI)处理
mod_isapi(B)仅限于在Windows平台上实现ISAPI扩展
mod_log_config(B)允许记录日志和定制日志文件格式
mod_mime(B)根据文件扩展名决定应答的行为(处理器/过滤器)和内容(MIME类型/语言/字符集/编码)
mod_negotiation(B)提供内容协商支持
mod_nw_ssl(B)仅限于在NetWare平台上实现SSL加密支持
mod_setenvif(B)根据客户端请求头字段设置环境变量
mod_status(B)生成描述服务器状态的Web页面
mod_userdir(B)允许用户从自己的主目录中提供页面(使用"/~username")
mod_auth_digest(X)使用MD5摘要认证(更安全,但是只有最新的浏览器才支持)
mod_authn_alias(E)基于实际认证支持者创建扩展的认证支持者,并为它起一个别名以便于引用
mod_authn_anon(E)提供匿名用户认证支持
mod_authn_dbd(E)使用SQL数据库为认证提供支持
mod_authn_dbm(E)使用DBM数据库为认证提供支持
mod_authnz_ldap(E)允许使用一个LDAP目录存储用户名和密码数据库来执行基本认证和授权
mod_authz_dbm(E)使用DBM数据库文件为组提供授权支持
mod_authz_owner(E)基于文件的所有者进行授权
mod_cache(E)基于URI键的内容动态缓冲(内存或磁盘)
mod_cern_meta(E)允许Apache使用CERN httpd元文件,从而可以在发送文件时对头进行修改
mod_charset_lite(X)允许对页面进行字符集转换
mod_dav(E)允许Apache提供DAV协议支持
mod_dav_fs(E)为mod_dav访问服务器上的文件系统提供支持
mod_dav_lock(E)为mod_dav锁定服务器上的文件提供支持
mod_dbd(E)管理SQL数据库连接,为需要数据库功能的模块提供支持
mod_deflate(E)压缩发送给客户端的内容
mod_disk_cache(E)基于磁盘的缓冲管理器
mod_dumpio(E)将所有I/O操作转储到错误日志中
mod_echo(X)一个很简单的协议演示模块
mod_example(X)一个很简单的Apache模块API演示模块
mod_expires(E)允许通过配置文件控制HTTP的"Expires:"和"Cache-Control:"头内容
mod_ext_filter(E)使用外部程序作为过滤器
mod_file_cache(X)提供文件描述符缓存支持,从而提高Apache性能
mod_headers(E)允许通过配置文件控制任意的HTTP请求和应答头信息
mod_ident(E)实现RFC1413规定的ident查找
mod_info(E)生成Apache配置情况的Web页面
mod_ldap(E)为其它LDAP模块提供LDAP连接池和结果缓冲服务
mod_log_forensic(E)实现"对比日志",即在请求被处理之前和处理完成之后进行两次记录
mod_logio(E)对每个请求的输入/输出字节数以及HTTP头进行日志记录
mod_mem_cache(E)基于内存的缓冲管理器
mod_mime_magic(E)通过读取部分文件内容自动猜测文件的MIME类型
mod_proxy(E)提供HTTP/1.1的代理/网关功能支持
mod_proxy_ajp(E)mod_proxy的扩展,提供Apache JServ Protocol支持
mod_proxy_balancer(E)mod_proxy的扩展,提供负载平衡支持
mod_proxy_connect(E)mod_proxy的扩展,提供对处理HTTP CONNECT方法的支持
mod_proxy_ftp(E)mod_proxy的FTP支持模块
mod_proxy_http(E)mod_proxy的HTTP支持模块
mod_rewrite(E)一个基于一定规则的实时重写URL请求的引擎
mod_so(E)允许运行时加载DSO模块
mod_speling(E)自动纠正URL中的拼写错误
mod_ssl(E)使用安全套接字层(SSL)和传输层安全(TLS)协议实现高强度加密传输
mod_suexec(E)使用与调用web服务器的用户不同的用户身份来运行CGI和SSI程序
mod_unique_id(E)为每个请求生成唯一的标识以便跟踪
mod_usertrack(E)使用Session跟踪用户(会发送很多Cookie),以记录用户的点击流
mod_version(E)提供基于版本的配置段支持
mod_vhost_alias(E)提供大批量虚拟主机的动态配置支持
2、Apache HTTP服务器是一个模块化的软件,管理员可以通过选择服务器中包含的模块进行功能增减。模块可以在编译时被静态包含进httpd二进制文件,也可以编译成独立于httpd二进制文件的动态共享对象(DSO)。DSO模块可以与服务器一起编译,也可以用Apache扩展工具(apxs)单独编译。
3、ISAPI 服务器扩展是可以被 HTTP 服务器加载和调用的 DLL。Internet 服务器扩展也称为 Internet 服务器应用程序 (ISA),用于增强符合 Internet 服务器 API (ISAPI) 的服务器的功能。ISA 通过浏览器应用程序调用,并且将相似的功能提供给通用网关接口 (CGI) 应用程序。
可选包选项:
--with-PACKAGE[=ARG]包含包的语法use PACKAGE [ARG=yes]
--without-PACKAGE不使用该包语法do not use PACKAGE (same as --with-PACKAGE=no)
--with-included-apr捆绑拷贝apr/apr-util信息Use bundled copies of APR/APR-Util
--with-apr=PATHapr的安装目录prefix for installed APR or the full path to
--with-apr-util=PATHapu的安装目录prefix for installed APU or the full path to apu-config
--with-pcre=PATH使用扩展的PCRE正则表达式库Use external PCRE library
--with-port=PORT监听端口Port on which to listen (default is 80)
--with-sslport=SSLPORTssl的监听端口Port on which to securelisten (default is 443)
--with-z=DIRzlib的库文件位置use a specific zlib library
--with-sslc=DIRRSA SSL-C SSL/TLS软件包目录RSA SSL-C SSL/TLS toolkit
--with-ssl=DIRopenssl包的位置。OpenSSL SSL/TLS toolkit
--with-mpm=MPM选择apache所使用的处理模块。(注1)Choose the process model for Apache to use.
MPM={beos|event|worker|prefork|mpmt_os2}
--with-module=module-type:module-file添加第三方模块。(注2)Enable module-file in the modules/<module-type>directory.
--with-program-name指定可执行程序的名字[默认为:httpd],若使用此选项则默认配置文件的名字将同时变成"NAME.conf"。alternate executable name
--with-suexec-binsuexec二进制文件目录[默认--sbindir]Path to suexec binary
--with-suexec-calle允许调用suexec的用户,改用户必须和运行httpd子进程的用户相同User allowed to call SuExec
--with-suexec-userdir用户主目录下允许suexec对其中的文件具有执行权限的子目录,仅在将suexec和用户网站目录(由mod_userdir提供支持)一起使用的情况下才需要设置此选项[public_html]User subdirectory
--with-suexec-docroot允许suexec对其中的文件具有执行权限的根目录[--datadir/htdocs]SuExec root directory
--with-suexec-uidmin允许执行suexec的最小UID[100]Minimal allowed UID
--with-suexec-gidmin允许执行suexec的最小GID[100]Minimal allowed GID

--with-suexec-logfile
suexec日志文件名[默认文件名为:suexec_log ,位于--logfiledir目录下]Set the logfile
--with-suexec-safepath对suexec"安全"的PATH环境变量的值[/usr/local/bin:/usr/bin:/bin]Set the safepath
--with-suexec-umasksuexec进程的umask[取决于系统的设定]umask for suexec'd process
注:1、MPM是你想要使用的多路处理模块的名字。如果你不使用这个选项,那么将会使用对应于各平台的默认MPM。
2、module-file是模块的源代码文件名,该文件必须位于Apahe源代码目录树的"modules/module-type"目录下,如果configure没有在那里找到module-file ,则将它看作一个绝对路径名并尝试将其复制到"modules/module-type"目录中,如果"modules/module-type"目录不存在,configure将新建一个"modules/module-type"目录并在其中放置一个标准的Makefile.in文件。这种方法有两个明显的缺陷:模块的源代码必须是单一文件;模块只能静态连接进核心,而不能作为DSO模块。所以一般并不使用此方法,而是使用apxs(Apache扩展工具)来添加第三方模块支持。
编译器选项:
CC指定的C编译器C compiler command
CFLAGSC编译器的FLAGSC compiler flags
LDFLAGS连接器flags,比如使用"-L-Llibdir"指定一个非标准的库文件目录libdirlinker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>
LIBS 设定线程模型libraries to pass to the linker, e.g. -l<library>
CPPFLAGSC/C++预处理程序flags,比如使用"-Iincludedir"指定一个非标准的头文件目录includedirC/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPPC预处理程序C preprocessor

4、编译安装

./configure --prefix=/usr/local/apache --enable-authn-dbm --enable-authz-dbm --enable-ssl --enable-vhost-alias --enable-rewrite --enable-so --enable-charset-lite --enable-deflate --with-z --with-ssl --with-mpm=prefork
make
make install

四、服务配置

1、配置文件概述

1>Apache的配置文件是包含若干指令的纯文本文件。主配置文件通常叫 httpd.conf ,其位置是编译时确定的,但可以用命令行参数 -f 来改变。Apache配置文件的每一行包含一个指令,在行尾使用反斜杠"\"可以表示续行,但是反斜杠与下一行之间不能有任何其他字符(包括空白字符)。配置文件中的指令是不区分大小写的,但是指令的参数(argument)通常是大小写敏感的。以"#"开头的行被视为注解并被忽略。注解不能出现在指令的后边。空白行和指令前的空白字符将被忽略,因此可以采用缩进以保持配置层次的清晰。主配置文件更改后重新启动Apache后才会生效。可以用 apachectl configtest 或者命令行选项 -t 检查配置文件中的错误,而无须启动Apache服务器。
2>配置文件中可以用Include指令和通配符附加许多其他配置文件。任何配置文件都可以使用任何指令。
3>服务器还会读取一个包含MIME文件类型的文件,其文件名由TypesConfig指令确定,默认值是 mime.types。
4>Apache是模块化的服务器,这意味着核心中只包含实现最基本功能的模块。扩展功能可以作为模块动态加载。默认情况下,只有base组的模块被编译进了服务器。如果服务器在编译时包含了DSO模块,那么各模块可以独立编译,并可随时用LoadModule指令加载;否则,要增加或删除模块必须重新编译整个Apache。用于特定模块的指令可以用<IfModule>指令包含起来,使之有条件地生效。命令行参数 -l 可以查看已经编译到服务器中的模块。