安装 zabbix
yum -y install zabbix-web zabbix-web-mysql zabbix-agent mariadb-server zabbix-get zabbix-server-mysql httpd
#chkconfig mysqld on
#service mysqld start
systemctl start mariadb
#mysqladmin -uroot password 123
#mysql -u root -p123
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
mysql> \q

导入zabbix表
#cd /usr/share/doc/zabbix-server-mysql-2.4.6/create/
mysql -uzabbix -pzabbix zabbix < schema.sql
#mysql -uzabbix -pzabbix zabbix < images.sql
#mysql -uzabbix -pzabbix zabbix < data.sql
zcat create.sql.gz
zcat create.sql.gz | mysql -D zabbix
cd /usr/share/doc/zabbix-server-mysql-3.2.11/
#gunzip create.sql.gz
#mysql -u zabbix -pzabbix -D zabbix < create.sql

配置zabbix连接数据库
#vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

#service zabbix-server start
Starting Zabbix server: [ OK ]
chkconfig zabbix-server on
/bin/systemctl start zabbix-server.service

vim /etc/httpd/conf.d/zabbix.conf

Options FollowSymLinks
AllowOverride None


  # Apache 2.4
  Require all granted



  # Apache 2.2
  Order allow,deny
  Allow from all
 
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
php_value date.timezone Asia/Shanghai

#service httpd restart
service zabbix-server restart