|
|
|
![]() |
|||||
for configuring new modules look at this article from Apache week Module Soup Apache's 'modular' architecture makes is possible for anyone to add new functions to the
server. In fact, most of the code that comes as part of the Apache distribution is in the form of modules, and can be removed or replaced. For example, if the 'asis' function is never needed, the asis module (mod_asis) can be
removed, making the server executable smaller and potentially reducing the load on the server host. There are a large number of modules now written for Apache. Besides those included with the distribution, modules are also
written to add functions not already in the code, or to do things which are needed on some sites but are not of widespread use. Some of these modules are written by Apache developers. Most of them, however, are written by other
users of Apache who want to adapt its functionality for their needs. In this article, we will look at a range of Apache modules which can be added to the server. First though, we show how to add a new module. Adding a Module It is easy to add a module to Apache:
So first you need to download the new module. Most modules come as a single source file, called mod_something.c. Place this file in Apache's src
directory. If the module comes as more than one file (for example, the PHP/FI module) follow the instructions that come with the module. Having got the module source, Apache needs to be configured so that it will compile this
code. To do this, edit the Module name_module mod_something.o The first argument, name_module, must match the name given in the module's source code - look for the 'module definition' near the end of the file, which will look like this: module name_module = {
NULL, ... }; The name_module text in the Configuration file must match the name
_module text in the module source exactly. The second argument on the Module line is the filename of the module, with the final .c replaced by .o. After editing Configuration, re-compile Apache by running ./Configure make Finally, stop your current server (with kill -TERM pid ), install the new httpd executable, and start it running (e.g. ./httpd -d /usr/local/httpd). The Standard Modules If you have not looked at the standard modules which come with Apache, you might be missing some functions you could find useful.
In addition, you might be compiling in some things you never use. All the standard Apache modules are listed in the Configuration file. The next release of Apache will come with a few more standard modules, such as a module to rewrite URLs on the fly, and a module to add PICS content-rating labels to responses.
Finding More Modules
Modules can be found in several different places:
A Selection of Modules To simplify finding modules to do what you
want, here is the Apache Week guide to add-on modules by function. These are taken from all the above sources, and are presented as an example of what is available. We cannot guarantee that these modules with do what they say they
do, or even that they work with all versions of Apache. If a module named below is not a link, then that module is distributed with Apache 1.1.1. Otherwise the link will take you to that module (if the link is to a .c or .tar file, save it to a file, else the link goes to an HTML page or FTP directory).
For more complex applications, usernames and password can be stored in mSQL, Postgres95 or DBI-compatible databases, using mod_auth_msql, mod_auth_pg95 or ~ If passwords cannot be stored in a file or database (perhaps because they are
obtained at run-time from another network service), the The mod_auth_anon module can be used to allow an 'anonymous-ftp' style access to authenticated areas, where users give an anonymous username and
a real email address as password. There are also modules to hold authentication information in cookies, and to authenticate against standard /etc/passwd and NIS password services. See the Module Registry.
For more complex cases, mod_rewrite can be used to implement blocking based on arbitrary headers (e.g. referer and user-agent), as well as on the URL itself.
Alternatively, the
|
|||||
![]() |
|||||