2008-05-07

在Apache中自己开发一个新的Module

Posted in 实验室, Apache, FreeBSD/Unix服务器 at 22:40 Author:仲远

标签:

最近需要在Apache中做实验,需要改Apache的源代码,感觉很头大。以下是找到的一篇关于Apache Module开发(Apche Modules Develop)的文章,觉得有些用处,先保留下来,也供大家一起参考。

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 http://modules.apache.org. 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.

本文可以自由转载,转载时请保留全文并注明出处:
转载自仲子说 [ http://www.wangzhongyuan.com/ ]
原文链接:

Leave a Comment

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word