Theconfigure script configures the source tree for compiling and installing the Apache HTTP Server on your particular platform. Various options allow the compilation of a server corresponding to your personal requirements.
This script, included in the root directory of the source distribution, is for compilation on Unix and Unix-like systems only. For other platforms, see theplatform documentation.
You should call theconfigure script from within the root directory of the distribution.
./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g.CC,CFLAGS ...), specify them asVAR=VALUE. Seebelow for descriptions of some of the useful variables.
The following options influence the behavior ofconfigure itself.
-C--config-cache--cache-file=config.cache--cache-file=FILE-h--help [short|recursive]short only options specific to this package will displayed. The argumentrecursive displays the short help of all the included packages.-n--no-createconfigure script is run normally but does not create output files. This is useful to check the test results before generating makefiles for compilation.-q--quietchecking ... messages during the configure process.--srcdir=DIRconfigure is located, or the parent directory.--silent--quietThese options define the installation directory. The installation tree depends on the selected layout.
--prefix=PREFIX/usr/local/apache2.--exec-prefix=EPREFIXBy 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.
--enable-layout=LAYOUTconfig.layout file contains several example configurations, and you can also create your own custom configuration following the examples. The different layouts in this file are grouped into<Layout FOO>...</Layout> sections and referred to by name as inFOO. The default layout isApache.For better control of the installation directories, use the options below. Please note that the directory defaults are set byautoconf and are overwritten by the corresponding layout setting.
--bindir=DIRhtpasswd,dbmmanage, etc. which are useful for site administrators. By defaultDIR is set toEPREFIX/bin.--datadir=DIRdatadir is set toPREFIX/share. This option is offered byautoconf and currently unused.--includedir=DIRincludedir is set toEPREFIX/include.--infodir=DIRinfodir is set toPREFIX/info. This option is currently unused.--libdir=DIRlibdir is set toEPREFIX/lib.--libexecdir=DIRlibexecdir is set toEPREFIX/modules.--localstatedir=DIRlocalstatedir is set toPREFIX/var. This option is offered byautoconf and currently unused.--mandir=DIRmandir is set toEPREFIX/man.--oldincludedir=DIRoldincludedir is set to/usr/include. This option is offered byautoconf and currently unused.--sbindir=DIRhttpd,apachectl,suexec, etc. which are necessary to run the Apache HTTP Server. By defaultsbindir is set toEPREFIX/sbin.--sharedstatedir=DIRsharedstatedir is set toPREFIX/com. This option is offered byautoconf and currently unused.--sysconfdir=DIRhttpd.conf,mime.types, etc. inDIR. By defaultsysconfdir is set toPREFIX/conf.These options are used to cross-compile the Apache HTTP Server to run on another system. In normal cases, when building and running the server on the same system, these options are not used.
--build=BUILDconfig.guess.--host=HOST--target=TARGETautoconf and not necessary for the Apache HTTP Server.These options are used to fine tune the features your HTTP server will have.
Generally you can use the following syntax to enable or disable a feature:
--disable-FEATURE--enable-FEATURE=no.--enable-FEATURE[=ARG]yes.--enable-MODULE=shared--enable-MODULE=staticconfigure will not complain about--enable-foo even iffoo doesn't exist, so you need to type carefully.Most modules are compiled by default and have to be disabled explicitly or by using the keywordfew (see--enable-modules,--enable-mods-shared and--enable-mods-static below for further explanation) or--enable-modules=none to be removed as a group.
Other modules are not compiled by default and have to be enabled explicitly or by using the keywordsall orreallyall to be available.
To find out which modules are compiled by default, run./configure -h or./configure --help and look underOptional Features. Suppose you are interested inmod_example1 andmod_example2, and you see this:
Optional Features: ... --disable-example1 example module 1 --enable-example2 example module 2 ...
Thenmod_example1 is enabled by default, and you would use--disable-example1 to not compile it.mod_example2 is disabled by default, and you would use--enable-example2 to compile it.
Multi-Processing Modules, or MPMs, implement the basic behavior of the server. A single MPM must be active in order for the server to function. The list of available MPMs appears on themodule index page.
MPMs can be built as DSOs for dynamic loading or statically linked with the server, and are enabled using the following options:
--with-mpm=MPMChoose the default MPM for your server. If MPMs are built as DSO modules (see--enable-mpms-shared), this directive selects the MPM which will be loaded in the default configuration file. Otherwise, this directive selects the only available MPM, which will be statically linked into the server.
If this option is omitted, thedefault MPM for your operating system will be used.
--enable-mpms-shared=MPM-LISTEnable a list of MPMs as dynamic shared modules. One of these modules must be loaded dynamically using theLoadModule directive.
MPM-LIST is a space-separated list of MPM names enclosed by quotation marks. For example:
--enable-mpms-shared='prefork worker'
Additionally you can use the special keywordall, which will select all MPMs which support dynamic loading on the current platform and build them as DSO modules. For example:
--enable-mpms-shared=all
To add additional third-party modules use the following options:
--with-module=module-type:module-file[,module-type:module-file]Add one or more third-party modules to the list of statically linked modules. The module source filemodule-file will be searched in themodules/module-type subdirectory of your Apache HTTP server source tree. If it is not found thereconfigure is consideringmodule-file to be an absolute file path and tries to copy the source file into themodule-type subdirectory. If the subdirectory doesn't exist it will be created and populated with a standardMakefile.in.
This option is useful to add small external modules consisting of one source file. For more complex modules you should read the vendor's documentation.
apxs.--enable-maintainer-mode--enable-mods-shared=MODULE-LISTDefines a list of modules to be enabled and build as dynamic shared modules. This mean, these module have to be loaded dynamically by using theLoadModule directive.
MODULE-LIST is a space separated list of modulenames enclosed by quotation marks. The module names are given without the precedingmod_. For example:
--enable-mods-shared='headers rewrite dav'
Additionally you can use the special keywordsreallyall,all,most andfew. For example,
--enable-mods-shared=most
will compile most modules and build them as DSO modules,
--enable-mods-shared=few
will only compile a very basic set of modules.
The default set ismost.
TheLoadModule directives for the chosen modules will be automatically generated in the main configuration file. By default, all those directives will be commented out except for the modules that are either required or explicitly selected by a configure--enable-foo argument. You can change the set of loaded modules by activating or deactivating theLoadModule directives inhttpd.conf. In addition theLoadModule directives for all built modules can be activated via the configure option--enable-load-all-modules.
--enable-mods-static=MODULE-LIST--enable-mods-shared, but will link the given modules statically. This mean, these modules will always be present while runninghttpd. They need not be loaded withLoadModule.--enable-modules=MODULE-LIST--enable-mods-shared, and will also link the given modules dynamically. The special keywordnone disables the build of all modules.--enable-v4-mapped--with-port=PORThttpd will listen. This port number is used when generating the configuration filehttpd.conf. The default is 80.--with-program-namehttpd.These options are used to define optional packages.
Generally you can use the following syntax to define an optional package:
--with-PACKAGE[=ARG]yes.--without-PACKAGE--with-PACKAGE=no. This option is provided byautoconf but not very useful for the Apache HTTP Server.--with-apr=DIR|FILEconfigure the path to theapr-config script. You may set the absolute path and name or the directory to the installed APR.apr-config must exist within this directory or the subdirectorybin.--with-apr-util=DIR|FILEconfigure the path to theapu-config script. You may set the absolute path and name or the directory to the installed APU.apu-config must exist within this directory or the subdirectorybin.--with-ssl=DIRmod_ssl has been enabledconfigure searches for an installed OpenSSL. You can set the directory path to the SSL/TLS toolkit instead.--with-z=DIRconfigure searches automatically for an installedzlib library if your source configuration requires one (e.g., whenmod_deflate is enabled). You can set the directory path to the compression library instead.Several features of the Apache HTTP Server, includingmod_authn_dbm andmod_rewrite's DBMRewriteMap use simple key/value databases for quick lookups of information. SDBM is included in the APU, so this database is always available. If you would like to use other database types, use the following options to enable them:
--with-gdbm[=path]configure will search for the include files and libraries of a GNU DBM installation in the usual search paths. An explicitpath will causeconfigure to look inpath/lib andpath/include for the relevant files. Finally, thepath may specify specific include and library paths separated by a colon.--with-ndbm[=path]--with-gdbm, but searches for a New DBM installation.--with-berkeley-db[=path]--with-gdbm, but searches for a Berkeley DB installation.The DBM options are provided by the APU and passed through to its configuration script. They are useless when using an already installed APU defined by--with-apr-util.
You may use more then one DBM implementation together with your HTTP server. The appropriated DBM type will be configured within the runtime configuration at each time.
--enable-static-support--enable-suexecsuexec, which allows you to set uid and gid for spawned processes.Do not use this option unless you understand all the security implications of running a suid binary on your server. Further options to configuresuexec are describedbelow.It is possible to create a statically linked binary of a single support program by using the following options:
--enable-static-abab.--enable-static-checkgidcheckgid.--enable-static-htdbmhtdbm.--enable-static-htdigesthtdigest.--enable-static-htpasswdhtpasswd.--enable-static-logresolvelogresolve.--enable-static-rotatelogsrotatelogs.suexec configuration optionsThe following options are used to fine tune the behavior ofsuexec. SeeConfiguring and installing suEXEC for further information.
--with-suexec-binsuexec binary. Default is--sbindir (seeFine tuning of installation directories).--with-suexec-callersuexec. It should be the same as the user under whichhttpd normally runs.--with-suexec-docrootsuexec access is allowed for executables. Default value is--datadir/htdocs.--with-suexec-gidminsuexec. The default value is 100.--with-suexec-logfilesuexec logfile. By default the logfile is namedsuexec_log and located in--logfiledir.--with-suexec-safepathPATH to be set for processes started bysuexec. Default value is/usr/local/bin:/usr/bin:/bin.--with-suexec-userdirsuexec access is allowed. This setting is necessary when you want to usesuexec together with user-specific directories (as provided bymod_userdir). The default ispublic_html.--with-suexec-uidminsuexec. The default value is 100.--with-suexec-umaskumask for processes started bysuexec. It defaults to your system settings.There are some useful environment variables to override the choices made byconfigure or to help it to find libraries and programs with nonstandard names or locations.
CCCFLAGSCPPCPPFLAGS-Iincludedir if you have headers in a nonstandard directoryincludedir.LDFLAGS-Llibdir if you have libraries in a nonstandard directorylibdir.Copyright 2025 The Apache Software Foundation.
Licensed under theApache License, Version 2.0.