Linux install Zabbix detailed steps

Linux install Zabbix detailed steps

Centos7 to the newly installed configuration, for example
0, first configure yum warehouse:
[root @ zabbix ~] # yum -y install EPEL-Release
[root @ zabbix ~] # yum Clean All
[root @ zabbix ~] # yum makecache

1, the basic installation tools and compilers Tools:
[ZABBIX the root @ ~] # NET-yum the install wget Tools lrzsz Vim GCC GCC ++ -Y-C

2, pre-installed php and mysql database:
[ZABBIX the root @ ~] # yum the install php MariaDB MariaDB MariaDB-devel -Y-Server
starts a database and to initialize the database:
[ZABBIX the root @ ~] # systemctl enable MariaDB
[ZABBIX the root @ ~] Start MariaDB systemctl #
[@ ZABBIX the root ~] # mysql_secure_installation (abbreviated initialization process)

3、创建zabbix服务账号:
[root@zabbix ~]# groupadd --system zabbix
[root@zabbix ~]# useradd --system -g zabbix -s /sbin/nologin -c “Zabbix_Server” zabbix

4, the official download and unzip and install the latest version zabbix:
[root @ zabbix ~] # wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.4.7/zabbix-4.4. 7.tar.gz
[ZABBIX the root @ ~] # yum the install NET-NET-SNMP SNMP-devel libcurl the libevent-devel the libxml2 the libxml2-devel-devel -Y # libcurl installation dependencies
[root @ zabbix ~] # tar -xvf zabbix -4.4.7.tar.gz
[@ ZABBIX the root-ZABBIX 4.4.7] # ./configure --prefix = / usr / local / ZABBIX --enable --enable-Agent-Server
-enable-IPv6 --with- mysql --with-net-snmp --with- libcurl --with-libxml2 # to enter and build your
[root @ zabbix zabbix-4.4.7] # make install # install

5, to create a database and import a database zabbix:
[zabbix the root @ ~] # MySQL -uroot--p
the Enter password:
MariaDB [(none)]> Create Character Database zabbix SET UTF8;
MariaDB [(none)]> Grant All zabbix ON. * to zabbix @ localhost IDENTIFIED by 'zabbixpass';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit
the database zabbix template into the database you just created (in order to import):
[root @ zabbix ~] -H localhost MySQL -uzabbix -pzabbixpass # ZABBIX <ZABBIX-4.4.7 / Database / MySQL / schema.sql
[ZABBIX the root @ ~] # MySQL -uzabbix -pzabbixpass -H localhost ZABBIX <ZABBIX-4.4.7 / Database / MySQL /images.sql
[ZABBIX the root @ ~] # MySQL -uzabbix -pzabbixpass -H localhost ZABBIX <ZABBIX-4.4.7 / Database / MySQL / data.sql

6, the configuration profile zabbix:
[zabbix the root @ ~] # # Vim /usr/local/zabbix/etc/zabbix_server.conf profile substantially modify the following parameters:
[zabbix the root @ ~] # CAT / usr / local / zabbix /etc/zabbix_server.conf | grep -v ^ # | grep -v ^ $
LogFile = / tmp / zabbix_server.log
the PidFile = / tmp / zabbix_server.pid
DBHost = localhost
DBName = zabbix
DBUser = zabbix
DBPassword = zabbixpass
dbport = 3306
Timeout . 4 =
logSlowQueries = 3000
StatsAllowedIP = 127.0.0.1

7、启动zabbix和agent服务:
[root@zabbix ~]# /usr/local/zabbix/sbin/zabbix_server
[root@zabbix ~]# /usr/local/zabbix/sbin/zabbix_agentd

8, and the installation nginx FPM-PHP
[ZABBIX the root @ ~] # yum the install nginx PHP FPM -Y-
configuration nginx:
[ZABBIX the root @ ~] # Vim /etc/nginx/nginx.conf

        location / {
        }
#此字段下插入如下代码:
        location ~ \.php$ {
         fastcgi_buffer_size 128k;
         fastcgi_buffers 32 32k;
           try_files $uri /index.php =404;
           fastcgi_pass 127.0.0.1:9000;
           fastcgi_index index.php;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           include fastcgi_params;
        }

[root@zabbix ~]# systemctl enable nginx php-fpm
[root@zabbix ~]# systemctl restart nginx

9, copy the source php page file to the root directory of nginx, and restart nginx, php-FPM:
[root @ zabbix ~] # cp -rp zabbix-4.4.7 / frontends / php / * / usr / report this content share / nginx / HTML
[ZABBIX the root @ ~] # PHP-FPM systemctl the restart Nginx

10, and open the browser installed self-test dependencies required as follows:
Here Insert Picture Description
to solve the following problems:
the installation dependencies and modify php.ini configuration:
[ZABBIX the root @ ~] # yum the install Gd PHP-PHP-PHP-MySQL BCMath PHP- mbstring php-xml php-ldap -y
modify the php.ini parameters:
[ZABBIX the root @ ~] # Vim /etc/php.ini
post_max_size = 16M
the max_execution_time = 300
max_input_time directives in = 300
the date.timezone = Asia / of Shanghai

Reboot again nginx, php-fpm service and start the installation:
[root @ zabbix ~] # systemctl restart nginx PHP-FPM

Then you may find that connection is not on the database (database files need to be modified as follows):
[root @ zabbix ~] # cd / usr / report this content share / nginx / HTML / conf
[root @ zabbix ~] # mv zabbix.conf.php.example zabbix.conf.php # rename the file
[root @ zabbix ~] # vim zabbix.conf.php # modify the correct port, account number and password
you modify the refresh login to: account admin / zabbix

Here Insert Picture Description

Published 57 original articles · won praise 8 · views 5528

Guess you like

Origin blog.csdn.net/zdl244/article/details/105197192
Recommended