1.下載html
wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.6.tar.gzapache
wget http://mirror.bjtu.edu.cn/apache//apr/apr-util-1.4.1.tar.gz瀏覽器
wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.2.22.tar.gzide
2.編譯測試
tar zxvf apr-1.4.6.tar.gzui
cd apr-1.4.6debug
./configure --prefix=/usr/local/apr-httpd/調試
makehtm
make installget
tar zxvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install
tar -zxvf httpd-2.2.22.tar.gz
cd httpd-2.2.22
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ CFLAGS="-g"
make
make install
注意:--prefix指定爲apache目錄時運行會到apache2目錄下找http.conf文件,避免麻煩仍是設置爲/usr/local/apache2吧。
3.測試
修改
conf/httpd.conf
Listen 10.8.1.66:80
bin/apachectl -k start
在瀏覽器輸入http://10.8.1.66
bin/apachectl -k stop
4.調試
gdb httpd
b ap_process_request
r -X -d /usr/local/apache2
[參考]
Compiling and Installing http://httpd.apache.org/docs/2.2/install.html
Apache Debugging Guide http://httpd.apache.org/dev/debugging.html