將 Apache access,error log 透過 rsyslog 發至 Graylog
由於 httpd 預設沒有將 access/error log 丟到 syslog 做處理,要需手動新增
新增方式有兩種
- 直接編輯
httpd.conf
將 log file 導向到 syslog - 編輯
rsyslog.conf
叫 rsyslog 去撈本來存放在/var/log/httpd/(access|error).log
第一種方式會需要做 systemctl reload httpd.service
,對於線上運作中的機器有一定風險 一個弄不好鍋就是你戴好 ^^
雖然有文章指出 reload
不會中斷現有的 connection 不過還是少碰為妙
How to do an Apache Graceful Restart in CentOS 7