安裝apache2.4.6的幾個報錯
阿新 • • 發佈:2019-01-30
在最小安裝centos6.3的系統上重現了這些報錯。並找到了解決方法。本來是想在伺服器搭建系列裡面安裝apache時候說這些報錯,鑑於報錯比較多,而且伺服器搭建裡面還有對比較重要配置檔案詳細分析,大家在找解決方案時候可能會錯過,因此單獨提出。其中第九個報錯,我在網上沒有找到解決方案並且嘗試了很多方法,最後發現是第三個處理的不徹底導致的。
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 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 libtool 報錯 rm: cannot remove `libtoolT': No such file or directory config.status: executing default commands 解決辦法:yum linstall libtools libtools-ltdl-devel(如果不安裝或導致第個報錯) make報錯 -bash: make: command not found 解決辦法:yum install -y make autoconf automake 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 編譯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 缺少檔案expat.h 解決辦法:yum install expat expat-devel(其實是缺少後面這個) pcre報錯 checking for pcre-config... false 解決辦法: yum install pcre pcre-devel(其實是缺少後面這個) 因為使用最小安裝 devel的軟體包都沒有安裝 這個報錯找了很多方法都沒有解決 最後發現和第三個報錯後面那個有關 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 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 配置檔案導致 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 就不會有報錯了。