1. 下载
# wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.17.tar.gz
2. 解压
# tar zxvf httpd-2.2.17.tar.gz
3. 安装
3.1 安装 apr
# cd httpd-2.2.17/srclib/apr # ./configure --prefix=/opt/myhttpd/apr # make # make install
3.2 安装 apr-util
# cd httpd-2.2.17/srclib/apr-util # ./configure --prefix=/opt/myhttpd/apr-util --with-apr=/opt/myhttpd/apr # make # make install
3.3 安装apache2
# cd httpd-2.2.17 # ./configure --prefix=/opt/myhttpd/httpd --enable-so --enable-mods-shared=all --enable-cgi --enable-rewrite --enable-deflate --enable-proxy --enable-proxy-ajp --enable-proxy-balancer --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --with-apr=/opt/myhttpd/apr --with-apr-util=/opt/myhttpd/apr-util --with-mpm=prefork # make # make install
4. 启动apache2
# cd /opt/myhttpd/httpd/bin # ./httpd
5. 测试,访问http://localhost,可以看到页面显示“It works!”。