Zabbix实战-简易教程(4)--Server端安装

在数据库安装完成后,接着开始安装server端了。我们这里采用yum安装。

3.2.0 安装需求

● PHP 5.6.18
● curl 7.47.1
● zabbix_server (Zabbix) 3.0.0
● zabbix_agentd (daemon) (Zabbix) 3.0.0

3.2.1 安装rpm源(zabbix3.0、php5.6、php5.6-fpm)

 

#安装zabbix3.0yum源

yum clean all
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

# 安装epel yum源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm


# 安装php5.6 yum源
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

#安装php环境

yum install  php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap --skip-broken

#安装php-fpm

yum install php56w-fpm

 

3.2.2 安装mysql

 上面已经完成。

3.2.3 安装server端

yum install zabbix-server-mysql zabbix-web-mysql zabbix-sender
yum install zabbix-agent

3.2.4 初始化数据库

Create zabbix database and user on MySQL.
# mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> exit
Import initial schema and data.
# cd /usr/share/doc/zabbix-server-mysql-3.0.4/create
# mysql -uroot -p zabbix < schema.sql
# mysql -uroot -p zabbix < images.sql
# mysql -uroot -p zabbix < data.sql

3.2.5 配置文件修改

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

Start Zabbix server process.

# service zabbix-server start

3.2.6 配置 web前端(php.ini文件)

注意(Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/zabbix.conf.)
 Some PHP settings must be configured.
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
date.timezone = Asia/Shanghai

3.2.7 安装nginx

Nginx安装详见:Nginx概述和安装(1)

 

3.2.8 初始化web

修改配置文件权限

chown -R nginx:nginx /usr/share/zabbix/
chown -R nginx:nginx /etc/zabbix/web/

 修改web配置文件

# cat nginx.conf|grep -v "#"
user  nginx;
worker_processes  4;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        charset utf-8;
        access_log  /var/log/nginx/zabbix.access.log;
        error_log   /var/log/nginx/zabbix.error.log;
        location / {
             root   /usr/share/zabbix/;
             allow 你的IP;
             deny all;
             index  index.php index.html index.htm;
        }
       
        location ~ \.php$ {
            root           /usr/share/zabbix/;
            fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/share/zabbix$fastcgi_script_name;
            include        fastcgi_params;
        }
 
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
   }
   
}

 

3.2.9 Server端web配置

 

 

posted @ 2017-09-10 00:18  skyflask  阅读(951)  评论(0编辑  收藏  举报