In many cases it is necessary to add modules to Apache already in production, and the stupidest way to do this is by recompiling the entire Apache package, but there are more precise ways to do it.
First of all to get the source file of the module, here with Mod_dir as an example, the other module method is the same
1. Enter the source file directory
#cd/root/src/httpd-2.0.55/modules/mappers
2. Using Apache's APXS command to process mod_dir.c source files
#/usr/local/apache/bin/apxs-c mod_dir.c
3, the use of GCC compiler generated mod_dir.so this important stuff
#gcc-shared-o mod_dir.so MOD_DIR.O
4, again using the Apache APXS command, the compiled shared library installed into the Apache modules directory, he will modify the httpd.conf configuration file.
#/usr/local/apache/bin/apxs-i-a-n Dir_module mod_dir.so
5, APXS has a bug, so finally also need to manually modify the httpd.conf file, #loadmodule mod_dir_module modules/mod_dir.so modified to LoadModule dir_module modules /mod_dir.so
Using this method we can cross-conveniently compile the modules we need into the current version of Apache. An upgrade to the old Apache environment is useful.