分类: LINUX
2008-01-07 18:31:10
cd /usr/local/src/
wget
wget
tar zxvf rrdtool-1.2.23.tar.gz
cd rrdtool-1.2.23
rpm -Uvh libart_lgpl-devel-2.3.17-4.i386.rpm
cp freetype2.pc /usr/lib/pkgconfig/
注释:由于我的freetype2是安装在/usr/local/freetype的目录下的,所以要把freetype2.pc拷贝到相关目录,不然configure通不过的,同时这里不能通过建立符号连接的方法解决
./configure –prefix=/usr/local/rrdtool
make
make install
tar zxvf ntop-3.3.tar.gz
rpm –Uvh libpcap-devel-0.9.4-8.1.i386.rpm
./autogen.sh --prefix=/usr/local/ntop
make
make install
注释:2个rpm的包都是系统自带的,当然了devel包都装了本身肯定是要安装的了。
cp packages/RedHat/ntop.conf.sample /etc/ntop.conf
cp packages/RedHat/ntop.init /etc/init.d/ntop
chkconfig --add ntop
编辑自启动文件,更改如下几行
vi /etc/init.d/ntop
prog="/usr/local/ntop/bin/ntop"
pids=`ps axf | grep '\/usr\/local\/ntop\/bin\/ntop' | awk '{ printf(" %s", $1) }; END { print "" }'`
chmod 644 /etc/ntop.conf
vi /etc/ntop.conf
--db-file-path /var/log/ntop
--interface eth1
-m 172.21.41.0/24
--trace-level 3
--http-server 3000
用service ntop start启动ntop出错,提示你看docs/1STRUN.txt,第一次运行时注意事项
第一次运行,必须加“admin password”等参数,运行用户必须为root
mkdir /var/log/ntop
useradd -s /sbin/nologin -d /dev/null ntop
chown -R ntop.ntop /var/log/ntop
/usr/local/ntop/bin/ntop -P /var/log/ntop -u root -A
参数说明:
-P db文件的路径
-u ntop的运行用户(run user)
-A 设定admin密码
创建ntop的运行用户ntop
这条命令同时还在/var/log/ntop目录下创建了ntop_pw.db prefsCache.db文件
service ntop start
然后打开浏览器输入就可以察看结果
附录:
由于我gd和 libpng都已经安装过了,以下为以前的安装过程
1、安装zlib (安装libpng和gd前需要先安装zlib)
cd /usr/local/src
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib
make;make install
2. 安装libpng
cd /usr/local/src
# tar zxvf libpng-1.2.23.tar.gz
# cd libpng-1.2.23
# cp scripts/makefile.std makefile
# make;make install
3. 安装freetype
cd /usr/local/src
# tar zxvf freetype-2.3.5.tar.gz
# cd freetype-2.3.5
./configure --prefix=/usr/local/freetype
make;make install
4. 安装jpeg
cd /usr/local/src
# tar zxvf jpegsrc.v6b.tar.gz
# cd jpeg-6b
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/include
mkdir /usr/local/jpeg6/man
mkdir /usr/local/jpeg6/man/man1
./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
make;make install
5. 安装gd
cd /usr/local/src
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-png \
--with-zlib=/usr/local/zlib --with-freetype=/usr/local/freetype
make; make install