zhendeaini123 发表于 2015-7-31 12:38:40

通过eclipse调试apache httpd server

  Linux下调试apache httpd server
  1) 安装CentOS6
2) 安装编译环境
# yum groupinstall "Development Tools"
3)下载apache httpd server代码
# wget http://apache.etoak.com/httpd/httpd-2.2.23.tar.gz
# tar zxvf httpd-2.2.23.tar.gz
  # wget http://apache.etoak.com//apr/apr-1.4.6.tar.gz
# wget http://apache.etoak.com//apr/apr-util-1.5.1.tar.gz
# tar zxvf apr-1.4.6.tar.gz
# tar apr-util-1.5.1.tar.gz
  4) 编译
设定编译选项:
# CFLAGS="-O0 -g -ggdb3 -DAPR_BUCKET_DEBUG -DAPR_BUCKET_DEBUG"; export CFLAGS
# CPPFLAGS="-DAPR_BUCKET_DEBUG -DAPR_BUCKET_DEBUG"; export CPPFLAGS
  编译APR:
# cd /opt/source/common/apr-1.4.6
./configure --prefix=/opt/compiled/common/apr --enable-debug --enable-pool-debug=yes
# make
# make install
  # cd /opt/source/common/apr-util-1.5.1
./configure --prefix=/opt/compiled/common/apr-util --with-apr=/opt/compiled/common/apr
# make
# make install
  编译apache,选择MPM为worker模式:
# cd httpd-2.2.23
# ./configure
--prefix=/opt/compiled/apache/httpd-2.2.23-worker \
--enable-proxy \
--enable-proxy-ajp \
--enable-proxy-balancer \
--enable-mods-shared=all \
--enable-cache \
--enable-mem-cache \
--enable-disk-cache \
--with-apr=/opt/compiled/common/apr \
--with-apr-util=/opt/compiled/common/apr-util \
--with-mpm=worker
# make
# make install
  5) 下载eclipse for C/C++
# wget http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-cpp-juno-SR1-linux-gtk.tar.gz
# tar zxvf eclipse-cpp-juno-SR1-linux-gtk.tar.gz
  准备java环境,打开eclipse,并导入httpd-2.2.23到 eclipse。
  6)调试
新建一个“C/C++ Application”, 如下:


  参数-DONE_PROCESS是以单进程方式,方便调试。调试的截图可以参考如下:

  
  
页: [1]
查看完整版本: 通过eclipse调试apache httpd server