温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

LNMP构建编译安装zabbix

发布时间:2020-07-25 13:42:59 来源:网络 阅读:461 作者:Arcehe 栏目:web开发

首先准备LNMP架构一枚。。。。大部分可安装此文安装http://xiangcc.blog.51cto.com/10201823/1699753
php页面解析按照此次安装
准备php5.6版本
tar zxf php-5.6.10.tar.gz -C .
进入解压目录下,执行:
./configure --prefix=/usr/local/nginx_php --with-config-file-path=/usr/local/nginx_php/etc/ --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysql-sock=/usr/local/mysql-5.5.46tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-sockets --enable-bcmath --with-gettext --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl --with-jpeg-dir=/usr/local/jpeg/

在zabbix安装过程中出现报错,其
错误【1】
PHP  sockets Fail
编译时添加--enable-sockets
错误【2】
PHP bcmath Fail
编译时添加 --enable-bcmath
错误【3】
PHP gettext Fail
编译时添加 --enable-gettext

安装make;make install

首先下载zabbix
mysql可以选择编译安装的方式
安装依赖库:yum -y install net-snmp-devel curl-devel
创建zabbix用户用来编译安装zabbix
useradd -M -s /sbin/nologin zabbix     不创建家目录及禁止登录
进入下载zabbix的目录下,解压
tar zxf zabbix-2.0.15.tar.gz -C .
mysql -uroot -p

进入数据库:
create database zabbix;        创建zabbix库
grant all on zabbix.* to zabbix@localhost identified by 'zabbix';    设置zabbix的访问权限

进入zabbix解压目录下,导入zabbix的数据表单等,2.0以后的版本一定要安照导入顺序来导入
[root@localhost zabbix-2.0.15]# mysql -uroot -p zabbix < database/mysql/schema.sql
Enter password:
[root@localhost zabbix-2.0.15]# mysql -uroot -p zabbix < database/mysql/p_w_picpaths.sql
Enter password:
[root@localhost zabbix-2.0.15]# mysql -uroot -p zabbix < database/mysql/data.sql
Enter password


./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl  
make
make install
编译安装zabbix

在zabbix解压目录下拷贝
cp -r zabbix-2.0.15/frontends/php /usr/local/http/zabbix
给予nobody用户权限
chown -R nobody:nobody /usr/local/http/zabbix

拷贝系统启动脚本及服务端文件
cp zabbix-2.0.15/misc/init.d/fedora/core/zabbix_server  /etc/init.d/zabbix_server
cp zabbix-2.0.15/misc/init.d/fedora/core/zabbix_agentd /etc/init.d


启动zabbix服务
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start    //启动服务
chkconfig --add zabbix_server            
chkconfig --add zabbix_agentd
chkconfig zabbix_server on
chkconfig zabbix_agentd on    //开机自启动
在nginx中写入zabbix的php网页路径添加服务主机即可,访问服务主机ip进行下一步安装

当出现date(): It is not safe to rely on the system's timezone settings.报错时
vim /usr/local/nginx_php/etc/php.ini
找到date.timezone =  
改成date.timezone =  'Asia/Shanghai'

点击next下一步,安照提示错误在php配置文件/usr/local/nginx_php/etc/php.ini中修改三项配置如下以便符合最低安装要求
post_max_size = 16M
max_execution_time = 300
max_input_time = 300

保存后重启zabbix
/etc/init.d/zabbix-server restart
/etc/init.d/zabbix-agent restart

discuz默认登录账户admin 密码zabbix


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI