四、错误分析
1、apr错误
Checking for apr
checking for apr-1-config... no
configure: error: apr-1-config binary not found in path
解决
yum -y install apr-devel apr-util expat-devel
2、confuse错误
Checking for confuse
checking for cfg_parse in -lconfuse... no
Trying harder including gettext
checking for cfg_parse in -lconfuse... no
Trying harder including iconv
checking for cfg_parse in -lconfuse... no
libconfuse not found
解决
rpm -ivh libconfuse-*
3、expat错误
Checking for expat
checking for XML_ParserCreate in -lexpat... no
libexpat not found
解决
yum install expat-devel
4、pcre错误
Checking for pcre
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
checking pcre.h usability... no
checking pcre.h presence... no
checking for pcre.h... no
checking for pcre_compile in -lpcre... no
libpcre not found, specify --with-libpcre=no to build without PCRE support
解决
安装pcre
5、乱码错误

缺少字体文件,由于CentOS最小化安装缺少一些字体文件,可以从别的机器复制过来,或这见附件,放到/usr/share/fonts/中,然后重启httpd
6、ganglia的web页面显示错误
It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
解决
修改php.ini文件,修改参数:date.timezone = PRC
修改/usr/local/apache2/htdocs/ganglia/header.php文件,在第二行添加:date_default_timezone_set("PRC");
错误中的错误
找不到php.ini文件
解决
复制php安装文件夹下的php.ini-production文件到/etc/php.ini
也可以重新编译安装php,加入编译参数--with-config-file-path=/usr/local/php/etc来手工指定php配置文件路径,然后把php.ini-production文件复制到/usr/local/php/etc/php.ini
7、httpd启动报错
错误1
httpd: apr_sockaddr_info_get() failed for ganglia
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
原因
没有在apache的conf/http.conf中设定ServerName。所以apache会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。
解决
设定httpd.conf文件中的 ServerName:ServerName localhost:80
在 /etc/hosts 中填入自己的主机名称:127.0.0.1 server1
错误2
httpd: Syntax error on line 140 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_dir.so into server: /usr/local/apache2/modules/mod_dir.so: undefined symbol: apr_array_clear
原因
apache编译的时候缺少模块
解决
重新编译,制定参数--with-included-apr
8、ganglia启动失败
[function.mkdir]: Permission denied
应该是Makefile中设置的用户名daemon错误,这个用户名要和httpd.conf中的User和Group一致,否则导致无权限读写文件,并且修改Makefile后要运行make install安装,否则仍然报错
更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
