搭建专用squid缓存日志服务器

2236阅读 0评论2011-06-29 
分类:系统运维

日志服务器使用的是RHEL5.4的系统:

一、服务器端配置
1.修改/etc/sysconfig/syslog文件
  1. # Options to syslogd
  2. # -m 0 disables 'MARK' messages.
  3. # -r enables logging from remote machines
  4. # -x disables DNS lookups on messages recieved with -r
  5. # See syslogd(8) for more details
  6. SYSLOGD_OPTIONS="-r -s IP地址"
  7. # Options to klogd
  8. # -2 prints all kernel oops messages twice; once for klogd to decode, and
  9. # once for processing with 'ksymoops'
  10. # -x disables all klogd processing of oops messages entirely
  11. # See klogd(8) for more details
  12. KLOGD_OPTIONS="-x"
  13. #
  14. SYSLOG_UMASK=0600
  15. # set this to a umask value to use for all log files as in umask(1).
  16. # By default, all permissions are removed for "group" and "other".
-r 打开远程日志写入功能
-s IP地址 指定那些服务器可以写入,IP地址以;间隔.
2.修改/etc/syslog.conf,在服务器端指定自定义的日志类型,我这里用的是local2.
  1. local2.* /var/log/squid/access.log
  2. *.info;mail.none;authpriv.none;cron.none;local2.none /var/log/messages
local2.* /var/log/squid/access.log 指定日志存储路径
local2.none 该类型的info级别以上消息不发送到/var/log/messages
3.重启syslog服务
#service syslog restart
#chkconfig syslog on

二、客户端配置
1.修改/etc/syslog.conf文件
  1. #Save squid access.log
  2. local2.* @10.12.12.12
  3. # Don't log private authentication messages!
  4. *.info;mail.none;authpriv.none;cron.none;local2.none /var/log/messages
local2.* @10.12.12.12  local2类型的所有日志发送到10.12.12.12远程日志服务器
local2.none  该类型的info级别以上消息不发送到/var/log/messages
2.修改squid.conf配置文件
  1. access_log syslog:local2.* squid
指定access_log日志存储路径和squid格式
3.重启日志服务
#service syslog restart
#chkconfig syslog on


上一篇:squid查询
下一篇:squid磁盘缓存基础