Next Previous Contents

12. Writing Apache modules

Apache, like many other successful open source projects has a modular architecture. This means that to add or modify functionality you do not need to know the whole code base. Source code access for Apache means that you can custom build the server with only the modules that you need and include your owns.

Extending Apache can be done in C or in a variety of other languages using appropriate modules. These modules expose Apache's internal functionality to different programming languages like Perl or Tcl.

Writing modules in C: Apache is written in C and so they are the modules distributed with Apache. The best way to get started writing Apache modules is to read Doug MacEachern and Lincoln Stein Writing Apache modules with Perl and C. It is a well-written, easy to read book by two Apache and Perl gurus. The above link will lead you to the book website, which has some of its chapters online. If you have not the money to buy the book or cannot borrow it from a friend, there are other ways. You can read some of the online tutorials on writing Apache modules: Ken Coar, an Apache Group member, has a nice tutorial and slides online. An overview of the Apache architecture can be found here. The Apache website has some API notes that can help you get started. You are also encouraged to browse the source code of the modules included with Apache. Apache includes a simple one (mod_example.c) for that purpose.

Writing Apache modules in other languages: There is a variety of Apache modules that enable third party languages to access the internal Apache API. The most popular is mod_perl.

If you have any questions about the development of an Apache module you should join the Apache modules mailing list at Remember to do your homework first, research past messages and check all the documentation previously described. Chances are somebody had the same problem that you are experiencing and he got an useful response.

If you are interested in the development of core Apache itself, you should checkout the Apache development site.

Next Previous Contents