安装httpd-2.4.20

回复 收藏
报错太多了 需要安装到包也好多
[root@pxe src]# cd httpd-2.4.20
[root@pxe httpd-2.4.20]# ./configure --prefix=/usr/local/apache2/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
需要下载apr和apr-utils并解压到 ./srclib/ 目录下, 再进行编译。2.4版本要求apr1.4以上版本
[root@pxe src]# cp -r apr-1.4.6 httpd-2.4.20/srclib/apr
[root@pxe src]# cp -r apr-util-1.4.1 httpd-2.4.20/srclib/apr-util
[root@pxe src]# cd httpd-2.4.20
[root@pxe httpd-2.4.20]# ./configure --prefix=/usr/local/apache2/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
configure: error: in `/usr/local/src/httpd-2.4.20/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
configure failed for srclib/apr
解决方法:安装gcc
[root@pxe httpd-2.4.20]# yum install -y gcc
[root@pxe httpd-2.4.20]# ./configure --prefix=/usr/local/apache2/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
解决方法:需要安装pcre
[root@pxe src]# cd pcre-8.34
[root@pxe pcre-8.34]# ./configure && make && make install
configure: error: You need a C++ compiler for C++ support.
[root@pxe pcre-8.34]# yum install -y gcc-c++
[root@pxe pcre-8.34]# ./configure && make && make install
[root@pxe pcre-8.34]# echo $?
0
[root@pxe src]# cd httpd-2.4.20
[root@pxe httpd-2.4.20]# ./configure --prefix=/usr/local/apache2/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
解决方法:安装zlib包
[root@pxe src]# cd zlib-1.2.3
[root@pxe zlib-1.2.3]# ./configure && make && make install && echo $?
[root@pxe src]# cd httpd-2.4.20
[root@pxe httpd-2.4.20]# ./configure --prefix=/usr/local/apache2/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
[root@pxe httpd-2.4.20]# make && make install
make[4]: *** [mod_deflate.la] Error 1
make[4]: Leaving directory `/usr/local/src/httpd-2.4.20/modules/filters'
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/usr/local/src/httpd-2.4.20/modules/filters'
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.20/modules'
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.20'
make: *** [all-recursive] Error 1
错误:make 出现错误 解决方法:
[root@pxe zlib-1.2.3]# make clean
[root@pxe zlib-1.2.3]# ./configure
[root@pxe zlib-1.2.3]# vi Makefile
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
[root@xin1 httpd-2.4.7]#  make && make install
[root@pxe src]# cd httpd-2.4.20
[root@pxe httpd-2.4.20]# ./configure --prefix=/usr/local/apache2/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
[root@pxe httpd-2.4.20]# make && make install
[root@pxe httpd-2.4.20]# vi /etc/profile.d/path.sh

#!/bin/bash
export PATH=$PATH:/usr/local/apache2/bin/

[root@pxe httpd-2.4.20]# . /etc/profile.d/path.sh
[root@pxe httpd-2.4.20]# apachectl stop
[root@pxe httpd-2.4.20]# apachectl start
[root@pxe src]# echo "/usr/local/apache2/bin/apachectl  start"  >> /etc/rc.local
开机启动
[root@pxe src]# setenforce 0
[root@pxe src]# /etc/init.d/iptables stop
















2016-05-03 19:16 举报
已邀请:
0

杨金彪

赞同来自:

+1

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: