zabbix安装setup界面常见错误处理

错误1、zabbix/setup.php was not found on this serve
提示如上错误大致有以下几个原因:
原因一:是否安装了apache,以便解析html
解决办法:
安装apache
原因二:php可能没有完全安装好
解决办法:
重新编译安装或是yum重新安装

yum -y install php php-gd gcc php-mysql php-xml php-devel

原因三:apache的配置文件没有提供对应php版本的支持
解决办法:

vi /etc/httpd/conf/httpd.conf
#模块中添加php支持
  DirectoryIndex index.html index.php
 AddType application/x-httpd-php .php .php3 .php4 .php5

修改完成后需重新启动apache

systemctl restart httpd

原因四:apache的配置文件中DocumentRoot的参数值没有改成zabbix的路径,zabbix默认的路径 是/var/www/html/下
解决办法:

vi /etc/httpd/conf/httpd.conf
#配置zabbix的html路径
DocumentRoot "/var/www/html"

修改完成后需重新启动apache

systemctl restart httpd

原因五:apache的配置没有配置server解析
查看日志发现如下提示:

tail -100f /var/log/message
httpd: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::36e5:d880:a6f1:73c. Set the 'ServerNa
me' directive globally to suppress this message

解决方法:

vi /etc/httpd/conf/httpd.conf   
将如下代码段修改为 ServerName  localhost:80
#ServerName www.example.com:80

错误2、zabbix安装setup界面出现bcmath与mbstring显示为fail、PHP ldap 显示Warning处理
解决办法:

# yum install php-devel -y
# tar -zxf php-5.4.16.tar.gz 
# cd php-5.4.16/ext/bcmath/
# which phpize
# find / -name php-config
# ./configure --with-php-config=/usr/bin/php-config
# make && make install
# ll /usr/lib64/php/modules/
 # ll /opt/php5.4.16/php-5.4.16/ext/bcmath/modules
# cd ../mbstring/
# /usr/bin/phpize 
# ./configure --with-php-config=/usr/bin/php-config
# make && make install
# yum -y install openldap openldap-devel
# cp -frp /usr/lib64/libldap* /usr/lib/
# cd /opt/php5.4.16/php-5.4.16/ext/ldap
# /usr/bin/phpize
# ./configure --with-php-config=/usr/bin/php-config && make && make install
$ 重启apache搞定
# systemctl restart httpd
如果还是出现fail则直接指定库位置,再重启httpd服务
# vi /etc/php.ini
    extension=/usr/lib64/php/modules/bcmath.so
    extension=/usr/lib64/php/modules/mbstring.so

zabbix安装setup界面常见错误处理_第1张图片
zabbix安装setup界面常见错误处理_第2张图片

错误3、数据库无法正常连接本机的mysql.sock

错误提示:

Error connecting to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

原因是zabbix_server默认会去读取/var/lib/mysql/下的mysql.sock 解决办法是创建该路径,并创建软连接,操作指令如下

# mkdir /var/lib/mysql
# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
# chown -R mysql:mysql /var/lib/mysql
# vi /etc/php.ini
mysql.default_socket = /var/lib/mysql/mysql.sock
# systemctl restart httpd

zabbix安装setup界面常见错误处理_第3张图片

错误4、zabbix升级后界面错乱

# service zabbix_server start

错误日志:

# tail -100f /var/log/messages
zabbix_server: Starting zabbix_server:  
 /usr/local/zabbix/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory

解决方法:

# find / -name 'libmysqlclient*'
/usr/lib64/mysql/libmysqlclient.so.18
/usr/lib64/mysql/libmysqlclient.so.18.0.0
/mysql/mysql/lib/libmysqlclient.a
/mysql/mysql/lib/libmysqlclient.so
/mysql/mysql/lib/libmysqlclient.so.20
/mysql/mysql/lib/libmysqlclient.so.20.3.15
# ln -s /mysql/mysql/lib/libmysqlclient.so.20 /usr/lib64

zabbix安装setup界面常见错误处理_第4张图片

你可能感兴趣的:(监控)