zabbix 3.0快速安裝簡介(centos 6)

zabbix快速安裝

系統版本:centos 6php

一、yum源配置和zabbix、msyql安裝html

rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
yum install httpd zabbix zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mysql-server -y

二、php安裝mysql

rpm -ivh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install php55w php55w-mysql php55w-common php55w-gd php55w-mbstring php55w-mcrypt php55w-devel php55w-xml php55w-bcmath php55w-fpm -y
cp -R /usr/share/zabbix/ /var/www/html/

三、mysql配置nginx

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
啓動MySQL
/etc/init.d/mysqld start
建立用戶並受權
mysql
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@'localhost' identified by '123456';
flush privileges;
exit

四、導入zabbix數據文件web

cd /usr/share/doc/zabbix-server-mysql-3.0.5
zcat create.sql.gz |mysql -uzabbix -p123456 zabbix

五、php配置sql

修改php配置文件
vim /etc/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/shanghai

六、zabbix server配置數據庫

vim /etc/zabbix/zabbix_server.conf
修改數據庫地址、數據庫名、 用戶、密碼
分別對應
DBHost=
DBName=
DBUser=
DBPassword=
DBSocket=/var/lib/mysql/mysql.sock

七、nginx配置vim

/usr/local/nginx/conf下建立extra目錄centos

/usr/local/nginx/conf/extra建立zabbix.confbash

server {
    listen       80;
    server_name  localhost;
    root   /var/www/html;
    index  index.php index.html index.htm;
    access_log  logs/zabbix_access.log;
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
      root   html;
    }
    location ~ \.(php|php5)?$ {
      root           /var/www/html/;
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_index  index.php;
      fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name;
      include        fastcgi_params;
    }
}

在nginx.conf文件中的http下加入

include  extra/zabbix.conf;

八、重啓

nginx重啓

/etc/init.d/php-fpm start

/etc/init.d/zabbix-server start

相關文章
相關標籤/搜索