[root@192 httpd-2.2.31]# ./configure -h
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables 指定环境变量(e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration: 配置选项
-h, --help display this help and exit 显示帮助信息然后退出。
--help=short display options specific to this package 使用short参数将只显示正在运行的当前脚本的选项,而不能列出适用于Apache配置脚本所运行的外部配置脚本的选项。
--help=recursive display the short help of all the included packages 使用recursive参数将显示所有程序包的简短描述。
-V, --version display version information and exit 显示版权信息后退出。
-q, --quiet, --silent do not print `checking ...' messages 不显示脚本工作期间输出的"checking ..."消息。
--cache-file=FILE cache test results in FILE [disabled] 在FILE文件中缓存测试结果[默认禁用]
-C, --config-cache alias for `--cache-file=config.cache' config的缓存
-n, --no-create do not create output files configure脚本运行结束后不输出结果文件,常用于正式编译前的测试。
--srcdir=DIR find the sources in DIR [configure dir or `..'] 指定源代码所在目录DIR
Installation directories: 安装目录
--prefix=PREFIX install architecture-independent files in PREFIX 安装目录,如果不指定prefix参数,默认安装到“/usr/local/apache2”
[/usr/local/apache2]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
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'.
For better control, use the options below.
Fine tuning of the installation directories: 安装目录微调
--bindir=DIR user executables [EPREFIX/bin] 用户可执行二进制文件目录DIR 。用于存放对网站管理员很有帮助的htpasswd, dbmmanage之类的支持程序。
--sbindir=DIR system admin executables [EPREFIX/sbin] 超级用户执行的程序。
--libexecdir=DIR program executables [EPREFIX/libexec] 指定可执行支持文件的安装位置。与二进制文件相反,这些文件从来不直接由用户执行,但是可以被上面提到的二进制文件所执行
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] 系统配置文件存放目录。
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] 可写的单一机器数据目录DIR
--libdir=DIR object code libraries [EPREFIX/lib] 库文件存放目录
--includedir=DIR C header files [PREFIX/include] 头文件存放目录
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man] 手册存放目录
--docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] 文档存放目录
--htmldir=DIR html documentation [DOCDIR] html格式的文档存放目录
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR] pdf格式的文档存放目录
--psdir=DIR ps documentation [DOCDIR]
System types: 系统类型
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
Optional Features: 可选特性(模块选项)。
有两种使用模块的方法:一是静态连接进核心,二是作为DSO模块动态加载;如果编译中包含任何DSO模块,则mod_so会被自动包含进核心。如果希望核心能够装载DSO,但不实际编译任何DSO模块,则需明确指定"--enable-so=static"。
--disable-option-checking ignore unrecognized --enable/--with options
忽略未被认出的enable/with选项
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
不包含的特性。FEATURE是特性名字(也即模块名),例如:--disable-ssl 。
禁用MODULE模块(仅用于基本模块),基本模块见下面的列表。
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
包含什么特性。例如:--enable-rewrite 。
--enable-layout=LAYOUT
使用名为LAYOUT的布局配置所有源代码和编译脚本。这样就允许你在安装时分别指定不同文件的安装位置。config.layout文件中包含了默认布局的示例,你可以根据它创建你自己的布局。这个文件中的不同布局使用...段进行分组,其中的FOO就是布局名。默认的布局是Apache 。
--enable-v4-mapped 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 Build httpd as a Position Independent Executable
--enable-modules=MODULE-LIST
Space-separated list of modules to enable | "all" | "most" 空格分隔的模块列表。将MODULE-LIST静态连接进核心(可用于所有模块){MODULE-LIST|most|all}。见下面”模块选项“说明。
--enable-mods-shared=MODULE-LIST
Space-separated list of shared modules to enable | "all" | "most" 将MODULE-LIST中的所有模块都编译成DSO(可用于所有模块)
--disable-authn-file file-based authentication control
--enable-authn-dbm DBM-based authentication control
--enable-authn-anon anonymous user authentication control
--enable-authn-dbd SQL-based authentication control
--disable-authn-default authentication 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-based authorization control
--enable-authz-owner 'require file-owner' authorization control
--enable-authnz-ldap LDAP based authentication
--disable-authz-default authorization control backstopper
--disable-auth-basic basic authentication
--enable-auth-digest RFC2617 Digest authentication
--enable-isapi 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 Framework
--enable-bucketeer buckets manipulation filter
--enable-dumpio 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-reqtimeout Limit time waiting for request from client
--enable-ext-filter external filter module
--disable-include 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 caching and connection pooling services
--disable-log-config logging configuration
--enable-log-forensic forensic logging
--enable-logio input and output logging
--disable-env clearing/setting of ENV vars
--enable-mime-magic automagically determining MIME type
--enable-cern-meta CERN-type meta files
--enable-expires Expires header control
--enable-headers HTTP header control
--enable-ident RFC 1413 identity check
--enable-usertrack user-session tracking
--enable-unique-id per-request unique ids
--disable-setenvif basing ENV vars on headers
--disable-version determining httpd version in config files
--enable-proxy Apache proxy module
--enable-proxy-connect Apache proxy CONNECT module
--enable-proxy-ftp Apache proxy FTP module
--enable-proxy-http Apache proxy HTTP module
--enable-proxy-scgi Apache proxy SCGI module
--enable-proxy-ajp Apache proxy AJP module
--enable-proxy-balancer Apache proxy BALANCER module
--enable-ssl SSL/TLS support (mod_ssl)
--enable-distcache 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
Build a statically linked version of htpasswd
--enable-static-htdigest
Build a statically linked version of htdigest
--enable-static-rotatelogs
Build a statically linked version of rotatelogs
--enable-static-logresolve
Build a statically linked version of logresolve
--enable-static-htdbm Build a statically linked version of htdbm
--enable-static-ab Build a statically linked version of ab
--enable-static-checkgid
Build a statically linked version of checkgid
--enable-static-htcacheclean
Build a statically linked version of htcacheclean
--enable-static-httxt2dbm
Build a statically linked version of httxt2dbm
--enable-http HTTP protocol handling
--disable-mime mapping of file-extension to MIME
--enable-dav WebDAV protocol handling
--disable-status process/thread monitoring
--disable-autoindex directory listing
--disable-asis as-is filetypes
--enable-info server information
--enable-suexec set uid and gid for spawned processes
--disable-cgid CGI scripts
--enable-cgi CGI scripts
--disable-cgi CGI scripts
--enable-cgid CGI scripts
--enable-dav-fs DAV provider for the filesystem
--enable-dav-lock DAV provider for generic locking
--enable-vhost-alias mass virtual hosting module
--disable-negotiation content negotiation
--disable-dir directory request handling
--enable-imagemap server-side imagemaps
--disable-actions Action triggering on requests
--enable-speling correct common URL misspellings
--disable-userdir mapping of requests to user-specific directories
--disable-alias mapping of requests to different filesystem parts
--enable-rewrite rule based URL manipulation
--enable-so DSO capability
Optional Packages: 可选程序包
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--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
apu-config
--with-pcre=PATH Use external PCRE library
--with-port=PORT Port on which to listen (default is 80)
--with-sslport=SSLPORT Port on which to securelisten (default is 443)
--with-z=DIR use a specific zlib library
--with-sslc=DIR RSA SSL-C SSL/TLS toolkit
--with-ssl=DIR OpenSSL SSL/TLS toolkit
--with-mpm=MPM Choose the process model for Apache to use.
MPM={beos|event|worker|prefork|mpmt_os2|winnt}
--with-module=module-type:module-file
Enable module-file in the modules/
directory.
--with-program-name alternate executable name
--with-suexec-bin Path to suexec binary
--with-suexec-caller User allowed to call SuExec
--with-suexec-userdir User subdirectory
--with-suexec-docroot SuExec root directory
--with-suexec-uidmin Minimal allowed UID
--with-suexec-gidmin Minimal allowed GID
--with-suexec-logfile Set the logfile
--with-suexec-safepath Set the safepath
--with-suexec-umask umask for suexec'd process
Some influential environment variables:
环境变量。可以通过指定某些环境变量来修改configure脚本的默认选择,或者帮助configure脚本找到名字和/或位置不标准的库和程序。
CC C compiler command C编译器
CFLAGS C compiler flags C编译器的flags
LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory
连接器flags,比如使用"-L-Llibdir"指定一个非标准的库文件目录libdir 。
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory
C/C++预处理程序flags,比如使用"-Iincludedir"指定一个非标准的头文件目录includedir 。
CPP C preprocessor C预处理程序
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
模块选项
有两种使用模块的方法:一是静态连接进核心,二是作为DSO模块动态加载;如果编译中包含任何DSO模块,则mod_so会被自动包含进核心。如果希望核心能够装载DSO,但不实际编译任何DSO模块,则需明确指定"–enable-so=static"。
一般语法
一般情况下你可以使用如下语法启用或者禁用某个模块:
-
–disable-MODULE
-
–enable-MODULE=shared
-
–enable-MODULE=static
-
–enable-mods-shared=MODULE-LIST
-
–enable-mods=MODULE-LIST
-
–enable-modules=MODULE-LIST
-
将MODULE-LIST静态连接进核心(可用于所有模块)
禁用MODULE模块(仅用于基本模块)
将MODULE编译为DSO(可用于所有模块)
将MODULE静态连接进核心(仅用于扩展和实验模块)
将MODULE-LIST中的所有模块都编译成DSO(可用于所有模块)
即去掉”shared“。将MODULE-LIST静态连接进核心
上述 MODULE-LIST 可以是:
(1)用引号界定并且用空格分隔的模块名列表
–enable-mods-shared='headers rewrite dav'
(2)"most"(大多数模块[遇见错误模块时忽略该模块而不中断配置过程])
(3)"all"(所有模块[遇见错误模块时中断配置过程并报错])
–enable-mods-shared=most
注意
configure将忽略MODULE和MODULE-LIST中的拼写错误,注意仔细拼写。用于MODULE和MODULE-LIST中的名称是"mod_NAME"中去掉"mod_"并将剩余部分中的下划线"_"替换为连字符"-"以后的结果,比如"mod_log_config"模块应当表示为"log-config"。
模块列表
基本(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_imagemap |
(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) | 提供大批量虚拟主机的动态配置支持 |
更多详细的说明,可参考apache手册。http://apache.chinahtml.com/programs/configure.html#modoptions
原创文章,作者:Net17-卓格,如若转载,请注明出处:http://www.178linux.com/16532

