參閱Developer Info裡面的Source Repository Information,其中Apache Development Notes (http://httpd.apache.org/dev/devnotes.html)提到儲存庫的資訊。
取得程式碼步驟,以Ubuntu為例:
sudo apt-get install subversion
svn checkout http://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x httpd-2.4.x
系統需求
APR
下載程式碼,如apr-1.4.6.tar.gz,並解壓縮,執行tar xzvf apr-1.4.6.tar.gz
進入程式碼所在的資料夾中
設定組態,執行./configure
編譯程式碼,執行make
安裝,執行make install
或是上述都不做,直接執行sudo apt-get install libapr1-dev,其標頭檔位於/usr/incluse/apr-1.0資料夾之下。
APR-Util
下載程式碼,如apr-util-1.5.1.tar.gz,並解壓縮,執行tar xzvf apr-util-1.5.1.tar.gz
進入程式碼所在的資料夾中
設定組態,執行./configure --with-apr=/usr/local/apr
編譯程式碼,執行make
安裝,執行make install
或是上述都不做,直接執行sudo apt-get install libaprutil1-dev
Perl-Compatible Regular Expressions Library (PCRE)
sudo apt-get install libpcre3 libpcre3-dev
make
sudo apt-get install make
編譯Apache程式碼
下載程式碼,如httpd-2.4.4.tar.gz,並解壓縮,執行tar xzvf httpd-2.4.4.tar.gz
進入程式碼所在的資料夾中
設定組態,執行./configure
編譯程式碼,執行make
安裝,執行sudo make install
預設安裝Apache於/usr/local/apache2路徑之中
啟動,執行sudo /usr/local/apache2/bin/apachectl start
設定檔:/usr/local/apache2/conf/httpd.conf
可以輸入指令列出編譯設定值,
指令:./usr/local/apache2/bin/httpd -V
結果:
Server version: Apache/2.4.6 (Unix)
Server built: Aug 5 2013 14:07:47
Server's Module Magic Number: 20120211:23
Server loaded: APR 1.4.6, APR-UTIL 1.3.12
Compiled using: APR 1.4.6, APR-UTIL 1.3.12
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr/local/apache2"
-D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Reference: