2014年1月13日 星期一

[研究] syslog-ng 3.5.3 快速安裝程式 (CentOS 6.5 x64)

[研究] syslog-ng 3.5.3 快速安裝程式 (CentOS 6.5 x64)

2014-01-13

CentOS 6.5 的 yum 預設沒有提供 syslog-ng, eventlog, libnet

[root@localhost ~]# yum list | grep syslog-ng
[root@localhost ~]# yum list | grep eventlog

[root@localhost ~]# yum list | grep libnet
libnetfilter_conntrack.i686               0.0.100-2.el6                  base
libnetfilter_conntrack.x86_64             0.0.100-2.el6                  base
libnetfilter_conntrack-devel.i686         0.0.100-2.el6                  base
libnetfilter_conntrack-devel.x86_64       0.0.100-2.el6                  base

官方網站
http://www.balabit.com/

下載
http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/3.5.3/source/syslog-ng_3.5.3.tar.gz

syslog-ng_install.sh 內容

#!/bin/sh

echo -e "\033[31;42m ********** Install Syslog-ng on CentOS 6.5 x64 ********** \033[0m"
echo -e "\033[31m 2014/01/13 ********** \033[0m"

# 網路對時
ntpdate tick.stdtime.gov.tw

# 停掉目前使用的 yum
if  [ "`ps aux | grep yum | wc -l `" != "1" ]; then
  ProcessID="`ps aux | grep yum | awk '{print $2}' `"
  for i in $ProcessID
  do
    echo $i
    kill -9 $i
  done
fi

# 安裝基本套件
yum  -y  install  gcc  tcp_wrappers  tcp_wrappers-libs  glib2  glib2-devel  glib2-static

# 安裝 Eventlog (2013-12-24 版本)
wget  --no-check-certificate   http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/3.5.3/source/eventlog_0.2.12+20120504+1700.tar.gz
tar  -zxvf  eventlog_0.2.12+20120504+1700.tar.gz
cd  eventlog_0.2.12+20120504+1700.tar.gz
./configure;
make;
make  install
cd ..

# 好像不用??
# 安裝 libnet (v0.10.11,2003-02-18)
# http://libnet.sourceforge.net/
#wget http://sourceforge.net/projects/libnet/files/libnet/0.10.11/libnet-0.10.11.tar.gz/download
#tar  -zxvf  libnet.tar.gz;  cd  libnet/
#./configure;  make;  make  install
#cd ..

# 安裝 Syslog-ng  (2013-12-24 版本)
wget  --no-check-certificate   http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/3.5.3/source/syslog-ng_3.5.3.tar.gz
tar zxvf syslog-ng_3.5.3.tar.gz
cd syslog-ng_3.5.3

# find / -noleaf  -name  pkgconfig
# find / -noleaf  -name  eventlog.pc
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
export PKG_CONFIG_PATH
./configure
make
make install
cd ..

# 設定Syslog-ng
cd contrib/rhel-packaging
sed -i -e "s@SYSLOGNG_OPTIONS@# SYSLOGNG_OPTIONS@"   syslog-ng.sysconfig
sed -i -e "/SYSLOGNG_OPTIONS/aSYSLOGNG_OPTIONS=\"-ve -f \/etc\/syslog-ng\/syslog-ng.conf\""   syslog-ng.sysconfig
ln  -s  /usr/local/sbin/syslog-ng  /sbin/
mkdir  /etc/syslog-ng/;  cp  syslog-ng.conf  /etc/syslog-ng/
cp  syslog-ng.init  /etc/init.d/syslog-ng;  chmod  755  /etc/init.d/syslog-ng
cp  syslog-ng.sysconfig  /etc/sysconfig/syslog-ng
cp  syslog-ng.logrotate  /etc/logrotate.d/syslog-ng
chkconfig  --add  syslog-ng

# verify
# syslog-ng  -f  /etc/syslog-ng/syslog-ng.conf

service  syslog-ng  start

驗證

[root@localhost ~]# ps aux | grep syslog-ng
root     29662  0.0  0.0  24456   580 ?        S    15:44   0:00 supervising syslog-ng
root     29663  0.0  0.1  35184  1992 ?        Ss   15:44   0:00 syslog-ng
root     29683  0.0  0.0  24484   584 ?        S    15:46   0:00 supervising syslog-ng
root     29684  0.0  0.1  33124  2016 ?        Ss   15:46   0:00 syslog-ng -f /etc/syslog-ng/syslog-ng.conf
root     29697  0.0  0.0  24456   572 ?        S    15:46   0:00 supervising syslog-ng
root     29698  0.0  0.1  35180  1988 ?        Ss   15:46   0:00 /sbin/syslog-ng
root     29723  0.0  0.0 103244   868 pts/1    S+   15:52   0:00 grep syslog-ng
[root@localhost ~]#

(完)

[研究] syslog-ng 3.5.3 快速安裝程式 (CentOS 6.5 x64)
http://shaurong.blogspot.com/2014/01/syslog-ng-353-centos-65-x64.html
http://forum.icst.org.tw/phpbb/viewtopic.php?f=16&t=80687

[研究] syslog-ng 2.0.10 安裝(Fedora 9, tar.gz)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=16100

沒有留言:

張貼留言