manual:installation:install

Differences

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

Link to this comparison view

Next revision
Previous revision
manual:installation:install [2014/09/25 14:42]
sasha Page moved from 2.4:manual:installation:install to manual:installation:install
manual:installation:install [2021/06/07 09:35] (current)
marinagen languages installation instructions moved to a separate page
Line 1: Line 1:
-==== Installation from sources ====+==== Installation from sources ====
  
 You can get the very latest version of Zabbix by compiling it from the sources. You can get the very latest version of Zabbix by compiling it from the sources.
Line 9: Line 9:
 == 1 Download the source archive == == 1 Download the source archive ==
  
-Go to the [[http://​www.zabbix.com/​download.php|Zabbix download page]] and download the source archive. Once downloaded, extract the sources, by running:+Go to the [[http://​www.zabbix.com/​download_sources|Zabbix download page]] and download the source archive. Once downloaded, extract the sources, by running:
  
-  $ tar -zxvf zabbix-2.2.0.tar.gz+  $ tar -zxvf zabbix-6.0.0.tar.gz
    
 <note tip>​Enter the correct Zabbix version in the command. It must match the name of the downloaded archive.</​note>​ <note tip>​Enter the correct Zabbix version in the command. It must match the name of the downloaded archive.</​note>​
Line 19: Line 19:
 For all of the Zabbix daemon processes, an unprivileged user is required. If a Zabbix daemon is started from an unprivileged user account, it will run as that user.  For all of the Zabbix daemon processes, an unprivileged user is required. If a Zabbix daemon is started from an unprivileged user account, it will run as that user. 
  
-However, if a daemon is started from a '​root'​ account, it will switch to a '​zabbix'​ user account, which must be present. To create such a user account (in its own group, "​zabbix"​) ​on Linux systemsrun:+However, if a daemon is started from a '​root'​ account, it will switch to a '​zabbix'​ user account, which must be present. To create such a user account (in its own group, "​zabbix"​),​
  
-  ​groupadd zabbix +on a RedHat-based system, run: 
-  useradd -g zabbix zabbix+ 
 +  ​groupadd ​--system ​zabbix 
 +  useradd ​--system ​-g zabbix ​-d /usr/lib/zabbix ​-s /​sbin/​nologin -c "​Zabbix Monitoring System"​ zabbix 
 + 
 +on a Debian-based system, run: 
 + 
 +  addgroup --system --quiet zabbix 
 +  adduser --quiet --system --disabled-login --ingroup zabbix --home /​var/​lib/​zabbix --no-create-home zabbix 
 + 
 +<note important>​Zabbix processes do not need a home directory, which is why we do not recommend creating it. However, if you are using some functionality that requires it (e. g. store MySQL credentials in ''​$HOME/​.my.cnf''​) you are free to create it using the following commands.\\ \\  
 + 
 +On RedHat-based systems, run: 
 + 
 +  mkdir -m u=rwx,​g=rwx,​o= -p /​usr/​lib/​zabbix 
 +  chown zabbix:​zabbix /​usr/​lib/​zabbix 
 + 
 +On Debian-based systems, run: 
 + 
 +  mkdir -m u=rwx,​g=rwx,​o= -p /​var/​lib/​zabbix 
 +  chown zabbix:​zabbix /​var/​lib/​zabbix 
 +</​note>​
  
 A separate user account is not required for Zabbix frontend installation. A separate user account is not required for Zabbix frontend installation.
  
-If Zabbix [[:2.4/manual/concepts/server|server]] and [[:2.4/manual/concepts/agent|agent]] are run on the same machine it is recommended to use a different user for running the server than for running the agent. Otherwise, if both are run as the same user, the agent can access the server configuration file and any Admin level user in Zabbix can quite easily retrieve, for example, the database password.+If Zabbix [[manual:concepts:server|server]] and [[manual:concepts:agent|agent]] are run on the same machine it is recommended to use a different user for running the server than for running the agent. Otherwise, if both are run as the same user, the agent can access the server configuration file and any Admin level user in Zabbix can quite easily retrieve, for example, the database password.
  
 <note important>​Running Zabbix as ''​root'',​ ''​bin'',​ or any other account with special rights is a security risk.</​note>​ <note important>​Running Zabbix as ''​root'',​ ''​bin'',​ or any other account with special rights is a security risk.</​note>​
Line 32: Line 52:
 == 3 Create Zabbix database == == 3 Create Zabbix database ==
  
-For Zabbix [[:2.4/manual/concepts/server|server]] and [[:2.4/manual/concepts/proxy|proxy]] daemons, as well as Zabbix frontend, a database is required. It is not needed to run Zabbix [[:2.4/manual/concepts/agent|agent]].+For Zabbix [[manual:concepts:server|server]] and [[manual:concepts:proxy|proxy]] daemons, as well as Zabbix frontend, a database is required. It is not needed to run Zabbix [[manual:concepts:agent|agent]].
  
-SQL [[:2.4/manual/appendix/install/db_scripts|scripts are provided]] for creating database schema and inserting the dataset. Zabbix proxy database needs only the schema while Zabbix server database requires also the dataset on top of the schema.+SQL [[manual:appendix:install:db_scripts|scripts are provided]] for creating database schema and inserting the dataset. Zabbix proxy database needs only the schema while Zabbix server database requires also the dataset on top of the schema.
  
 Having created a Zabbix database, proceed to the following steps of compiling Zabbix. Having created a Zabbix database, proceed to the following steps of compiling Zabbix.
Line 49: Line 69:
  
   ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2   ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
- 
-<​note>​--with-libxml2 configuration option is required for virtual machine monitoring, supported since Zabbix 2.2.0.</​note>​ 
  
 To configure the sources for a Zabbix server (with PostgreSQL etc.), you may run: To configure the sources for a Zabbix server (with PostgreSQL etc.), you may run:
Line 64: Line 82:
   ./configure --enable-agent   ./configure --enable-agent
  
-Use can add <​nowiki>​--enable-static</​nowiki>​ flag to statically link libraries. If you plan to distribute compiled binaries among different servers, you must use this flag to make these binaries work without required libraries. Note that <​nowiki>​--enable-static</​nowiki>​ [[http://​blogs.sun.com/​rie/​entry/​static_linking_where_did_it|does not work under Solaris]].+or, for Zabbix agent 2: 
 + 
 +  ./configure --enable-agent2 
 +   
 +<​note>​ **Go version 1.13** or later is required for compiling Zabbix agent 2. See [[https://​golang.org/​doc/​install|golang.org]] for installation instructions.</​note>​ 
 + 
 +Notes on compilation options: 
 + 
 +  * Command-line utilities zabbix_get and zabbix_sender are compiled if %%--enable-agent%% option is used. 
 +  * <​nowiki>​--with-libcurl</​nowiki>​ and <​nowiki>​--with-libxml2</​nowiki>​ configuration options are required for virtual machine monitoring; <​nowiki>​--with-libcurl</​nowiki>​ is also required for SMTP authentication and ''​web.page.*''​ Zabbix agent [[:​manual/​config/​items/​itemtypes/​zabbix_agent|items]]. Note that cURL 7.20.0 or higher is [[:​manual/​installation/​requirements|required]] with the <​nowiki>​--with-libcurl</​nowiki>​ configuration option. 
 +  * Zabbix always compiles with the PCRE library (since version 3.4.0); installing it is not optional. %%--with-libpcre=[DIR]%% only allows pointing to a specific base install directory, instead of searching through a number of common places for the libpcre files. 
 +  * You may use the <​nowiki>​--enable-static</​nowiki>​ flag to statically link libraries. If you plan to distribute compiled binaries among different servers, you must use this flag to make these binaries work without required libraries. Note that <​nowiki>​--enable-static</​nowiki> ​does not work in [[http://​blogs.sun.com/​rie/​entry/​static_linking_where_did_it|Solaris]]
 +  * Using <​nowiki>​--enable-static</​nowiki>​ option is not recommended when building server. In order to build the server statically you must have a static version of every external library needed. There is no strict check for that in configure script. 
 +  * Add optional path to the MySQL configuration file <​nowiki>​--with-mysql=/<​path_to_the_file>/​mysql_config</​nowiki>​ to select the desired MySQL client library when there is a need to use one that is not located in the default location. It is useful when there are several versions of MySQL installed or MariaDB installed alongside MySQL on the same system. 
 +  * Use <​nowiki>​--with-oracle</​nowiki>​ flag to specify location of the OCI API.
  
 <note important>​ <note important>​
-Using <​nowiki>​--enable-static<​/nowiki> option ​is not recommended when building server.// // +If ./configure fails due to missing libraries or some other circumstance,​ please see the ''​config.log''​ file for more details on the error. For example, if ''​libssl'' ​is missing, the immediate error message may be misleading:​ 
 + 
 +  checking for main in -lmysqlclient... no 
 +  configure: error: Not found mysqlclient library 
 + 
 +While ''​config.log''​ has a more detailed description:​
  
-In order to build the server statically you must have a static version of every external library needed. There is no strict check for that in configure script.+  /​usr/​bin/​ld:​ cannot find -lssl 
 +  /​usr/​bin/​ld:​ cannot find -lcrypto
 </​note>​ </​note>​
  
-<​note>​Command-line utilities zabbix_get and zabbix_sender are compiled if %%--enable-agent%% option is used.</​note>​+See also: 
 +  * [[manual:​encryption#​compiling_zabbix_with_encryption_support|Compiling Zabbix with encryption support]] for encryption support 
 +  * [[:​manual/​installation/​known_issues#​compiling_zabbix_agent_on_hp-ux|Known issues]] with compiling Zabbix agent on HP-UX
  
-<​note>​Use <​nowiki>​--with-ibm-db2</​nowiki>​ flag to specify location of the CLI API.\\ Use <​nowiki>​--with-oracle</​nowiki>​ flag to specify location of the OCI API.</​note>​ 
 == 5 Make and install everything == == 5 Make and install everything ==
  
-<​note>​If installing from SVN, it is required to run first:+<​note>​If installing from [[https://​git.zabbix.com/​projects/​ZBX/​repos/​zabbix/​browse|Zabbix Git repository]], it is required to run first:
  
 ''​$ make dbschema''​ ''​$ make dbschema''​
Line 102: Line 141:
 You must specify the database name, user and password (if using any). You must specify the database name, user and password (if using any).
  
-<​note>​With SQLite the full path to database file must be specified; DB user and password are not required.</​note>​ +The rest of the parameters will suit you with their defaults if you have a small installation (up to ten monitored hosts). You should change the default parameters if you want to maximize the performance of Zabbix server (or proxy) though. See the [[manual:appendix:performance_tuning|performance tuning]] section for more details.
- +
-The rest of the parameters will suit you with their defaults if you have a small installation (up to ten monitored hosts). You should change the default parameters if you want to maximize the performance of Zabbix server (or proxy) though. See the [[:2.4/manual/appendix/performance_tuning|performance tuning]] section for more details.+
  
   * if you have installed a Zabbix proxy, edit the proxy configuration file **/​usr/​local/​etc/​zabbix_proxy.conf**   * if you have installed a Zabbix proxy, edit the proxy configuration file **/​usr/​local/​etc/​zabbix_proxy.conf**
Line 134: Line 171:
 == Copying PHP files == == Copying PHP files ==
  
-Zabbix frontend is written in PHP, so to run it a PHP supported webserver is needed. Installation is done by simply copying the PHP files from frontends/​php ​to the webserver HTML documents directory. ​+Zabbix frontend is written in PHP, so to run it a PHP supported webserver is needed. Installation is done by simply copying the PHP files from the ui directory ​to the webserver HTML documents directory. ​
  
 Common locations of HTML documents directories for Apache web servers include: Common locations of HTML documents directories for Apache web servers include:
Line 140: Line 177:
   * /​usr/​local/​apache2/​htdocs (default directory when installing Apache from source)   * /​usr/​local/​apache2/​htdocs (default directory when installing Apache from source)
   * /​srv/​www/​htdocs (OpenSUSE, SLES)   * /​srv/​www/​htdocs (OpenSUSE, SLES)
-  * /​var/​www/​html (Fedora, RHEL, CentOS+  * /​var/​www/​html (Debian, Ubuntu, ​Fedora, RHEL, CentOS)
-  * /var/www (Debian, Ubuntu)+
   ​   ​
 It is suggested to use a subdirectory instead of the HTML root. To create a subdirectory and copy Zabbix frontend files into it, execute the following commands, replacing the actual directory: It is suggested to use a subdirectory instead of the HTML root. To create a subdirectory and copy Zabbix frontend files into it, execute the following commands, replacing the actual directory:
  
   mkdir <​htdocs>/​zabbix   mkdir <​htdocs>/​zabbix
-  cd frontends/​php+  cd ui
   cp -a . <​htdocs>/​zabbix   cp -a . <​htdocs>/​zabbix
  
-If installing from SVN and planning to use any other language than English, ​you must generate translation files. To do so, run: +If planning to use any other language than English, ​see [[manual/appendix/install/​locales|Installation of additional frontend languages]] for instructions.
- +
-  locale/​make_mo.sh +
-  +
-''​msgfmt''​ utility from gettext package is required.  +
- +
-<​note>​Additionally,​ to use any other language than English, its locale should be installed on the web server. See the [[:2.4/manual/web_interface/user_profile#​see_also|"See also"]] section in the "User profile"​ page to find out how to install it if required.</​note>​+
  
 == Installing frontend == == Installing frontend ==
  
-== Step 1 == +Please ​see [[:​manual/​installation/​frontend|Web interface ​installation]] page for information about Zabbix frontend installation ​wizard
- +
-In your browser, open Zabbix URL: http:<​nowiki>//</​nowiki><​server_ip_or_name>/​zabbix +
- +
-You should ​see the first screen of the frontend installation wizard. +
- +
-{{:2.4/manual/​installation/​install_1.png?​550|}} +
- +
-== Step 2 == +
- +
-Make sure that all software prerequisites are met. +
- +
-{{:​2.4/​manual/​installation/​install_2.png?​550|}} +
- +
-^Pre-requisite^Minimum value^Description^ +
-|//PHP version// ​ |5.3.0 ​ |  | +
-|//PHP memory_limit option// ​ |128MB ​ |In php.ini:\\ memory_limit = 128M  | +
-|//PHP post_max_size option// ​ |16MB  |In php.ini:\\ post_max_size = 16M  | +
-|//PHP upload_max_filesize option// ​ |2MB  |In php.ini:\\ upload_max_filesize = 2M  | +
-|//PHP max_execution_time option// ​ |300 seconds ​ |In php.ini:\\ max_execution_time = 300  | +
-|//PHP max_input_time option// ​ |300 seconds ​ |In php.ini:\\ max_input_time = 300  | +
-|//PHP session.auto_start option// ​ |must be disabled ​ |In php.ini:\\ session.auto_start = 0.  | +
-|//Database support// ​ |One of: IBM DB2, MySQL, Oracle, PostgreSQL, SQLite ​ |One of the following modules must be installed:​\\ ibm_db2, mysql, oci8, pgsql, sqlite3 ​ | +
-|//​bcmath// ​ |  |php-bcmath ​ | +
-|//​mbstring// ​ |  |php-mbstring ​ | +
-|//PHP mbstring.func_overload option// ​ |must be disabled ​ |In php.ini:\\ mbstring.func_overload = 0.  | +
-|//​sockets// ​ |  |php-net-socket. Required ​for user script support. ​  | +
-|//​gd// ​ |2.0 or higher ​ |php-gd. PHP GD extension must support PNG images (//<​nowiki>​--with-png-dir</​nowiki>//​),​ JPEG (//<​nowiki>​--with-jpeg-dir</​nowiki>//​) images and FreeType 2 (//<​nowiki>​--with-freetype-dir</​nowiki>//​). | +
-|//​libxml// ​ |2.6.15 ​ |php-xml or php5-dom ​ | +
-|//​xmlwriter// ​ |  |php-xmlwriter ​ | +
-|//​xmlreader// ​ |  |php-xmlreader ​ | +
-|//​ctype// ​ |  |php-ctype ​ | +
-|//​session// ​ |  |php-session ​ | +
-|//​gettext// ​ |  |php-gettext\\ Since Zabbix ​2.2.1, the PHP gettext extension is not a mandatory requirement for installing Zabbix. If gettext is not installed, the frontend ​will work as usual, however, the translations will not be available. ​ | +
- +
-Optional pre-requisites may also be present in the list. A failed optional prerequisite is displayed in orange and has a //Warning// status. With a failed optional pre-requisite,​ the setup may continue. +
- +
-== Step 3 == +
- +
-Enter details for connecting to the database. Zabbix database must already be created. +
- +
-{{:​2.4/​manual/​installation/install_3.png?​550|}} +
- +
-== Step 4 == +
- +
-Enter Zabbix server details. +
- +
-{{:​2.4/​manual/​installation/​install_4.png?​550|}} +
- +
-== Step 5 ==+
  
-Review a summary of settings.+=== 3 Installing Java gateway ==
  
-{{:2.4/​manual/​installation/​install_5.png?550|}}+It is required to install Java gateway only if you want to monitor JMX applicationsJava gateway is lightweight and does not require a database
  
-== Step 6 ==+To install from sources, first [[:​manual/​installation/​install#​download_the_source_archive|download]] and extract the source archive.
  
-Download ​the configuration file and place it under conf/.+To compile Java gateway, run the ''​./configure''​ script with ''​%%--enable-java%%''​ option. It is advisable that you specify the ''​%%--prefix%%''​ option to request installation path other than the default /usr/local, because installing Java gateway will create a whole directory tree, not just a single executable.
  
-{{:2.4/manual/​installation/​install_6.png?​550|}}+  $ ./configure --enable-java --prefix=$PREFIX
  
-{{:2.4/​manual/​installation/​saving_zabbix.conf.png|}}+To compile and package Java gateway into a JAR file, run ''​make''​Note that for this step you will need ''​javac''​ and ''​jar''​ executables in your path.
  
-<note tip>​Providing the webserver user has write access to conf/ directory the configuration file would be saved automatically and it would be possible to proceed to the next step right away.</​note>​ +  $ make
-== Step 7 ==+
  
-Finish ​the installation.+Now you have a zabbix-java-gateway-$VERSION.jar file in src/​zabbix_java/​bin. If you are comfortable with running Java gateway from src/​zabbix_java in the distribution directory, then you can proceed to instructions for configuring and running [[:​manual/​concepts/​java#​overview_of_files_in_java_gateway_distribution|Java gateway]]. Otherwise, make sure you have enough privileges and run ''​make install''​.
  
-{{:​2.4/​manual/​installation/​install_7.png?​550|}}+  $ make install
  
-== Step 8 ==+Proceed to [[:​manual/​concepts/​java/​from_sources|setup]] for more details on configuring and running Java gateway.
  
-Zabbix ​frontend is ready! The default user name is **Admin**, password **zabbix**.+=== 4 Installing ​Zabbix ​web service === 
 +Installing Zabbix web service ​is only required if you want to use [[:​manual/​web_interface/​frontend_sections/​reports/​scheduled|scheduled reports]]
  
-{{:2.4/manual/quickstart/login.png?550|}}+To install from sources, first [[:manual/installation/install#​download_the_source_archive|download]] and extract the source archive.
  
-Proceed to [[:2.4/manual/​quickstart/​login|getting started ​with Zabbix]].+To compile Zabbix web service, run the ''​./configure''​ script ​with ''​%%--enable-webservice%%''​ option
  
-==== Troubleshooting ====+<​note>​ A configured [[https://​golang.org/​doc/​install|Go]] version 1.13+ environment is required for building Zabbix web service. </​note>​
  
-See the section on [[:​2.4/​manual/​appendix/​install/​troubleshooting|installation-specific issue troubleshooting]]. 
  
 ==== See also ==== ==== See also ====
   - [[http://​www.zabbix.org/​wiki/​How_to/​configure_shared_memory|How to configure shared memory for Zabbix daemons]]   - [[http://​www.zabbix.org/​wiki/​How_to/​configure_shared_memory|How to configure shared memory for Zabbix daemons]]