Operating system type: Ubuntu
System Environment Version: 4.4.0-122-generic
IP Address: 192.168.152.118
The first step: Select the appropriate operating system type and the version of the requirements, my side directly using the Lnmp script platform to build;
https://lnmp.org/download.html Download the lnmp1.5-full.tar.gz script installation package
1: The above connection is a LNMP platform script package, download the corresponding server and the corresponding directory for decompression;
sh152118:/tmp/package$ sudo tar xvf lnmp1.5-full.tar.gz
sh152118:/tmp/package$ CD lnmp1.5-full/
sh152118:/tmp/package/ lnmp1.5-full$sudo bash install.sh
It takes about 40-50 minutes for installation to finish, and after successful installation, you can use the relevant command to see that the corresponding service port is turned on; 2: Get 3.4zabbix installation package wget Http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb Installing Zabbix Server#使用dpkg安装3.4deb Packagedpkg-i Zabbix-release_3.4-1+xenial_all.deb#更新aptapt Update#安装Zabbix Web program apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent----------------- ---------------------------------------------------------------------------------------------3: There may be an error accessing the database, Here is the solution.
[Email protected]:~# mysql-uroot-p
Enter Password:
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2 "No such file or directory")
[Email protected]:~# vim/etc/my.cnf//Comment out the client field of the socket =/tmp/mysql.sock in the service restart;
[Client]
#password = Your_password
Port = 3306
#socket =/tmp/mysql.sock
[Email protected]:~#/etc/init.d/mysql Restart
[OK] Restarting MySQL (via Systemctl): Mysql.service.
--------------------------------------------------------------------------------------------------------------4 : Build the Zabbix Library table and import the data[email protected]: ~# mysql-uroot-p Enter password:ubuntu Welcome to the MariaDB Monitor. Commands End With; or \g. Your MariaDB Connection ID is the Server version:10.0.34-mariadb-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c), 2018, Oracle, MariaDB Corporation Ab and others.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
MariaDB [(None)]> CREATE database Zabbix character set UTF8 collate utf8_bin; Query OK, 1 row Affected (0.00 sec)
MariaDB [(None)]> grant all privileges on zabbix.* to [e-mail protected] identified by ' password '; Query OK, 0 rows Affected (0.00 sec)
MariaDB [(None)]> MariaDB [(none)]> flush privileges; Query OK, 0 rows Affected (0.00 sec)
MariaDB [(None)]>exit
--------------------------------------------------------------------------------------------------------------- -------------
5: Initialize the import table structure
zcat/usr/share/doc/zabbix-server-mysql/create.sql.gz | Mysql-uzabbix-p Zabbix
Enter Password:password
--------------------------------------------------------------------------------------------------------------- ---------------
6: Modify the zabbix_server.conf file
The configuration reference is as follows, mainly to modify the password and a comment of the host dbhost=localhost Dbname=zabbix Dbuser=zabbix Dbpassword=password
--------------------------------------------------------------------------------------------------------------- ------------
7: Copy the relevant configuration file to the corresponding Nginx default directory, one-click script Default path is/home/wwwroot/default/
# cp-r/usr/share/zabbix//home/wwwroot/default/
# cd/home/wwwroot/default/zabbix/conf/
#rm-RF zabbx.conf.php
#cp zabbix.conf.php.example./zabbix.conf.php
#vim./zabbix.conf.php
$DB [' TYPE '] = ' MYSQL ';
$DB [' SERVER '] = ' 127.0.0.1 ';
$DB [' PORT '] = ' 3306 ';
$DB [' DATABASE '] = ' Zabbix ';
$DB [' USER '] = ' Zabbix ';
$DB [' PASSWORD '] = ' PASSWORD ';
# chown www.www/home/wwwroot/default/*-R
#vim/etc/zabbix/zabbix_server.conf Modifying a configuration file
Dbsocket=/tmp/mysqld.sock
#ln-S/run/mysqld/mysqld.sock/tmp/
#/etc/init.d/php-fpm restart
--------------------------------------------------------------------------------------------------------------- -------------
8: Install Zabbix Web Front end
Visit: http://IP/zabbix/zabbix.php
To modify a configuration file:
Max_input_time = 60 modified to: Max_input_time = 300
; always_populate_raw_post_data =-1 modified to: Always_populate_raw_post_data = 1
sh152118:~#/etc/init.d/php-fpm restart Restart service;
----------------------------------------------------------------------------------------------
Contact wx:ai759731807 If you have any questions
Ubuntu System builds Zabbix monitoring