You want to build your Apache Web server from the sources directly rather than installing it from a prepackaged kit.
Assuming that you already have the Apache source tree—whether you installed it from a tarball, Subversion, or some distribution package, the following commands—executed in the top directory of the tree, builds the server package with most of the standard modules as DSOs:
%./buildconf
%./configure --prefix=
/usr/local/apache
>--with-layout=Apache --enable-modules=most --enable-mods-shared=all \
>--with-mpm=prefork
%make
#make install
If you want more detailed information about the various options and their meanings, you can use the following command:
% ./configure --help
Building the server from the sources can be complex and time-consuming, but it’s essential if you intend to make any changes to the source code. It gives you much more control over things, such as the use of shareable object libraries and the database routines available to modules. Building from source is also de rigeur if you’re developing your own Apache modules.
If you want to build the modules statically into the server,
replace any occurrences of
--enable-mods-shared=
with
list
--enable-mods=
.list
The options to the configure script are many and varied; if you haven’t used it before to build Apache, locate some online tutorials (such as those at http://apache-server.com/tutorials/ or http://httpd.apache.org/docs-2.0/install.html) when you want to change the defaults. The default options generally produce a working server, although the filesystem locations and module choices may not be what you’d like; they may include modules you don’t want or omit some you do. (See Chapter 2 for some examples.)
Get Apache Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.