1、 找不到url
2、 服務器無法處理當前請求,PHP解析出錯
3、 服務器無法處理當前請求,權限不足
1、 找不到url
瀏覽器報錯:The requested URL /zabbix/ was not found on this server
日志報錯:File does not exist: /var/www/html/zabbix
原因:Apache缺少指向/usr/share/zabbix相關目錄的配置文件
解決辦法:配置/etc/httpd/conf.d/zabbix.conf文件內容如下

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
2、 服務器無法處理當前請求,PHP解析出錯
瀏覽器報錯:10.0.0.106 is currently unable to handle this request.
日志報錯:PHP Parse error: syntax error, unexpected '[' in /usr/share/zabbix/index.php on line 32
原因:PHP版本太低,需要安裝PHP5.4以上的版本
解決辦法: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
3、 服務器無法處理當前請求,權限不足
瀏覽器報錯:10.0.0.106 is currently unable to handle this request.
日志報錯: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/