centos7 编译ntopng源码

先安装编译所需的开发工具

yum groupinstall Development Tools

yum install tcl

yum install libpcap libpcap-devel

 yum install libgnomeui-devel(glib 安装 Linux平台下最常用的C语言函数库,它具有很好的可移植性和实用性。)

安装Redis:

yum -y install epel-release

1、执行autogen.sh

2、执行./configure

3、提示执行以下命令

Please do cd ..; git clone https://github.com/ntop/nDPI.git; cd nDPI; ./autogen.sh; make; cd ../ntopng

4、执行之后再次执行./configure

提示安装libcurl-dev

执行:yum install curl-devel

5、再次执行./configure 又遇到错误

SQLite 3.x missing (libsqlite3-dev): please install it and try again

执行:

yum install sqlite-devel

6、make执行过程中还会遇到一些错误,是因为configure或者makefile文件没有执行权限,对这些文件加上执行权限即可

7、mysql.h找不到

虽然已经装了mysql-libs,还要安装mysql开发包。

yum install mysql-devel

Please do not forget to download GeoIP databases doing: /usr/bin/gmake geoip

 还需要libxml2 包

执行make install 之后有这么一段话

Make sure you have already run 'make geoip' to also install geoip dat files
While we provide you an install make target, we encourage you
to create a package and install that
rpm - do 'make build-rpm'
deb - do 'cd packages/ubuntu;./configure;make
mkdir -p /usr/local/share/ntopng /usr/local/man/man8 /usr/local/bin
cp ntopng /usr/local/bin
cp ./ntopng.8 /usr/local/man/man8
cp -r ./httpdocs /usr/local/share/ntopng
cp -Lr ./scripts /usr/local/share/ntopng # L dereference symlinks
find /usr/local/share/ntopng -name "*~" | xargs /bin/rm -f
find /usr/local/share/ntopng -name ".git" | xargs /bin/rm -rf

原文地址:https://www.cnblogs.com/earendil/p/6643771.html