[Linux笔记]Centos流量监控工具iftop

Leave a comment

在类Unix系统中可以使用top查看系统资源、进程、内存占用等信息。查看网络状态可以使用netstat、nmap等工具。若要查看实时的网络流量,监控TCP/IP连接等,则可以使用iftop。

一、iftop是什么?
iftop是类似于top的实时流量监控工具。
官方网站:http://www.ex-parrot.com/~pdw/iftop/

二、iftop有什么用?
iftop可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息等,详细的将会在后面的使用参数中说明。
Continue reading

DirectAdmin动态IP登陆自动退出问题解决

Leave a comment

DirectAdmin的Session会检查IP是否变动。参考官方资料:
http://www.directadmin.com/features.php?id=443

修改directadmin.conf文件

vim /usr/local/directadmin/conf/directadmin.conf

修改disable_ip_check=0为disable_ip_check=1
如果在里面没有,直接添加 disable_ip_check=1 就可以。

然后重启DA 面板重启或者SSH执行如下命令

/etc/init.d/directadmin restart

[Linux笔记]/var/log目录日志对应用途

Leave a comment

位于/var/log/目录之下有许多日志文件,这里记录一下相关用途。其中一些只有特定版本采用,如dpkg.log只能在基于Debian的系统中看到。
/var/log/messages — 包括整体系统信息,其中也包含系统启动期间的日志。此外,mail,cron,daemon,kern和auth等内容也记录在var/log/messages日志中。
/var/log/dmesg — 包含内核缓冲信息(kernel ring buffer)。在系统启动时,会在屏幕上显示许多与硬件有关的信息。可以用dmesg查看它们。
/var/log/auth.log — 包含系统授权信息,包括用户登录和使用的权限机制等。
/var/log/boot.log — 包含系统启动时的日志。
/var/log/daemon.log — 包含各种系统后台守护进程日志信息。
/var/log/dpkg.log – 包括安装或dpkg命令清除软件包的日志。
/var/log/kern.log – 包含内核产生的日志,有助于在定制内核时解决问题。
/var/log/lastlog — 记录所有用户的最近信息。这不是一个ASCII文件,因此需要用lastlog命令查看内容。
/var/log/maillog /var/log/mail.log — 包含来着系统运行电子邮件服务器的日志信息。例如,sendmail日志信息就全部送到这个文件中。
/var/log/user.log — 记录所有等级用户信息的日志。 Continue reading

[Linux笔记]apache 2.4 安装 mod_rpaf

Leave a comment

在使用第三方的DANginx插件用在Directadmin apache2.4的时候,发现无法安装mod_rpaf.这个插件是用来让apache获取到访客正确ip的。
apache2.4已经有了mod_remoteip.so 但没时间仔细研究,Directadmin无法正常加载,先行编译mod_rpaf达到要求
编译时提示的错误

# apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
/var/www/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_rpaf-2.0.lo mod_rpaf-2.0.c && touch mod_rpaf-2.0.slo
mod_rpaf-2.0.c: In function 'rpaf_cleanup':
mod_rpaf-2.0.c:150: error: 'conn_rec' has no member named 'remote_ip'
mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_addr'
mod_rpaf-2.0.c:151: warning: implicit declaration of function 'inet_addr'
mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_ip'
mod_rpaf-2.0.c: In function 'change_remote_ip':
mod_rpaf-2.0.c:164: error: 'conn_rec' has no member named 'remote_ip'
mod_rpaf-2.0.c:183: error: 'conn_rec' has no member named 'remote_ip'
mod_rpaf-2.0.c:186: error: 'conn_rec' has no member named 'remote_ip'
mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_addr'
mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_ip'
apxs:Error: Command failed with rc=65536

Continue reading