部署ntop平台 不指定

root , 2009/09/15 00:05 , Linux , 评论(0) , 阅读(25332) , Via 本站原创 | |
下载软件包
引用

wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz

安装
引用

tar -zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
./configure
make;make install
cd
tar -zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure
make ;make install
cd
tar -zxvf libpng-1.2.18.tar.gz
libpng-1.2.18
./configure
make ;make install

cp -r libart-2.0/ /usr/include/libart-2.0/
cp -r freetype2/ /usr/include/freetype2/
cp -r libpng12/ /usr/include/libpng12/

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz
tar -zxvf rrdtool-1.2.27.tar.gz
cd rrdtool-1.2.27
ls
./configure --prefix=/usr/local/rrdtool
make && make install

安装libevent
引用

wget http://monkey.org/~provos/libevent-1.4.3-stable.tar.gz
tar -zxvf libevent-1.4.3-stable.tar.gz
cd libevent-1.4.3-stable
./configure && make && make install

安装ntop
引用

tar -zxvf ntop-3.3.10.tar.gz
cd ntop-3.3.10
./autogen.sh


问题1
引用

configure: error: cannot find macro directory `m4'
解决1cd /home/root/source/ntop-3.3.10
mkdir m4


问题2
引用

/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libgd.la] 错误 1
make[2]: Leaving directory `/usr/local/src/ntop'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/usr/local/src/ntop'
make: *** [all] 错误 2

解决:
wget http://www.imagemagick.org/download/delegates/zlib-1.2.3.tar.gz
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure

vi Makefile
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
接下面步骤
make
make install


继续安装ntop(此时已生成了configure):
./configure --with-rrd-home=/usr/local/rrdtool
make
make install

配置,启动ntop
useradd ntop //新建ntop用户
mkdir -p /var/www/html/ntop //建立ntop存放db文件夹,此路径可更改
chown -R ntop:ntop /var/www/html/ntop
cp /ntop-3.3.9/packages/RedHat/ntop.conf.sample /etc/ntop.conf
ntop -A //设置ntop管理员密码
ntop -P /var/www/html/ntop -u ntop //启动ntop,如无上一部,第一次运行是也会要求设置ntop管理员密码
[root@rhel5u3 ~]#echo "/usr/local/bin/ntop -d -u ntop -P /var/www/html/ntop/ " >> /etc/rc.local //开机自动启动ntop
浏览器打开http://IP:3000,就可以看到ntop的流量统计的网页
PS:默认端口为3000,如果需要修改端口,启动ntop时试用-w参数
如 ntop -P /var/www/html/ntop -u ntop -w 4000

效果图:
点击在新窗口中浏览此图片
Tags:
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]