官网下载对应版本的包:
安装server
- dpkg -i zabbix-server-mysql_3.4.3-2+xenial_amd64.deb
- 若提示依赖问题: apt-get -f install
- 修改配置:
sudo vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix 创建DB:
mysql -uroot -p
mysql> create user ‘zabbix’@’localhost’ identified by ‘zabbix’;
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to ‘zabbix’@’localhost’;
mysql> flush privileges;
mysql> exit;同步DB信息
cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -uroot zabbix
安装web端
- dpkg -i zabbix-frontend-php_3.4.3-2+xenial_all.deb
- 依赖问题: apt-get -f install
- 配置Vhost:
在/etc/apache2/sites-available 中增加配置文件zabbix.conf,我监听的是8081
<VirtualHost *:8081>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /usr/share/zabbix/
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
ln -s /etc/apache2/sites-available/zabbix.conf /etc/apache2/sites-enabled/zabbix.conf
监听端口
vi /etc/apache2/ports.conf
Listen 8081重启服务
systemctl restart zabbix-server.service
systemctl restart apache2.service访问
http://your_server_ip:8081
web登录帐号是Admin/zabbix