[ Table of Contents ] [ Previous Chapter ] [ Next Chapter ]
One of the most powerful features of Apache is its ability to use dynamically loadable modules to increase its functionality and flexibility as the end-user's needs grow. Such add-on modules include SSL, Fastcgi, and many others. Though iTools comes with a vast array of Apache modules both from the Apache source itself and modules from third parties, the user may still find the need to expand Apache's capabilities further.
A default Apache requires that Apache modules be built against the same version of Apache that the modules are run under. iTools, even though the Apache is version 1.3.9, allows modules built under any Apache to run provided the version is greater than 1.3.4. This means that modules built for Apple's default Apache will work with iTools.
If you are not able to obtain pre-compiled Apache modules for the module that you want to run on iTools, you will have to compile them. In order to build Apache modules for iTools, you must have the compiler installed on OS X Server. You must also obtain a fresh Apache source tree. The current version is 1.3.9, and it can be obtained from http://www.apache.org/dist/. The next step is to break open the source tree. The usual way to this is "tar zxvf apache-1.3.9.tar.gz". You will also have to have the source tree for the module you want to build available also. Usually the process involves running a "configure" script that comes with the module with a command line option telling it where the Apache source tree is.
You may also need to run the "apxs" program. "apxs" is a utility supplied with Apache to aid in the building of Apache modules. The typical way of building the module is: "apxs -o mod_<module_name>.so -c *.c". Installing the module is quite easy also and is usually done by the following: "apxs -i -a -n <module_name> mod_<module_name>.so" (where <module_name> is the name of the module that you are trying to install). Please read the "INSTALL" or "README" document that comes with the module for more detailed instructions that directly apply to the specific module that you want to install.
Once you have built and installed your Apache module, it should be placed in the /System/Library/Apache/Modules directory on your OS X Server machine. Verify that the module has been installed to the correct place. Most module install utilities add the necessary lines to your apache.conf file. You will want to check for a line that says:
LoadModule <module_name>_module /System/Library/Apache/Modules/mod_<module_name>.so
There should also be a line that says:
Once these two directives are in place, you can use the <IfModule> directive to wrap Apache directives that are specific to a certain module. The reason for doing this is so that if the module is disabled or fails to load, Apache will still start up. Basically the <IfModule> directive only initiates the directives that are contained within if the module has loaded successfully. Please see the Apache documentation for more information on these advanced configuration topics.
Apache modules can be disabled simply by commenting out the corresponding "LoadModule" and "AddModule" lines in the apache.conf file. Since each module takes up a certain amount of system resources, overhead, and memory, it is a good idea to disable unused modules. iTools comes with the most commonly-used modules enabled, but you should feel free to play with the configuration settings to tune iTools' performance to your own tastes and needs.
Note: not all modules are active in a default iTools installation.