A P A C H E C O N F I G U R A T I O N Apache 1.3 Autoconf-style Interface (APACI) =========================================== APACI is an Autoconf-style interface for the Unix side of the Apache 1.3 HTTP server source distribution. It is actually not GNU Autoconf-based, i.e. the GNU Autoconf package itself is not used. Instead APACI just provides a similar batch configuration interface and a corresponding out-of-the-box build and installation procedure. The basic goal is to provide the following commonly known and expected procedure for out-of-the-box building and installing a package like Apache: $ gunzip plus corresponding Makefile. and then performs the complete build process with this shadow tree. Dynamic Shared Object (DSO) support ----------------------------------- Apache 1.3 supports building modules as shared objects on all major platforms (see section "Supported Platforms" in file src/README.DSO for details). APACI has a nice way of enabling the building of these shared objects and automatically installing them: $ ./configure --prefix=/path/to/apache \ --enable-module=rewrite \ --enable-shared=rewrite $ make $ make install This builds and installs Apache with the default configuration except that it adds the mod_rewrite module and automatically builds and installs it as a shared object, so it is optionally available for loading under runtime. To make your live even more easy APACI additionally inserts a corresponding (but out-commented) `LoadModule' line in the httpd.conf file in the installation phase. Just uncomment this line and you have mod_rewrite available. APACI also supports a variant of the --enable-shared option: $ ./configure --prefix=/path/to/apache \ --enable-shared=max $ make $ make install This enables shared object building for the maximum of modules, i.e. all enabled modules (--enable-module or the default set) except for mod_so itself (the bootstrapping module for shared object support). So, to build a full-powered Apache with maximum flexibility by building and installing most of the modules, you can use: $ ./configure --prefix=/path/to/apache \ --enable-modules=most \ --enable-shared=max $ make $ make install This first enables most of the modules (all modules except some problematic ones like mod_auth_db which needs third party libraries not available on every platform or mod_log_agent and mod_log_referer which are deprecated) and then enables shared object support for all of them. This way you get all these modules installed and you then can configure under runtime (via the `LoadModule') directives which ones are actually used. Especially a very useful for vendor package maintainers to provide a flexible Apache package. On-the-fly added additional/private module ------------------------------------------ For Apache there are a lot of modules flying around on the net which solve particular problems. For a good reference see the Apache Module Registory at http://modules.apache.org/ and the Apache Group's contribution directory at http://www.apache.org/dist/contrib/modules/. These modules usually come in a file named mod_foo.c. APACI supports adding these sources on-the-fly to the build process: $ ./configure --prefix=/path/to/apache \ --add-module=/path/to/mod_foo.c $ make $ make install This automatically copies mod_foo.c to src/modules/extra/, activates it in the configuration and builds Apache with it. A very useful way is to combine this with the shared object support: $ ./configure --prefix=/path/to/apache \ --add-module=/path/to/mod_foo.c \ --enable-shared=foo $ make $ make install This builds and installs Apache with the default set of modules, but additionally builds mod_foo as a shared object and adds a `LoadModule' line to the httpd.conf file, so later you can enable this mod_foo under runtime. Apache and mod_perl ------------------- The Apache/Perl integration project (http://perl.apache.org/) from Doug MacEachern is a very powerful approach to integrate a Perl 5 interpreter into the Apache HTTP server both for running Perl programs and for programming Apache modules in Perl. The distribution mod_perl-1.XX.tar.gz can be found on http://perl.apache.org/src/. Here is how you can install Apache with mod_perl: $ cd mod_perl-1.XX $ perl Makefile.PL ReadLine support enabled Configure mod_perl with ../apache-1.3/src ? [y] y Shall I build httpd in ../apache-1.3/src for you? [y] y : $ cd ../apache-1.3 $ LIBS='`perl $(SRCDIR)/modules/perl/ldopts`' \ ./configure --prefix=/path/to/apache \ --activate-module=src/modules/perl/libperl.a $ make $ make install This automatically builds and installs Apache 1.3 with mod_perl. After additionally installing the Perl side of mod_perl via $ cd ../mod_perl-1.XX $ perl Makefile.PL NO_HTTPD=1 $ make all install you can fire up Apache with mod_perl enabled. Apache and PHP -------------- The PHP language (http://www.php.net) is an HTML-embedded scripting language which can be directly integrated into the Apache HTTP server for powerful HTML scripting. The package can be found at http://www.php.net/download-php.php3. 1. How you can install Apache with a statically linked PHP: $ cd apache-1.3 $ ./configure --prefix=/path/to/apache $ cd ../php-3.0 $ ./configure --with-apache=../apache-1.3 $ make $ make install $ cd ../apache-1.3 $ ./configure --prefix=/path/to/apache \ --activate-module=src/modules/php3/libphp3.a $ make $ make install 2. How you can install Apache with a dynamically linked PHP: $ cd apache-1.3 $ ./configure --prefix=/path/to/apache $ cd ../php-3.0 $ ./configure --with-shared-apache=../apache-1.3 $ make $ make install $ cd ../apache-1.3 $ ./configure --prefix=/path/to/apache \ --activate-module=src/modules/php3/libphp3.a \ --enable-shared=php3 $ make $ make install