Installing Zabbix 2.2 from source code on CentOS 7.
Set the hostname
#/etc/hostename
Disable SELINUX
#vi /etc/selinux/config
Install below packages initially.
#yum group install "Development Tools"
#yum install httpd php
#yum install php-bcmath.x86_64 php-mbstring.x86_64 php-gd.x86_64
# yum install mysql mariadb-server
# yum install libxml2-devel net-snmp net-snmp-devel curl-devel
1. Download the source archive
[Link]
Once downloaded, extract the sources, by running,
#tar -zxvf [Link]
2. Create user account.
#groupadd zabbix
#useradd -g zabbix zabbix
3. Create Zabbix database.
For MySQL;
#systemctl start mariadb
# mysql_secure_installation
Enter current password for root (enter for none): (Press enter in your keyboard)
OK, successfully used password, moving on...
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Remove anonymous users? [Y/n] y
... Success!
Disallow root login remotely? [Y/n] y
... Success!
Remove test database and access to it? [Y/n] y
- Dropping test database...
Reload privilege tables now? [Y/n] y
... Success!
Thanks for using MariaDB!
4. ensure mariadb running.
# mysql -u root –p
MariaDB [(none)]> create database zabbix;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'secretpassword';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
5. Create all schema.
# mysql -u root -p zabbix < database/mysql/[Link]
# mysql -u root -p zabbix < database/mysql/[Link]
# mysql -u root -p zabbix < database/mysql/[Link]
6. Configuring the source.
#./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
# make
# make install
7. Configure the webserver
# sed -i 's/^max_execution_time.*/max_execution_time=600/' /etc/[Link]
# sed -i 's/^max_input_time.*/max_input_time=600/' /etc/[Link]
# sed -i 's/^memory_limit.*/memory_limit=256M/' /etc/[Link]
# sed -i 's/^post_max_size.*/post_max_size=32M/' /etc/[Link]
# sed -i 's/^upload_max_filesize.*/upload_max_filesize=16M/' /etc/[Link]
# sed -i "s/^\;[Link].*/[Link]=\'Asia/Calcutta'/" /etc/[Link]
Or
# vim /etc/[Link] and change the parameters.
max_execution_time 600
max_input_time=600
memory_limit=256M
post_max_size=32M
upload_max_filesize=16M
[Link]=’Asia/Culcutta’
#vim /etc/httpd/conf.d/[Link]
#
# Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/share/zabbix/conf">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">
Require all denied
</Directory>
Security considerations
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
Start and initialize Zabbix
# systemctl start zabbix-agent
# systemctl start zabbix-server
# systemctl start httpd
Start all service on boot
# systemctl enable zabbix-agent
# systemctl enable zabbix-server
# systemctl senable httpd
After starting the services, browse to the following URL: [Link] or hostname>/zabbix (for example:
[Link] If all goes well, you should see something like this
Click next and check if everything is marked with OK:
In the next step, enter the details about the MariaDB user which we created (named zabbix and password
secretpass):
Continue to step and finish the installation:
After clicking finish, you should see the login screen to your new Zabbix installation:
The default username is admin and the default password for that user is zabbix.
Reference weblinks
[Link]
[Link]
[Link]
[Link]