Skip to main content

Zabbix Server 3.2 Installation in Ubuntu 16.04


Here is the complete guide of how to install Zabbix centralized monitoring Server in Ubuntu 16.04. I will install this with MySQL 5.7 and PHP 7.1. I Hope you would like this.
Run the following commands for update all the repository and upgrade the installed package:

Repository update:
# apt update -y
# apt upgrade -y

Install and configure Apache2 (Web Server):
# apt install apache2 apache2-utils -y
# a2enmod rewrite
# a2enmod deflate
# a2enmod ssl
# a2enmod headers

# sed -i '165s/Options Indexes FollowSymLinks/Options FollowSymLinks/g' /etc/apache2/apache2.conf

# sed -i '166s/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf

# echo "ServerSignature Off" >> /etc/apache2/apache2.conf
# /etc/init.d/apache2 restart

Now we have to Install and Configure PHP 7.1:
# apt-get install python-software-properties -y
# add-apt-repository ppa:ondrej/php
# apt-get update -y

# apt-get install -y php7.1 php7.1-mcrypt php7.1-mbstring php7.1-curl php7.1-cli php7.1-mysql php7.1-gd php7.1-intl php7.1-xsl php7.1-bcmath php7.1-bz2 php7.1-gd php7.1-zip   php7.1-imap php7.1-soap php7.1-tidy

# /etc/init.d/apache2 restart

Optional - If you want to see all php module that you have installed, just type below command, or you can create an info.php in your apache document root directory. info php code is given below:

# php -m

Info.php code:
<?php
// Show all information, defaults to INFO_ALLphpinfo();
?>

Now we have to Install MySQL 5.7:
# apt-get update -y
# apt-get install mysql-server -y

You can check MySQL version from below command (Optional):

# mysql -V

Zabbix Latest Repository Installation:
# wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb

# dpkg -i zabbix-release_3.2-1+xenial_all.deb
# apt-get update

Install and Configuration of Zabbix Server:
Zabbix server and web frontend installation with MySQL database:

# apt-get install zabbix-server-mysql zabbix-frontend-php

Creating initial database:
Create Zabbix database and user on MySQL by the following commands, where <root_password> shall be replaced with the actual root password. In my case, I have set 123 as MySQL root and 456 as Zabbix user password. You can set different pass. (e.g., # mysql -uroot -p123) and <password> with new password for Zabbix user on the database (including apostrophes: …identified by '456';):

# mysql -uroot -p123
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '456';

mysql> quit;

Import Database:
If you are installing the fresh copy of zabbix server, Then you have to import default zabbix database for initial schema and data. You will find the default zabbix database under "/usr/share/doc/zabbix-server-mysql" this directory.
Or if you have a previous zabbix server database backup file, then you have to import your old database instead of the default zabbix database.

I am installing the fresh copy of zabbix, so I will import the default zabbix database for initial schema and data.

# cd /usr/share/doc/zabbix-server-mysql
#  zcat create.sql.gz | mysql -uzabbix -p zabbix

You will ask for password to import database, and you have to give the right MySQL user password.

Zabbix Server configuration:
Now you need to make some change in your zabbix server configuration file.

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

Save the file by typing :x!
Before save you should give your information here according to you.
Now you have to start the zabbix server.

# /etc/init.d/zabbix-server start
# update-rc.d zabbix-server enable

Now you have to change your timezone to your preffered location in your php configuration file.

# vim /etc/zabbix/apache.conf

    <IfModule mod_php7.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 Europe/Riga
    </IfModule>

Uncomment the date.timezone and change it to your preffered location.
Restart the apache2 service.

# /etc/init.d/apache2 restart

Thats All, You have finished the installation process of zabbix server. Now you should access the zabbix frontend installation page. Just IP/zabbix/setup.php in your browser for access the zabbix frontend installation page.
** If you have any firewall in your network then make sure you have opened 80 port in your firewall.



Thank You

Source - zabbix.com

Comments

Popular posts from this blog

Notice "A non well formed numeric value encountered" in Zabbix dashboard with PHP 7.1

Hello Everyone, This problem will arrived when you would install Zabbix server with PHP 7.1: Just a tweak can be solved this problem, Please follow below guide: Go to include directory in the zabbix server installation directory. In my case I have installed in /usr/share/zabbix. So please change this to your own directory. Also I preferred the vim command to edit a file, you can replace it your own choice. # cd /usr/share/zabbix/include # vim func.inc.php

Zabbix 3.2 frontend installation

Hello, Here is the front end installation process in Zabbix server. After complete the installation of zabbix server. Go to your browser and type IP or Hostname/zabbix, you will get the frontend installation page. Click on "Next Step" button. After click you will get "Check of pre-requisites" page. Make sure all the pre-requisites are to be OK state. Then click on "Next Step" button. Now you will get "Configure DB connection" page. This is the most important step. "Database type" - Select your Database type here. "Database host" - You have to give your Database server IP/Hostname here. If you have installed your database on the same server then just type localhost. "Database port" - Here you have to put your database port, If it is default then type 0, "Database name" - Your zabbix database name. "User" - Zabbix database user name. "Password" - Zabbix database user