您的位置:首页 > 运维架构 > Apache

安装apache的几个报错

2019-01-22 06:26 483 查看

在最小安装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

  1. 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 See
config.log' for more details
解决方法:yum install gcc 如果不能联网可以查看更换yum源中加载dvd

  1. libtool 报错

rm: cannot remove `libtoolT': No such file or directory config.status: executing default commands
解决办法:yum linstall libtools libtools-ltdl-devel(如果不安装或导致第个报错)

  1. make报错

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

  1. 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

  1. 编译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

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

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

  1. 这个报错找了很多方法都没有解决 最后发现和第三个报错后面那个有关

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(centos7不对,亲测。建议apr和apr-util改用1.5版本,未测试不清楚是否可以)

  1. 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

  1. 配置文件导致

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
就不会有报错了。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息