文章内容
2018/3/19 19:32:06,作 者: 黄兵
Ubuntu 16.04 安装zabbix
手上的服务器比较多,准备安装zabbix 3.2监控现在10多台服务器。
在安装zabbix 3.2的过程中遇到了很多问题,记录下来。
具体安装过程可以参考这篇文章:Ubuntu 16.04安装Zabbix 3.2 版本
中间遇到了很多问题,通过寻找资料最后把问题解决了,现在我把遇到的问题列下来,解决问题的网址记录如下:
1、如何重启nginx服务器,如何在Ubuntu上安装nginx:Nginx
2、在Ubuntu上面安装php+Nginx的无法运行,参考这篇文章:nginx php-fpm 配置不当,引起的php文件无法执行
3、在最近在使用sudo apt-get install zabbix-frontend-php的时候,报如下错误:
Errors were encountered while processing:
mariadb-server-10.0
FATAL -> Failed to fork.
解决问题参考了这篇文章:Ubuntu apt get faile to fork解决方法
4、在安装zabbix的时候,报如下错误:
Minimum required size of PHP post is 16M (configuration option "post_max_size").
Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time").
Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time").
Time zone for PHP is not set (configuration parameter "date.timezone").
解决方案:Zabbix3.0+LNMP安装
5、修改了上面错误之后,不知道php.ini文件在哪里,为了找php.ini文件,我参考了这篇文章:LNMP 环境,php.ini 修改之后为什么不生效
6、最后一个报错,修复了最久,报错内容如下:
PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).
出现了这个错误,参照这篇文章解决了问题:zabbix在ubuntu16.04上的安装,同时也参考了这篇文章:Installing Zabbix 3.2 on AWS Ubuntu 16.04
7、在使用php -m的时候,看安装了那些模块,但是报如下错误:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/bcmath.so' - /usr/lib/php/20160303/bcmath.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: bcmath: Unable to initialize module
Module compiled with module API=20170718
PHP compiled with module API=20160303
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/php_soap.dll' - /usr/lib/php/20160303/php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
出现这个错误的截图:
出现这个错误的原因是安装的bcmath的模块与php版本不同,我的是php 7.1但是安装的好像不是对应的模块,我参考了这篇文章安装:How do I enable the bcdiv function in PHP 7.0?
同时出现上面的错误,版本不对,我参考了这篇文章:2 php startup: imagick: unable to initialize module module compiled with api = 20060613 php compiled with module api=20090626 [closed]
还是没有解决我的问题,我又在google上面搜索:php 7.1 bcmath的相关问题,这篇文章解决了我问题:PHP 7.1 bcmath Not Working
但是我在输命令(add-apt-repository ppa:ondrej/php)的时候,如下提示:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x* in position *: ordinal not in range(128)
最后参考这篇文章解决了问题:UnicodeDecodeError: 'ascii' codec can't decode byte 0x* in position *: ordinal not in range(128)
之后继续执行命令:
apt update apt install php7.1-bcmath
终于把问题全部解决了,重启php,用如下命令:
/etc/init.d/php7.1-fpm restart
重启之后,刷新zabbix的安装界面,成功进行下一步。
最后安装完成。来一张安装成功后的截图,如下:
安装zabbix用了一天时间,中间遇到了很多问题,这些问题都是我一点一点的记录下来,最后汇总。
方便后来人,同时大家有什么问题也可以在下面留言。
通过这次架设zabbix,学到了很多内容。也解决了很多问题,这些都是一笔宝贵的财富。
同时也凸显出来我的linux操作问题,以后要加强学习。
好了时间也不早了,安装完zabbix才刚刚开始,后面还要具体学习zabbix。
同时欢迎大家在下面留言交流。
如果是在Ubuntu 18.04 LTS 安装zabbix server 4 可以参考这篇文章:HOW TO INSTALL ZABBIX SERVER 4 ON UBUNTU 18.04 LTS
评论列表