Apache compiled in modules

Apache is a very well-designed and modular web server. Its power and convenience partly comes from its ability to use various modules, and the ease in which these modules can be changed as necessary. Specific modules can be compiled into the server when it is being built so that a web server suited for a particular task is ready out of the box.

Most times, we are not the ones who have compiled Apache so we have no way to immediately know what modules have been compiled into it. Coming to our rescue is a simple command we can execute to determine Apache's compiled modules.

Checking the modules Apache has been compiled with

To check the modules that Apache has been compiled with, execute the following command in a terminal. The command works on Ubuntu 10.04 LTS and should also work on similar flavours of Linux.

apache2 -l

Note that the switch is a lower case letter "L" and not the number one.

The command above will list compiled in modules that Apache has.

The output of the command may be something like:

Compiled in modules:
core.c
mod_log_config.c
mod_logio.c
prefork.c
http_core.c
mod_so.c

From the above information, we can see exactly what options (and hence features) our Apache server has been built with.

For example, by noticing the line which has prefork.c we are able to tell that our server will be using the prefork method of spawning processes to handle HTTP requests. Based on your needs, you may need to recompile an Apache server so that it handles HTTP requests differently.

It is a good idea to know which modules are compiled into your Apache binary so that you have a better idea of the features which are available to you. Also, you may want to uninstall modules which are not needed to keep your web server as compact and efficient as possible.

Thank Tutorial Arena for This Tutorial.
Show your appreciation with a +1...