http://www.cnblogs.com/qyddbear/archive/2012/05/04/2451623.html
【推荐完整步骤】
安装包解压:httpd-2.2.22.tar.gz和httpd-2.4.2.tar.gz,当我纠结在上述错误的时候,最新版2.4.2发布了。因为后者scrlib不提供apr,apr-util,pcre,因此借用了较低版本的。注意:用2.2.22做下面的第4步会出错。
1. 安装apr
root@ubuntu:/home/qy/share# cd httpd-2.2.22
root@ubuntu:/home/qy/share/httpd-2.2.22# cd apr
root@ubuntu:/home/qy/share/httpd-2.2.22/apr# ./configure --prefix=/usr/local/apr
root@ubuntu:/home/qy/share/httpd-2.2.22/apr# make
root@ubuntu:/home/qy/share/httpd-2.2.22/apr# make install
2. 安装apr-util
root@ubuntu:/home/qy/share/httpd-2.2.22/apr# cd ..
root@ubuntu:/home/qy/share/httpd-2.2.22# cd apr-util
root@ubuntu:/home/qy/share/httpd-2.2.22/apr-util# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
root@ubuntu:/home/qy/share/httpd-2.2.22/apr-util# make
root@ubuntu:/home/qy/share/httpd-2.2.22/apr-util# make install
3. 安装pcre
root@ubuntu:/home/qy/share/httpd-2.2.22/apr-util# apt-get install libpcre3-dev
4. 安装apache
root@ubuntu:/home/qy/share/httpd-2.2.22/apr-util# cd /home/qy/share/httpd-2.4.2
root@ubuntu:/home/qy/share/httpd-2.4.2# ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-dav --enable-mainer-mode --enable-rewrite
root@ubuntu:/home/qy/share/httpd-2.4.2# make
root@ubuntu:/home/qy/share/httpd-2.4.2# make install
Apache作为开源服务器,在编译前需要了解系统的库安装情况,某些模块需要依赖于特定的库,如果这些库不存在,配置脚本将自动忽略这些库的编译。经过检测时候会生成合适的MakeFile文件。这里特别提醒一句,如果直接执行配置脚本,是不会编译额外的模块的,我们希望使用额外模块时,需要在运行配置脚本命令后加入参数,让其尽最大可能编译可用的库。
5. 启动apache
root@ubuntu:/home/qy/share/httpd-2.4.2# /usr/local/apache/bin/apachectl start
阅读(3916) | 评论(0) | 转发(1) |