Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CENTOS 6.8 INSTALL ZABBIX 3.2

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

View your database version

yum list installed | grep mysql

----------------------------------------

Expected output:

mysql-libs.x86_64 5.1.73-5.el6_6 @anaconda-CentOS-201508042137.x86_64/6.7

----------------------------------------

Delete your old version database

yum remove mysql*

Add new database downloads

rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

----------------------------------------

Expected output:

Retrieving http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

Preparing... ########################################### [100%]

1:mysql-community-release########################################### [100%]

----------------------------------------

Install database and vim compiler

yum install mysql-server vim -y

Configure my.cnf file

vim /etc/my.cnf

[mysqld]

innodb_file_per_table

start the database

service mysqld start

Modify database default user password and anonymous login

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]

Normally you should answer "Yes" to all these questions.

Add zabbix database

mysql -u root -p

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';

----------------------------------------

Expected output:

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| performance_schema |

| zabbix |

+--------------------+

4 rows in set (0.00 sec)

----------------------------------------

configure the web service

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

yum -y install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap wget ntpdate net-snmp*

vim /etc/php.ini

post_max_size=16M

max_execution_time=300

max_input_time=300

date.timezone=Asia/Shanghai

always_populate_raw_post_data=-1

service httpd start

Adjust firewall configuration

iptables -I INPUT -p tcp -m multiport --destination-port 80,10050:10051 -j ACCEPT

service iptables save

Configure NTP time

ntpdate time.windows.com

---------------------------------------------------------------------------------------------------------------

(If there is no problem with the above configuration, enter ip a s to view your own address. Try http login will find web service interface basically means OK))))

----------------------------------------------------------------------------------------------------------------

Start zabbix installation

create user

groupadd zabbix

useradd -g zabbix zabbix

Create a download folder (zabbix will be dropped here)

mkdir /home/zabbix/downloads

cd /home/zabbix/downloads

download

wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.0/zabbix-3.2.0.tar.gz

decompression

tar -zxvf zabbix-3.2.0.tar.gz

Enter zabbix file database (if prompted password is zabbix user password "zabbix")

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

mysql -u zabbix -p zabbix < schema.sql

mysql -u zabbix -p zabbix < p_w_picpaths.sql

mysql -u zabbix -p zabbix < data.sql

Download dependency packages

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

cd ../..

compile and install

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

make install

Modify configuration startup file

vim /usr/local/etc/zabbix_server.conf

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

Create zabbix-web pages folder

mkdir /var/www/html/zabbix

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

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

Close selinux

setenforce 0

Create a rule that allows web servers to access front-end files

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

Run Apache and zabbix to access external networks

setsebool -P httpd_can_network_connect=1

setsebool -P zabbix_can_network=1

Set the owner of the Apache user web interface file

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

Add permissions to zabbix web interface

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

startup script

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

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

Enable Zabbix server,Apache and MySQL service startup

chkconfig httpd on

chkconfig mysqld on

chkconfig zabbix_server on

fully launched

service zabbix_server start

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report