安装apache2.4.6的几个报错

在最小安装centos6.3的系统上重现了这些报错。并找到了解决方法。本来是想在服务器搭建系列里面安装apache时候说这些报错,鉴于报错比较多,而且服务器搭建里面还有对比较重要配置文件详细分析,大家在找解决方案时候可能会错过,因此单独提出。其中第九个报错,我在网上没有找到解决方案并且尝试了很多方法,最后发现是第三个处理的不彻底导致的。

1.apr报错
checking for APR... no configure: error: APR not found. Please read the documentation.
解决方法:下载最新的 apr-1.6.2.tar.gz
tar -zxvf apr-1.6.2.tar.gz cd apr-1.6.2 ./configure --prefix=/usr/local/apr make&&make install
2.gcc 报错
checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in /usr/local/src/apr-1.6.2': configure: error: no acceptable C compiler found in $PATH Seeconfig.log' for more details
解决方法:yum install gcc 如果不能联网可以查看更换yum源中加载dvd
3.libtool 报错
rm: cannot remove `libtoolT': No such file or directory config.status: executing default commands
解决办法:yum linstall libtools libtools-ltdl-devel(如果不安装或导致第个报错)

4.make报错
-bash: make: command not found
解决办法:yum install -y make autoconf automake

5.apr-util报错
checking for APR-util... no configure: error: APR-util not found. Please read the documentation
解决方法: 下载最新apr-util 安装就可以了
tar -zxvf apr-util-1.6.0.tar.gz cd apr-util-1.6.0

6.编译apr-util需要 加with-apr
./configure
checking for APR... no configure: error: APR could not be located. Please use the --with-apr option.
./configure --with-apr=/usr/local/apr/
make&&make install

7.缺少文件expat.h
解决办法:yum install expat expat-devel(其实是缺少后面这个)

8.pcre报错
checking for pcre-config... false
解决办法: yum install pcre pcre-devel(其实是缺少后面这个)
因为使用最小安装 devel的软件包都没有安装

9.这个报错找了很多方法都没有解决 最后发现和第三个报错后面那个有关
collect2: ld returned 1 exit status make[2]: [htpasswd] խϳ 1 make[2]: Leaving directory `/usr/local/src/httpd-2.4.26/support' make[1]: [all-recursive] խϳ 1 make[1]: Leaving directory `/usr/local/src/httpd-2.4.26/support' make: *** [all-recursive] խϳ 1
解决办法:yum install libtools-ltdl-devel 并重新编译安装apr-util

10.httpd 为识别的服务
手动安装都会这个问题无法使用命令service httpd start
可以使用chkconfig --add httpd 如果无法添加,vi /etc/init.d/httpd
在里面增加#!/bin/sh      #chkconfig:345 61 61      #description:Apache httpd
chkconfig --add httpd chkconfig --list|grep httpd

11.配置文件导致
AH00557: httpd: apr_sockaddr_info_get() failed for promote.cache-dns.local sing 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
启动时候有这个报错但是可以正常使用,将配置文件http.conf修改一下
ServerName localhost:80
就不会有报错了。

作者:十二楼中月
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章