zabbix3.0.4源码编译安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix3.0.4源码编译安装相关的知识,希望对你有一定的参考价值。
本文简单介绍下zabbix3.0.4的安装。
环境:
数据库:192.168.115.12
nginx:192.168.115.31
php:192.168.115.31
zabbix:192.168.115.31
一、安装nginx1.10.1
1.编译软件
# yum install pcre-devel openssl-devel # tar xf nginx-1.10.1.tar.gz # cd nginx-1.10.1 # ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-select_module--with-poll_module --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_sub_module --with-http_stub_status_module # make # make install
2.修改配置文件
server { listen 80; server_name 192.168.115.31; location / { root html; index index.php index.html index.htm; } location ~ \.(php|php5)?$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name; include fastcgi_params; } }
二、安装php5.5.38
1.编译软件
zabbix3.0需要php5.4以上的版本
#tar xf php-5.5.38.tar.gz #cd php-5.5.38 ./configure --prefix=/usr/local/php--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir=/usr/local/libiconv--with-freetype-dir--with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr--with-gettext --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization--with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd \
--enable-gd-native-ttf--with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --enable-short-tags--enable-static --with-xsl --with-fpm-user=nginx--with-fpm-group=nginx--enable-ftp --enable-opcache=no
2.修改php配置
修改php.ini
max_execution_time = 300 max_input_time = 300 post_max_size = 16M date.timezone = Asia/Shanghai
3.php以fpm方式运行
提供php-fpm配置文件
# cd /usr/local/php/etc # cp php-fpm.conf.default php-fpm.conf # /usr/local/php/sbin/php-fpm
4.测试php是否正常运行
提供测试页面
# cat index.php <?php phpinfo(); ?>
三、安装zabbix3.0.4
1.软件编译
# useradd zabbix -s /sbin/nologin -M # tar xf zabbix-3.0.4.tar.gz # cd zabbix-3.0.4 # ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 # make && make install
2.数据库配置
mysql>CREATE DATABASE zabbix CHARACTER SET utf8; mysql>GRANT ALL ON zabbix.* TO ‘zabbix‘@‘192.168.%.%‘ IDENTIFIED BY ‘123456‘; # /usr/local/mysql/bin/mysql -uzabbix -h192.168.115.12 -p123456 mysql> use zabbix; mysql> source /root/zabbixsql/schema.sql mysql> source /root/zabbixsql/images.sql mysql> source /root/zabbixsql/data.sql
初始化sql文件在源码包/root/zabbix-3.0.4/database/mysql目录下
3.修改zabbix-server配置文件
LogFile=/usr/local/zabbix/logs/zabbix_server.log DBHost=192.168.115.12 DBName=zabbix DBUser=zabbix DBPassword=123456 Timeout=4 LogSlowQueries=3000
4.启动zabbix-server服务
提供服务启动脚本
# cp /root/zabbix-3.0.4/misc/init.d/fedora/core/zabbix_* /etc/init.d/ # chmod +x /etc/init.d/zabbix_server # service zabbix_server start
5.配置web环境
# cp -rp /root/zabbix-3.0.4/frontends/php /usr/local/nginx/html/zabbix
至此安装完毕,默认登入用户名admin,密码zabbix。
本文出自 “linux之路” 博客,请务必保留此出处http://hnr520.blog.51cto.com/4484939/1843200
以上是关于zabbix3.0.4源码编译安装的主要内容,如果未能解决你的问题,请参考以下文章
CentOS 6.8编译PHP 7.0.10安装Zabbix3.0.4