全部博文(105)
分类: LINUX
2012-03-12 12:12:23
【注意事项】
1.http2.2.* 不能直接升级到2.4.1,需要先停止apache,将http.conf 改名成http.conf-2.2.*
2.http2.4.1 目前不再支持php5.2.* 可用的php为5.3.10
php5.2* 会报 httpd: Syntax error on line 163 of httpd.conf: Cannot load modules/libphp5.so into server: modules/libphp5.so: undefined symbol: unixd_config
3.http2.4.1 不在需要NameVirtualHost以及不再支持ServerName * 这种写法
使用ServerName * 会报Invalid ServerName “*” use ServerAlias to set multiple server names.
【安装配置过程1】
[root@xupeng build]cd httpd-2.4.1
[root@xupeng httpd-2.4.1]# ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-ssl --with-ssl=/usr/local/openssl/ --enable-rewrite --enable-so
checking for APR... no
configure: error: APR not found. Please read the documentation.
[root@xupeng httpd-2.4.1]# ./buildconf
WARNING: You are using an outdated version of autoconf.
WARNING: This may lead to less than optimal performance of httpd.
WARNING: You should use autoconf 2.60 or newer.
You don't have a copy of the apr source in srclib/apr.
Please get the source using the following instructions,
or specify the location of the source with
--with-apr=[path to apr] :
svn co srclib/apr
[root@xupeng httpd-2.4.1]svn co srclib/apr
[root@xupeng httpd-2.4.1]cd srclib/apr
[root@xupeng apr]# ./buildconf
buildconf: checking installation...
buildconf: python version 2.4.3 (ok)
buildconf: autoconf version 2.59 (ok)
buildconf: libtool not found.
You need libtool version 1.4 or newer installed
to build APR from SVN.
(libtool 2.x not supported yet)
[root@xupeng apr]# yum install libtool
[root@xupeng apr]# ./configure --prefix=/usr/local/apr
configure: error: No XML parser found! Please specify --with-expat or --with-libxml2
[root@xupeng apr]# ./configure --prefix=/usr/local/apr --with-libxml2 && make && make install
[root@xupeng httpd-2.4.1]# ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-ssl --with-ssl=/usr/local/openssl/ --enable-rewrite --enable-so --with-apr=/usr/local/apr
configure: error: pcre-config for libpcre not found. PCRE is required and available from
[root@xupeng build]wget
[root@xupeng build]tar zxvf pcre-8.21.tar.gz
[root@xupeng build] cd pcre-8.21
[root@xupeng pcre-8.21]./configure --prefix=/usr/local/pcre && make && make install
[root@xupeng httpd-2.4.1]./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-ssl --with-ssl=/usr/local/openssl/ --enable-rewrite --enable-so --with-apr=/usr/local/apr --with-pcre=/usr/local/pcre && make && make install
如服务器上没有svn环境可参考方法2
【安装配置方法2】
如果之前安装过httpd或者yum方式安装了apr apr-util需要卸载
yum remove apr apr-util httpd
apr,apr-util下载地址
编译和安装 apr 1.4.6
cd apr
./configure --prefix=/usr/local/apr-httpd/ && make && make install
编译和安装 apr-util 1.4.1
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/ && make && make install
编译 httpd
cd ../httpd-2.4.1
./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-speling --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-ssl --with-ssl=/usr/local/openssl/ --enable-rewrite --enable-so --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/
make && make install