Writing Apache Modules with Perl and C (Paperback)

Doug MacEachern, Lincoln Stein

  • 出版商: O'Reilly
  • 出版日期: 1999-05-11
  • 定價: $1,488
  • 售價: 9.5$1,414
  • 語言: 英文
  • 頁數: 750
  • 裝訂: Paperback
  • ISBN: 156592567X
  • ISBN-13: 9781565925670
  • 相關分類: Perl 程式語言
  • 立即出貨 (庫存 < 3)



Apache is the most popular web server on the Internet because it is free, reliable, and extensible. The availability of the source code and the modular design of Apache makes it possible to extend web server functionality through the Apache API.

For the most part, however, the Apache API has only been available to C programmers, and requires rebuilding the Apache server from source. mod_perl, the popular Apache module used primarily for enhanced CGI performance, changed all that by making the Apache API available to Perl programmers. With mod_perl, it becomes simple to develop Apache modules with Perl and install them without having to rebuild the web server.

Writing Apache Modules with Perl and C shows how to extend web server capabilities regardless of whether the programming language is Perl or C. The book explains the design of Apache, mod_perl, and the Apache API. It then demonstrates how to use them to perform for tasks like the following:

  • Rewriting CGI scripts as Apache modules to vastly improve performance

  • Server-side filtering of HTML documents, to embed special markup or code (much like SSI)

  • Enhancing server log functionality

  • Converting file formats on the fly

  • Implementing dynamic navigation bars

  • Incorporating database access into CGI scripts

  • Customizing access control and authorization to block robots or to use an external database for passwords



The authors are Lincoln Stein and Doug MacEachern. Lincoln is the successful author of How to Set Up and Maintain a World Wide web Site and the developer of the widely used Perl CGI.pm module. Doug is a consultant and the creator of the innovative mod_perl Apache module.




Apache是因為免費、可靠和可擴展而成為互聯網上最受歡迎的網頁伺服器。Apache的源代碼可用性和模塊化設計使得通過Apache API擴展網頁伺服器功能成為可能。

然而,大部分情況下,Apache API只對C程式設計師可用,並且需要重新編譯Apache伺服器。而廣泛用於增強CGI性能的流行Apache模塊mod_perl改變了這一切,使得Perl程式設計師可以使用Apache API。使用mod_perl,開發Perl的Apache模塊並安裝它們而無需重新編譯網頁伺服器變得簡單。

《使用Perl和C編寫Apache模塊》展示了如何擴展網頁伺服器的功能,無論使用的程式語言是Perl還是C。本書解釋了Apache、mod_perl和Apache API的設計。然後演示了如何使用它們執行以下任務:

- 將CGI腳本重寫為Apache模塊以大大提高性能
- 伺服器端過濾HTML文檔,嵌入特殊標記或代碼(類似SSI)
- 增強伺服器日誌功能
- 在傳輸過程中動態轉換文件格式
- 實現動態導航欄
- 將數據庫訪問整合到CGI腳本中
- 自定義訪問控制和授權,以阻止機器人或使用外部數據庫進行密碼驗證

本書的作者是Lincoln Stein和Doug MacEachern。Lincoln Stein是成功的《如何建立和維護一個全球網站》的作者,也是廣泛使用的Perl CGI.pm模塊的開發者。Doug MacEachern是一位顧問,也是創新的mod_perl Apache模塊的創建者。