ubuntu下编译安装httpd-2.4.3
#准备工作
# sudo su
# cd /usr/software
# wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.4.3.tar.gz
# wget http://mirrors.axint.net/apache/apr/apr-1.4.6.tar.gz
# wget http://mirrors.axint.net/apache/apr/apr-util-1.5.1.tar.gz
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.gz
# tar zxvf pcre-8.31.tar.gz
# tar zxvf apr-1.4.6.tar.gz
# tar zxvf apr-util-1.5.1.tar.gz
# tar zxvf httpd-2.4.3.tar.gz
# cd pcre-8.31
# ./configure --prefix=/usr/local/pcre
# make && make install
# apt-get -y install libssl-dev
# cd /usr/software
# cp -r /usr/software/apr-1.4.6 /usr/software/httpd-2.4.3/srclib/apr
# cp -r /usr/software/apr-util-1.5.1 /usr/software/httpd-2.4.3/srclib/apr-util
# cd httpd-2.4.3
# ./configure --prefix=/usr/local/apache \
--enable-dav \
--enable-so \
--enable-maintainer-mode \
--enable-rewrite \
--enable-deflate=shared \
--enable-ssl=shared \
--enable-expires=shared \
--enable-headers=shared \
--enable-static-support \
--with-included-apr \
--with-mpm=prefork \
--enable-cache \
--enable-file-cache \
--with-pcre=/usr/local/pcre
# make && make install
# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
#加入开机启动
# sudo sysv-rc-conf
#找到httpd一栏,勾选3,4,5,按q退出
# vi /usr/local/apache/conf/httpd.conf
ServerName localhost:80
User www
Group www
:wq
# groupadd www
# useradd -r -g www www
# /usr/local/apache/bin/httpd -k start#至此apache安装结束。