搭建zabbix服务器常见问题解析处理

 

  一、 找不到url

  二、 服务器没法处理当前请求,PHP解析出错

  三、 服务器没法处理当前请求,权限不足

 

 

 

 

 

一、 找不到url

    浏览器报错:The requested URL /zabbix/ was not found on this serverphp

    日志报错:File does not exist: /var/www/html/zabbixhtml

    缘由:Apache缺乏指向/usr/share/zabbix相关目录的配置文件mysql

    解决办法:配置/etc/httpd/conf.d/zabbix.conf文件内容以下web

mv /etc/httpd/conf.d/zabbix.conf{,.bak} cat >>/etc/httpd/conf.d/zabbix.conf<<EOF # # Zabbix monitoring system php web frontend # Alias /zabbix /usr/share/zabbix <Directory "/usr/share/zabbix"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all <IfModule mod_php5.c> php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value max_input_vars 10000 php_value date.timezone Asia/Shanghai </IfModule> </Directory> <Directory "/usr/share/zabbix/conf"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> <Directory "/usr/share/zabbix/api"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> <Directory "/usr/share/zabbix/include"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> <Directory "/usr/share/zabbix/include/classes"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> EOF /etc/init.d/httpd restart
配置脚本命令

 

二、 服务器没法处理当前请求,PHP解析出错

    浏览器报错:10.0.0.106 is currently unable to handle this request.sql

    日志报错:PHP Parse error:  syntax error, unexpected '[' in /usr/share/zabbix/index.php on line 32apache

    缘由:PHP版本过低,须要安装PHP5.4以上的版本api

    解决办法:CentOS6默认yum安装的是php5.3,须要构建yum源安装或进行源码安装高版本PHP浏览器

    配置命令服务器

yum remove php php-mysql php-cli php-xml php-gd php-common php-bcmath php-pdo php-mbstring -y rpm -qa|grep php rpm -i https://mirror.webtatic.com/yum/el6/latest.rpm yum install php55w php55w-mysql php55w-cli php55w-xml php55w-gd php55w-common php55w-bcmath php55w-pdo php55w-mbstring -y php -v

 

三、 服务器没法处理当前请求,权限不足

    浏览器报错:10.0.0.106 is currently unable to handle this request.frontend

    日志报错:PHP Fatal error:  require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /usr/share/zabbix/include/classes/core/ZBase.php on line 276

    缘由:apache对/etc/zabbix/web/maintenance.inc.php文件的权限不足致使处理中断

    解决办法:更改/etc/zabbix/web/目录的属主

    解决命令:

chown -R apache. /etc/zabbix/web/ /etc/init.d/httpd restart ls -l /etc/zabbix/web/
相关文章
相关标签/搜索