Chinaunix首页 | 论坛 | 博客
  • 博客访问: 312768
  • 博文数量: 103
  • 博客积分: 1590
  • 博客等级: 上尉
  • 技术积分: 1075
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-02 10:17
文章分类

全部博文(103)

文章存档

2013年(32)

2012年(7)

2010年(64)

我的朋友

分类: LINUX

2013-05-04 23:18:53

Apache安装

官方:

 

 

wget ""

apache安装依赖APR and APR-Util,可能因找不到apr而出错。

tar -zxvf apr-1.4.6.tar.gz

cd apr-1.4.6

./configure --prefix=/usr/local

make & make install

tar -zxvf apr-util-1.5.2.tar.gz

cd apr-util-1.5.2

./configure --with-apr=/usr/local/bin

make & make install

tar -zxvf pcre-8.21.tar.gz

cd pcre-8.21

./configure --prefix=/usr/local

make & make install

tar -zxvf httpd-2.4.4.tar.gz

cd httpd-2.4.4

mv ../apr-1.4.6 srclib/apr   -R

mv ../apr-util-1.5.2 srclib/apr-util -R 

 ./configure --with-included-apr  --with-pcre=/usr/local/bin/pcre-config --with-layout=Apache --enable-modules=most --enable-mods-shared=list --with-mpm=prefork

 make & make install

#若是 --enable-mods-shared=list则将把模块静态地编译到apache中。

说明:

1.如下安装httpd-2.x时可能出错

exports.c:1582: error: previous definition of 'ap_hack_apr_proc_mutex_lockfile' was here

原因是未找到正确的apr,apu路径,要重新安装apr,apr-util,并且写出正确文件路径。

--with-apr=/usr/local/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config  

2. 发现启动时会出错/mod_dir.so: undefined symbol: apr_array_clear

改为使用--with-included-apr 及指定pcre-config ,可以正常启动:

 

tar -zxvf apr-1.4.6.tar.gz

tar -zxvf apr-util-1.5.2.tar.gz

 

cd httpd-2.4.4

mv ../apr-1.4.6 srclib/apr   -R

mv ../apr-util-1.5.2 srclib/apr-util -R

 

 ./configure --with-included-apr  --with-pcre=/usr/local/bin/pcre-config --with-layout=Apache --enable-modules=most --enable-mods-shared=list --with-mpm=prefork

看来还是--with-included-apr  最可靠!


阅读(2172) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~