搭建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/
相關文章
相關標籤/搜索