一、下载源码安装包

# 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... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... no
configure: 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.status
config.status: creating Makefile
config.status: creating include/apr.h
config.status: creating build/apr_rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating apr-1-config
config.status: creating apr.pc
config.status: creating test/Makefile
config.status: creating test/internal/Makefile
config.status: creating include/arch/unix/apr_private.h
config.status: executing libtool commands
rm: cannot remove `libtoolT': No such file or directory
config.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... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
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... no
configure: 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

到这编译就算完成了。


©著作权归作者所有:来自51CTO博客作者mob604756fa4732的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. H.264播放器在视频播放时报错Mixed Content的问题排查与解决
  2. 解决DELL R630服务器iDrac8虚拟控制台报错:查看器已终止 网络连接
  3. 解决Laravel使用laravel-excel扩展包(maatwebsite/excel)导入报
  4. 谈谈使用JS库解决小程序跨页传递消息和数据问题的方法
  5. 移动端复杂运营页解决方案的探索和实践
  6. 大数据平台快速解决方案
  7. laravel 安装扩展包(laravel/scout)报错,大意是版本不匹配解决办法
  8. SpaceSniffer(磁盘大小扫描分析) 彻底解决C盘爆满问题 清理C盘必
  9. 唧唧Down(B站视频下载) 彻底解决你的B站视频下载问题

随机推荐

  1. golang channel有什么好处
  2. golang channel是什么
  3. go中的数据结构-字典map详解
  4. Golang Cgo是什么
  5. go中的数据结构-接口interface(详解)
  6. go defer(go延迟函数)介绍
  7. golang cap是什么意思
  8. go get命令详解
  9. go语言结构体详解
  10. go语言中go build和go install的区别