Zabbix Documentation 3.4

3.04.05.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.24.4Guidelines

User Tools

Site Tools


manual:installation:install_from_packages:rhel_centos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

manual:installation:install_from_packages:rhel_centos [2017/10/24 15:28]
dimir remove sudo as used nowhere
manual:installation:install_from_packages:rhel_centos [2020/05/12 09:34]
Line 1: Line 1:
-==== 1 Red Hat Enterprise Linux/​CentOS ==== 
- 
-=== Overview === 
- 
-Official Zabbix packages are available for RHEL 7, CentOS 7 and Oracle Linux 7. In this documentation we will refer to all 3 using term "​RHEL"​. 
- 
-Some agent and proxy packages are available for [[http://​repo.zabbix.com/​zabbix/​3.4/​rhel/​6/​x86_64/​|RHEL 6]] and [[http://​repo.zabbix.com/​zabbix/​3.4/​rhel/​5/​x86_64|RHEL 5]] as well. 
- 
-=== Adding Zabbix repository === 
- 
-Install the repository configuration package. This package contains yum (software package manager) configuration files. 
- 
-RHEL 7: 
- 
-  # rpm -ivh http://​repo.zabbix.com/​zabbix/​3.4/​rhel/​7/​x86_64/​zabbix-release-3.4-2.el7.noarch.rpm 
- 
-RHEL 6: 
- 
-  # rpm -ivh http://​repo.zabbix.com/​zabbix/​3.4/​rhel/​6/​x86_64/​zabbix-release-3.4-1.el6.noarch.rpm 
- 
-RHEL 5: 
- 
-  # rpm -ivh http://​repo.zabbix.com/​zabbix/​3.4/​rhel/​5/​x86_64/​zabbix-release-3.4-1.noarch.rpm 
- 
-=== Server/​proxy/​frontend installation === 
- 
-To install Zabbix server (available only for RHEL 7) with MySQL support: 
- 
-  # yum install zabbix-server-mysql 
- 
-To install Zabbix proxy with MySQL support: 
- 
-  # yum install zabbix-proxy-mysql 
- 
-To install Zabbix frontend (available for RHEL 7, deprecated on RHEL 6) with MySQL support: 
- 
-  # yum install zabbix-web-mysql 
- 
-Substitute '​mysql'​ in the commands with '​pgsql'​ to use PostgreSQL, or with '​sqlite3'​ to use SQLite3 (proxy only). 
- 
-** Creating database ** 
- 
-For Zabbix [[manual:​concepts:​server|server]] and [[manual:​concepts:​proxy|proxy]] daemons a database is required. It is not needed to run Zabbix [[manual:​concepts:​agent|agent]]. ​ 
- 
-<note warning>​If Zabbix server and proxy are installed on the same host, their databases must be created with different names!</​note>​ 
- 
-Create the database using the provided [[:​manual:​appendix:​install:​db_scripts|database creation scripts]] for MySQL/​PostgreSQL. 
- 
-Now import initial schema and data for the server with MySQL: 
- 
-  # zcat /​usr/​share/​doc/​zabbix-server-mysql/​create.sql.gz | mysql -uzabbix -p zabbix 
- 
-You will be prompted to enter your newly created database password. 
- 
-With PostgreSQL: 
- 
-  # zcat /​usr/​share/​doc/​zabbix-server-pgsql/​create.sql.gz | psql -U <​username>​ zabbix 
- 
-For proxy, import initial schema: 
- 
-  # zcat /​usr/​share/​doc/​zabbix-proxy-mysql/​schema.sql.gz | mysql -uzabbix -p zabbix 
- 
-For proxy with PostgreSQL (or SQLite): 
- 
-  # zcat /​usr/​share/​doc/​zabbix-proxy-pgsql/​schema.sql.gz | psql -U <​username>​ zabbix 
-  # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite3/​schema.sql.gz | sqlite3 zabbix.db 
- 
-Make sure to insert the correct Zabbix version in the commands (''​3.4.0''​ by default). In order to check the correct server/​proxy version of your package, run: 
- 
-  # rpm -q zabbix-server-mysql 
-  # rpm -q zabbix-proxy-mysql 
- 
-Substitute '​mysql'​ in the commands with '​pgsql'​ if using PostgreSQL, or with '​sqlite3'​ if using SQLite3 (proxy only). 
- 
-** Configure database for Zabbix server/​proxy ** 
- 
-Edit zabbix_server.conf or zabbix_proxy.conf to use the created database. For example: 
- 
-  # vi /​etc/​zabbix/​zabbix_server.conf 
-  DBHost=localhost 
-  DBName=zabbix 
-  DBUser=zabbix 
-  DBPassword=<​password>​ 
- 
-In DBPassword use Zabbix database password for MySQL; PosgreSQL user password for PosgreSQL. 
- 
-Use ''​DBHost=''​ with PostgreSQL. You might want to keep the default setting ''​DBHost=localhost''​ (or an IP address), but this would make PostgreSQL use a network socket for connecting to Zabbix. See **SELinux configuration** below for instructions. 
- 
-** Starting Zabbix server process ** 
- 
-It's time to start Zabbix server process and make it start at system boot: 
- 
-  # systemctl start zabbix-server 
-  # systemctl enable zabbix-server 
- 
-Substitute '​zabbix-server'​ with '​zabbix-proxy'​ to start Zabbix proxy process. 
- 
-** PHP configuration for Zabbix frontend ** 
- 
-Apache configuration file for Zabbix frontend is located in /​etc/​httpd/​conf.d/​zabbix.conf. Some PHP settings are already configured. But it's necessary to uncomment the "​date.timezone"​ setting and [[http://​php.net/​manual/​en/​timezones.php|set the right timezone]] for you. 
- 
-  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 
- 
-=== SELinux configuration === 
- 
-Having SELinux status enabled in enforcing mode, you need to execute the following commands to enable communication between Zabbix frontend and server: 
- 
-RHEL 7 and later: 
-  # setsebool -P httpd_can_connect_zabbix on 
-  If the database is accessible over network (including '​localhost'​ in case of PostgreSQL),​ you need to allow Zabbix frontend to connect to the database too: 
-  # setsebool -P httpd_can_network_connect_db on 
- 
-RHEL prior to 7: 
-  # chcon -Rv --type=httpd_sys_content_t /​usr/​share/​zabbix 
-  # setsebool -P httpd_can_network_connect on 
-  # setsebool -P zabbix_can_network on 
- 
-As frontend and SELinux configuration is done, you need to restart Apache web server:\\ 
- 
-  # service httpd restart 
- 
-=== Frontend configuration === 
- 
-Now you are ready to proceed with [[manual/​installation/​install#​installing_frontend|frontend installation steps]] which will allow you to access your newly installed Zabbix. 
- 
-<​note>​Zabbix official repository provides fping, iksemel, libssh2 packages as well. These packages are located in the //​[[http://​repo.zabbix.com/​non-supported/​|non-supported]]//​ directory.</​note>​ 
- 
-=== Agent installation === 
- 
-To install the agent, run 
- 
-  # yum install zabbix-agent 
- 
-To start the agent, run: 
- 
-  # service zabbix-agent start