The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementations. The primary goal is to provide an API to which software developers may code and be assured of predictable if not identical behaviour regardless of the platform on which their software is built, relieving them of the need to code special-case conditions to work around or take advantage of platform-specific deficiencies or features.
APR(Apache portable Run-time libraries,Apache可移植運行庫),主要為上層的應用程序提供一個可以跨越多操作系統平台使用的底層支持接口庫。在早期 的Apache版本中,應用程序本身必須能夠處理各種具體操作系統平台的細節,並針對不同的平台調用不同的處理函數。
那安裝Apache的時候為什么必須安裝Apr呢?
在早期的Apache版本中,應用程序本身必須能夠處理各種具體操作系統平台的細節,並針對不同的平台調用不同的處理函數。隨着Apache的進一步開發,Apache組織決定將這些通用的函數獨立出來並發展成為一個新的項目。這樣,APR的開發就從Apache中獨立出來,Apache僅僅是使用APR而已。
一般情況下,APR開發包很容易理解為僅僅是一個開發包,不過事實上並不是。目前,完整的APR實際上包含了三個開發包:apr、apr-util以及apr-iconv,每一個開發包分別獨立開發,並擁有自己的版本。
apr中包含了一些通用的開發組件,包括mmap,DSO等等
apr-util該目錄中也是包含了一些常用的開發組件。這些組件與apr目錄下的相比,它們與apache的關系更加密切一些。比如存儲段和存儲段組,加密等等。
apr-iconv包中的文件主要用於實現iconv編碼。目前的大部分編碼轉換過程都是與本地編碼相關的。在進行轉換之前必須能夠正確地設置本地編碼。因此假如兩個非本地編碼A和B需要轉換,則轉換過程大致為A->Local以及Local->B或者B->Local以及Local->A。