Centos6.8下编译安装Apache 2.4.25详细过程

今天的文章将要给大家介绍Centos6.8下编译安装Apache 2.4.25的过程,内容很详细,希望对大家有帮助。

一、下载源码安装包

# cd /usr/local/src# wget 'http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.25.tar.gz'

二、解压安装

# tar zxf httpd-2.4.25.tar.gz# cd httpd-2.4.25# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-mpm=worker

在这过程中 错如下:

checking for chosen layout... Apachechecking for working mkdir -p... yeschecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuconfigure:configure: Configuring Apache Portable Runtime library...configure:checking for APR... noconfigure: error: APR not found.  Please read the documentation.

解决APR not found 过程如下:

# cd /usr/local/src# wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz# tar zxf apr-1.5.2.tar.gz# ./configure --prefix=/usr/local/apr# make && make install

在编译apr的的过程中 错如下:

configure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating include/apr.hconfig.status: creating build/apr_rules.mkconfig.status: creating build/pkg/pkginfoconfig.status: creating apr-1-configconfig.status: creating apr.pcconfig.status: creating test/Makefileconfig.status: creating test/internal/Makefileconfig.status: creating include/arch/unix/apr_private.hconfig.status: executing libtool commandsrm: cannot remove `libtoolT': No such file or directoryconfig.status: executing default commands

解决方法如下:

在configure里面 RM=’$RM -f’ 这里的$RM后面一定有一个空格。 如果后面没有空格,直接连接减 ,就依然会 错。把RM=’$RM’改为RM=’$RM -f’

接着重新编译Apache:

./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-mpm=worker --with-apr=/usr/local/apr

错如下:

checking for chosen layout... Apachechecking for working mkdir -p... yeschecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuconfigure:configure: Configuring Apache Portable Runtime library...configure:checking for APR... yes  setting CC to "gcc"  setting CPP to "gcc -E"  setting CFLAGS to " -g -O2 -pthread"  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"  setting LDFLAGS to " "configure:configure: Configuring Apache Portable Runtime Utility library...configure:checking for APR-util... noconfigure: error: APR-util not found.  Please read the documentation.

解决APR-util not found过程:

# wget 'http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz'# tar zxf apr-util-1.5.2.tar.gz# cd apr-util-1.5.2# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config# make && make install

编译完成后,我们再次重新编译Apache:

# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

enable-so 允许apache支持动态模块 enable-rewrite 支持URL重定向 with-mpm=worker apache进程模型为worker 默认为prefork

最后:

# make && make install

控件

热门格式转换工具在线订购特惠中点击查看>>>>


图片1
标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2017年6月8日
下一篇 2017年6月8日

相关推荐

发表回复

登录后才能评论