您的位置:首页 > 其它

RHEL6 syslog日志服务器搭建

2011-09-04 18:02 239 查看
首先需要注意,6.0版本叫做rsyslog,5.4版本叫syslog

RHEL6.0

客户端配置

[root@server ~]# vi /etc/rsyslog.conf

# Save boot messages also to boot.log

local7.* /var/log/boot.log

*.* @hostname 这里的hostname用服务器的IP地址替换。

然后重新启动服务/etc/init.d/rsyslog restart

服务器端配置:

[root@server ~]# vi /etc/rsyslog.conf

将下面两行的#注释取消掉

# Provides UDP syslog reception

$ModLoad imudp.so

$UDPServerRun 514

然后重新启动服务/etc/init.d/rsyslog restart

使用lsof -i:514 命令来查看rsyslog服务是不是正常侦听端口

注意,防火墙配置的时候要开放UDP的514端口

RHEL5.4

1。客户端

客户端服务器上修改/etc/syslog.conf文件,在最后面加上下面的

*.* @hostname 这里的hostname用服务器的IP地址替换。

重启启动服务/etc/init.d/syslog restart

2 服务器端

在/etc/sysconfig/syslog文件中

# Options to syslogd

# -m 0 disables 'MARK' messages.

# -r enables logging from remote machines

# -x disables DNS lookups on messages recieved with -r

# See syslogd(8) for more details

SYSLOGD_OPTIONS="-r -m 0" 在这里添加一个-r

重启启动服务/etc/init.d/syslog restart

使用lsof -i:514 命令来查看rsyslog服务是不是正常侦听端口

注意,防火墙配置的时候要开放UDP的514端口
本文出自 “在晴朗的天空下” 博客,请务必保留此出处http://chenzhuo.blog.51cto.com/150592/657654
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: