编译安装Zabbix遇到的坑

第一个坑
apache基于端口的虚拟主机:
这样设置:

Listen 8080
<VirtualHost *:8080>
    ServerAdmin 1771566679@qq.com
    DocumentRoot "/BLOG/httpd/htdocs/zabbix"
    DirectoryIndex index.php index.html
    <FilesMatch \.php$>
    SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>
    ServerName www.yangyang.host
    ServerAlias www.yangyang.host/zabbix
    ErrorLog "logs/zabbix_error_log"
    CustomLog "logs/zabbix_access_log" common
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
</VirtualHost>

第二个坑:
在初始化Zabbix的时候,遇到这样的错误:在这里插入图片描述
有许多模块没有,尤其是缺少JPEG,FreeType支持。这没有办法PHP需要重新编译。
编译参数如下:

./configure --prefix=/BLOG/php  --enable-mysqlnd --with-mysqli=mysqlnd --with-openssl  --with-pdo-mysql=mysqlnd --enable-mbstring  --with-freetype-dir=/BLOG/zabbix_libary  --with-jpeg-dir=/BLOG/zabbix_libary1 --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-maintainer-zts --disable-fileinfo --with-gd

第三个坑:
无法连接到数据库,报错:
Error connecting to database: No such file or directory
修改/etc/php.ini文件
vim /etc/php.ini
找到这一项
mysqli.default_socket = /tem/mysql.sock
后面改成你的mysql的sock文件的地址。

第四个坑:
报错:
Error connecting to database: Access denied for user ‘zabbix’@‘localhost’ (using password: YES)
别看啦 。你mysql初始化的密码和你输入的不一样。

第五个坑:
启动zabbix_server和zabbix_agent的时候,启动zabbix_agent没问题,但是启动zabbix_server遇到了
./zabbix_server: error while loading shared libraries: libmariadb.so.3: cannot open shared object file: No such file or directory报错。
这很明显是缺失了libmariadb.so.3模块,她找不到,所就要指给他,又进行ldd查看,发现真没有。
解决:
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
ldconfig

这回启动就没问题啦,注意,我这里是我编译安装时候的mysql路径,你的也许不一样,自行修改。

第六个坑:
我发现zabbix_agent和zabbix_server脚本只能启动,不能停止,我去查了yum安装的zabbix里面的systemctl启动文件,发现:

他的关闭就是Kill掉。

。。。。

好啦,以后再遇到再补充把。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值