CentOS6平台zabbix3.4部署

    1. 安装配置mysql

/etc/init.d/iptables stop

chkconfig iptables off

setenforce 0

sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config

cd /opt

yum -y remove mysql-libs.x86_64

yum install wget -y

wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

rpm -ivh mysql-community-release-el6-5.noarch.rpm

yum install mysql-community-server -y

yum install crontabs.noarch -y

yum install ntpdate -y

sed '22acharacter-set-server=utf8\ncollation-server=utf8_general_ci' /etc/my.cnf -i

chkconfig mysqld on

service mysqld start

mysql -e 'create database zabbix character set utf8 collate utf8_bin;'

mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';"

mysql -e "flush privileges;"

    1. 安装配置php

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/l/libmcrypt-2.5.8-9.el6.x86_64.rpm

rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm

yum list installed | grep php

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64 php56w-fpm php56w-bcmath -y

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-fpm -y

service php-fpm start

chkconfig php-fpm on

    1. 安装apache

yum install httpd -y

echo "ServerName 127.0.0.1:80">>/etc/httpd/conf/httpd.conf

service httpd start

chkconfig httpd on

    1. 安装zabbix

rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get -y

yum -y install  net-snmp net-snmp-libs net-snmp-devel net-snmp-utils

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/w/wqy-microhei-fonts-0.2.0-0.14.beta.el6.noarch.rpm

rpm -ivh wqy-microhei-fonts-0.2.0-0.14.beta.el6.noarch.rpm

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix

sed -i.bak 's@# DBHost=localhost@DBHost=localhost@g' /etc/zabbix/zabbix_server.conf

sed -i.bak 's@# DBPassword=@DBPassword=zabbix@g' /etc/zabbix/zabbix_server.conf

\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

sed -i.ori 's#max_execution_time = 30#max_execution_time = 300#;s#max_input_time = 60#max_input_time = 300#;s#post_max_size = 8M#post_max_size = 16M#;910a date.timezone = Asia/Shanghai' /etc/php.ini

wget http://repo.webtatic.com/yum/el6/x86_64//php56w-bcmath-5.6.33-1.w6.x86_64.rpm

rpm -ivh php56w-bcmath-5.6.33-1.w6.x86_64.rpm

yum install php56w-xml -y

sed -i 's#;always_populate_raw_post_data = -1#always_populate_raw_post_data = -1#g' /etc/php.ini

cp -R /usr/share/zabbix/ /var/www/html/

chmod -R 755 /etc/zabbix/web

chown -R apache.apache /etc/zabbix/web

/etc/init.d/php-fpm restart

/etc/init.d/httpd restart

sed 's@# CacheSize=8M@CacheSize=2048M@g' /etc/zabbix/zabbix_server.conf -i

sed 's@# ValueCacheSize=8M@ValueCacheSize=2048M@g' /etc/zabbix/zabbix_server.conf -i

/etc/init.d/zabbix-server start

chkconfig zabbix-server on

/etc/init.d/zabbix-agent start

chkconfig zabbix-agent on

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值