首先需要注意,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端口