安裝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
就不會有報錯了。

作者:十二樓中月
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯繫作者獲得授權並註明出處。

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