Adding Modules after Compiling Apache Without Recompiling


# apxs cia mod_usertrack.c


Yes, you can add modules to Apache without recompiling, but only if mod_so is already compiled into your server. To find out whether mod_so is compiled into your Apache installation, please read the earlier section, "Discovering the Modules Available on the Server."

You can build a module from sources using apxs, which is a tool for building and installing extension modules that is included by default with Apache.

To compile and install a module with apxs, you just need to change your current directory to the one containing the module and type the following:

# apxs c mod_usertrack.c


This will compile the module. You will need now to copy the module to the Apache modules directory and edit the configuration file. You can let apxs automatically handle all this with

# apxs cia mod_usertrack.c


This approach will work for simple modules, such as those included with the Apache distribution. For complex third-party modules, such as PHP or mod_python, there is usually a --with-apxs or --with-apxs2 switch to pass to the configure script.

If you have a binary version of the module available, you don't need to do any of these apxs-related steps.

This may be the case if you already compiled many of the optional modules when building the server or the module is already provided as part of your Linux distribution or Windows installation package.

If you are using Apache 1.3, you can add the new module to the server by editing your httpd.conf file and adding the following lines:

LoadModule usertrack_module libexec/mod_usertrack.so AddModule mod_usertrack.c


If you are using Apache 2.2, you will only need to add the LoadModule directive, in this case using modules/ instead of libexec/ as the directory where the loadable modules are installed by default.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net