본문 바로가기
Linux

[CentOS] Rsyslog 로그 서버 구축

by 게킴의 블로그 2022. 12. 22.

클라이언트 설정

1. rsyslog.conf 설정

vi /etc/rsyslog.conf 

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none    /var/log/messages
*.*                                                     @로그서버 IP:514

*.* 모든 로그를  @로그서버 IP:514로 보내도록 하는 설정 

2. rsyslog 데몬 재시작

systemctl restart rsyslog

 

서버 설정

서버에서 고려해야 할 부분은 두 가지다. 

1. rsyslog.conf 또는 rsyslog.d 설정

vi /etc/rsyslog.conf

# UDP로 전송 시 아래 구문 주석해제
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# TCP로 전송 시 아래 구문 주석해제
# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

2. rsyslog 데몬 재시작

systemctl restart rsyslog

2.  방화벽 설정

firewall-cmd --add-port=514/udp --permanent
firewall-cmd --reload

 

'Linux' 카테고리의 다른 글

[CentOS] chage 명령어  (0) 2022.12.16

최근댓글

최근글

skin by © 2024 ttuttak