Installing Zabbix 3.4 from deployment packages

Posted by kodlcan on Wed, 15 May 2019 01:11:52 +0200

Installation from deployment packages

Installation from Zabbix's official source library

Zabbix SIA provides official RPM and DEB deployment packages for Red Hat Enterprise Linux, Debian and Ubuntu LTS systems.

Deployment package files can be downloaded through repo.zabbix.com. The server provides both yum and apt source libraries. Detailed tutorials for installing Zabbix from deployment packages are provided here.

Red Hat Enterprise Linux / CentOS
Support Versions: RHEL 7, Oracle Linux 7, CentOS 7

Some component deployment packages (such as agent, proxy, etc.) also support RHEL 5 and RHEL 6.

Install centos7 system:

Specific installation steps refer to system installation documentation:
Reference address: https://www.centos.org/download/

Configuration allows root account remote login


  1. Edit the / etc/ssh/sshd_config document and modify it to read as follows:

PermitRootLogin yes

  • Restart ssh service

    systemctl restart sshd.service

  • Close IPV6

    modify/etc/sysctl.conf configuration file
    sed -i '$a net.ipv6.conf.all.disable_ipv6 =1\nnet.ipv6.conf.default.disable_ipv6 =1'

    /etc/sysctl.conf

  • Execute the following command to make the settings work.

    sysctl -p

  • Close the firewall
    1. Close the firewall using the following instructions
  • System CTL stop firewalld
     System CTL disable firewalld
    2. View firewalld status
        > firewall-cmd --state
        > not running
    
    • Disable SElinux (must be turned off, otherwise some functions will not work properly)

    1) Modify the / etc/selinux/config configuration file

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

    2) Confirm whether the modification was successful

    cat /etc/selinux/config |grep -v ^# |grep -v ^$
    SELINUX=disabled
    SELINUXTYPE=targeted

    3) Restart the system

    reboot

    4) Check SELinux status after reboot

    sestatus
    SELinux status: disabled

    Install the Zabbix service

    • Install Repository with MySQL database

    rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

    • IInstall Zabbix server, frontend, agent

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

    Install Initialization Database

    Install Mariadb database (latest version of linux system, default is Mariadb.)

    yum install -y mariadb mariadb-server

    Start mariadb

    systemctl start mariadb

    Set up boot-up self-startup

    systemctl enable mariadb

    Security initialization, setting root password, etc.

    mysql_secure_installation

    To install the Zabbix database and users on MySQL, see the following instructions. MySQL database creation script.
    • MySQL

    mysql -uroot -p
    create database zabbix character set utf8 collate utf8_bin;
    grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
    quit;

    Then import the initial architecture (Schema) and data.

    cd /usr/share/doc/zabbix-server-mysql-3.4.* (Installation-based view of specific versions)

    zcat create.sql.gz | mysql -uroot zabbix

    Check the zabbix_server.conf configuration file modification results

    cat /etc/zabbix/zabbix_server.conf |grep -v ^# |grep -v ^$

    LogFile=/var/log/zabbix/zabbix_server.log
    LogFileSize=0
    PidFile=/var/run/zabbix/zabbix_server.pid
    SocketDir=/var/run/zabbix
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=123456
    SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
    Timeout=4
    AlertScriptsPath=/usr/lib/zabbix/alertscripts
    ExternalScripts=/usr/lib/zabbix/externalscripts
    LogSlowQueries=3000
    Start the Zabbix Server process

    Editing database configuration in zabbix_server.conf

    vim /etc/zabbix/zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix

    Start the Zabbix Server process

    systemctl restart zabbix-server zabbix-agent httpd
    systemctl enable zabbix-server zabbix-agent httpd

    View zabbix-server running

    systemctl status zabbix-server

    Editing the PHP configuration for the Zabbix front end

    The Apache configuration file on the front end of Zabbix is located at

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

    Some PHP settings have been configured.

    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 always_populate_raw_post_data -1
    
    php_value date.timezone Europe/Riga

    Depending on the time zone, you can uncomment the "date.timezone" setting and configure it correctly. After the configuration file changes, you need to restart the Apache Web server.

    View the modification results

    cat /etc/httpd/conf.d/zabbix.conf |grep -v ^# |grep -v ^$

    Alias /zabbix /usr/share/zabbix
    <Directory "/usr/share/zabbix">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
        <IfModule mod_php5.c>
            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 always_populate_raw_post_data -1
            php_value date.timezone Asia/Shanghai
        </IfModule>
    </Directory>
    
    Restart service

    systemctl restart httpd

    The Zabbix front end can be accessed in browsers http://zabbix-frontend-hostname/zabbix Visit. The default username/password is Admin/zabbix.

    Topics: Zabbix MySQL SELinux MariaDB