Zabbix Server安装(Ubuntu16.04)

官网下载对应版本的包:

安装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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值