By means of modules, Apache can be expanded with a wide range of functions. For example, Apache can execute CGI scripts in diverse programming languages by means of modules. Apart from Perl and PHP, additional scripting languages, such as Python or Ruby, are also available. Furthermore, there are modules for secure data transmission (Secure Sockets Layer, SSL), user authentication, expanded logging, and other functions.
By means of custom modules, Apache can be adapted to all kinds of requirements and preferences. This requires a certain amount of know-how. For further information, refer to Section 15.13.4. “Additional Sources”.
When Apache processes a query, several “handlers” can be specified for handling the query (by means of directives in the configuration file). These handlers can be part of Apache or a module invoked for processing the query. Thus, this procedure can be arranged in a very flexible way. It is also possible to use your own custom modules with Apache to influence the way in which requests are processed.
The modularization in Apache 2 has reached an advanced level, where almost everything except some minor tasks is handled by means of modules. In Apache 2, even HTTP is processed by way of modules. Accordingly, Apache 2 does not necessarily need to be a web server. It can also be used for completely different purposes with other modules. For example, there is a proof-of-concept mail server (POP3) module based on Apache.
Apache supports a number of useful features, some of which are described below.
Support for virtual hosts means that a single instance of Apache and a single machine can be used for several web sites. For the users, the web server appears as several independent web servers. The virtual hosts can be configured on different IP addresses or on the basis of names. Thus, you can save the acquisition costs and administration workload for additional machines.
Apache offers a number of possibilities for manipulating and rewriting URLs. Check the Apache documentation for details.
Apache can deliver a page that is adapted to the capabilities of the client (browser). For example, simple versions without frames can be delivered for older browsers or browsers that only operate in text mode, such as Lynx. In this way, the notorious JavaScript incompatibility of various browsers can be circumvented by delivering a special page version for every browser (provided you are prepared to adapt the JavaScript code for each individual browser).
You can react in a flexible way and provide a suitable response in the event of an error, such as nonexistent pages. The response can even be generated actively, for example, with CGI.