如何在 CentOS 7 上安装 Ntopng

在本教程中,我们将向您展示如何在 CentOS 7 上安装 Ntopng。对于那些不知道的人,如果您希望监控服务器上的不同网络协议,Ntopng 是一个相对有用的工具。 它提供了一堆工具来监控各种协议、流量变体,是的,跨多个时间框架的带宽。 Ntopng 基于 libpcap,它以可移植的方式编写,以便在每个 Unix 平台、macOS 和 Win32 上虚拟运行。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单。 我将向您展示在 CentOS 7 上逐步安装 Ntopng。

先决条件

  • 运行以下操作系统之一的服务器:CentOS 7。
  • 建议您使用全新的操作系统安装来防止任何潜在问题。
  • 对服务器的 SSH 访问(或者如果您在桌面上,则只需打开终端)。
  • 一种 non-root sudo user或访问 root user. 我们建议充当 non-root sudo user,但是,如果您在充当 root 时不小心,可能会损害您的系统。

在 CentOS 7 上安装 Ntopng

步骤 1. 首先,我们需要将 EPEL 存储库添加到我们的系统中。

yum install epel-release wget

步骤 2. 为稳定版本创建 Ntop 存储库。

# cat /etc/yum.repos.d/ntop.repo [ntop] name=ntop packages baseurl=https://www.nmon.net/centos-stable/$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=https://www.nmon.net/centos-stable/RPM-GPG-KEY-deri [ntop-noarch] name=ntop packages baseurl=https://www.nmon.net/centos-stable/$releasever/noarch/ enabled=1 gpgcheck=1 gpgkey=https://www.nmon.net/centos-stable/RPM-GPG-KEY-deri

步骤 3. 在 CentOS 7 上安装 Ntopng 软件包。

yum update yum install ntopng ntopng-data yum install redis php-pecl-redis

步骤 4. 配置 Ntopng。

安装后,Ntopng 需要一个配置文件。 出于测试目的,我们可以使用示例配置文件,但不要忘记稍后创建一个正确的配置文件(man Ntopng):

cp /etc/ntopng/ntopng.conf.sample /etc/ntopng/ntopng.conf

步骤 5. 启动 Ntopng 和 Redis 服务器也使服务在启动时启动:

systemctl start redis-server.service systemctl enable redis-server.service systemctl start ntopng.service systemctl enable ntopng.service

步骤 6. 配置 ipables 或防火墙。

firewall-cmd --direct --add-rule ipv4 filter IN_public_allow 0 -m tcp -p tcp --dport 3000 -s 192.168.1.146 -j ACCEPT

步骤 7. 访问 Ntopng。

如果一切顺利,现在您可以通过键入来测试您的 Ntopng 应用程序 https://your-server-ip:3000. 您将看到 Ntopng 登录页面。 第一次,您可以使用 user ‘admin’和密码’admin’。

恭喜! 您已成功安装 Ntopng。 感谢您使用本教程在 CentOS 7 系统上安装 Ntopng 服务器监控。 如需更多帮助或有用信息,我们建议您查看 Ntopng 官方网站.

Save