Centos 6 安装Zabbix 3.2.1

Zabbix wangleiadmin 3218℃ 0评论


数据库安装


yum remove mysql*   #移除mysql所有,建议使用最新版本!

rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm  #安装存储库

yum install mysql-server -y  #安装mysql服务

vim /etc/my.cnf 编辑mysql配置文件并添加如下
[mysqld]
innodb_file_per_table


service mysqld start

mysql_secure_installation
Enter current password for root (enter for none):

Set root password? [Y/n] 

Remove anonymous users? [Y/n]

Disallow root login remotely? [Y/n]

Remove test database and access to it? [Y/n]

Reload privilege tables now? [Y/n]

mysql -u root -p


CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'your_password';

Web服务下载并安装


rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm

yum install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap

vim /etc/php.ini
post_max_size=16M
max_execution_time=300
max_input_time=300
date.timezone=Europe/Riga
always_populate_raw_post_data=-1

service httpd start

iptables -I INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables-save > /etc/sysconfig/iptables


下载Zabbix 3.2.1并安装


groupadd zabbix

useradd -g zabbix zabbix

mkdir /home/zabbix/downloads

cd /home/zabbix/downloads

yum install wget -y


https://sourceforge.net/projects/zabbix/files/    下载3.2.1包

tar -zxvf zabbix-3.2.1.tar.gz

cd /home/zabbix/downloads/zabbix-3.2.1/database/mysql/

mysql -u zabbix -p zabbix < schema.sql

mysql -u zabbix -p zabbix < images.sql

mysql -u zabbix -p zabbix < data.sql

yum install gcc mysql-community-devel libxml2-devel  unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel

cd ../..

./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl

make install

vim /usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=your_password

mkdir /var/www/html/zabbix

cd /home/zabbix/downloads/zabbix-3.2.1/frontends/php/

cp -a . /var/www/html/zabbix/

chcon -Rv --type=httpd_sys_content_t /var/www/html

setsebool -P httpd_can_network_connect=1
setsebool -P zabbix_can_network=1

chown -R apache:apache /var/www/html/zabbix

chmod +x /var/www/html/zabbix/conf/

cp /home/zabbix/downloads/zabbix-3.2.1/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server

cp /home/zabbix/downloads/zabbix-3.2.1/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd

chkconfig --add /etc/init.d/zabbix_server
chkconfig --add /etc/init.d/zabbix_agentd

chkconfig httpd on
chkconfig mysqld on
chkconfig zabbix_server on
chkconfig zabbix_agentd on



service zabbix_server start

service zabbix_agentd start

浏览器访问:http://IP/zabbix                    默认用户:Admin     密码:zabbix

转载请注明:暖风 » Centos 6 安装Zabbix 3.2.1

喜欢 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址