编译调试Apache HTTP Server

1.下载

wget http://mirror.bjtu.edu.cn/apache//apr/apr-1.4.6.tar.gz

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.gz

 

2.编译

tar zxvf apr-1.4.6.tar.gz

cd apr-1.4.6

./configure --prefix=/usr/local/apr-httpd/

make

make install

 

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

 

转载于:https://www.cnblogs.com/tiantao/p/2490453.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值