centos6.4 64位 ntopng安裝
1、配置預設yum源
實驗使用阿裡的鏡像
1、備份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.def
2、下載下傳新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
3、之後運作yum makecache生成緩存
2、安裝epel源及給國内鏡像
1、下載下傳安裝
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
chmod u+x epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
2、備份(如有配置其他epel源)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
3、下載下傳新repo 到/etc/yum.repos.d/
epel(RHEL 6)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
3、安裝依賴庫
yum install libpcap-devel glib2-devel GeoIP GeoIP-devel libxml2-devel libxml2-devel redis wget rrdtool
下載下傳安裝libzmq3,網站為:http://rpm.pbone.net/index.php3/stat/4/idpl/23532429/dir/centos_6/com/libzmq3-3.2.2-5.1.x86_64.rpm.html
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/jblunck:/messaging/CentOS_CentOS-6/x86_64/libzmq3-3.2.2-5.1.x86_64.rpm
chmod u+x libzmq3-3.2.2-5.1.x86_64.rpm
rpm -ivh libzmq3-3.2.2-5.1.x86_64.rpm
解決如下出錯:
[root@net1 ~]# rpm -ivh ntopng-1.2.2-8420.x86_64.rpm
warning: ntopng-1.2.2-8420.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7921df34: NOKEY
error: Failed dependencies:
librrd.so.4()(64bit) is needed by ntopng-1.2.2-8420.x86_64
libzmq.so.3()(64bit) is needed by ntopng-1.2.2-8420.x86_64
rrdtool >= 1.3.8 is needed by ntopng-1.2.2-8420.x86_64
4、安裝及配置ntopng
1、下載下傳
網站 :http://www.nmon.net/packages/rpm/x86_64/
wget http://www.nmon.net/packages/rpm/x86_64/ntopng/ntopng-1.2.2-8420.x86_64.rpm
wget http://www.nmon.net/packages/rpm/x86_64/ntopng-data/ntopng-data-1.2.2-8420.noarch.rpm
2、安裝
chmod u+x ntopng-1.2.2-8420.x86_64.rpm ntopng-data-1.2.2-8420.noarch.rpm
rpm -ivh ntopng-1.2.2-8420.x86_64.rpm
rpm -ivh ntopng-data-1.2.2-8420.noarch.rpm
5、配置ntopng
1、檢視預設配置檔案
[root@net1 ~]# cd /etc/ntopng/
[root@net1 ntopng]# ls
ntopng.conf.sample ntopng.start
注,ntopng.conf.sample 檔案是配置檔案樣例,ntopng.start是ntopng啟動時需要的配置檔案(測試的ntopng版本此檔案為空)。
[root@net1 ntopng]# cat ntopng.conf.sample
-G=/var/tmp/ntopng.gid
注,-G指定運作所用程序号檔案。
修改後的内容為:
[root@net1 ntopng]# cat ntopng.conf
-G=/var/tmp/ntopng.pid
--local-networks "10.1.1.0/24"
--interface eth1
--user nobody
--http-port 8888
注,--local-network "指定本地子網段"; --interface eth1 指定監聽eth1網卡上的流量; --user z指定ntopng運作時使用的賬戶為nobody; --http-port 指定web服務端口為8888,如果不指定預設為3000。
6、啟動ntopng
注,在運作ntopng之前,要确認先啟動redis服務,redis為ntopng提供鍵值存儲。我們這邊重新啟動一下redis服務。
service redis start
service ntopng start
7、測試通路一下
http://IP:8888
預設的使用者名和密碼是admin。