iplog rpmでインストール

04/02/13

1.「iplog-2.2.3-1.src.rpm」と「iplog.conf」と「iplog」と「iplog.sh」と「iplogrotate」を「/root/Down」に用意します。(「iplog.conf」は、「iplog」を「rpm」でインストールすると「/usr/doc/iplog-2.2.3/example-iplog.conf」として作成されます。が、「RedHat」用なので今回は使用しません。)

iplog.conf」の中身は、

/*
** $Id: example-iplog.conf,v 1.2 2000/12/31 18:40:40 odin Exp $
**
** Example iplog configuration file.
** Edit me and copy me to /etc/iplog.conf
**
** See iplog.conf(5) for details on syntax and a full description
** of available options.
*/

# Run as an unprivileged account with the login "iplog"
user iplog

# Run with group "nogroup"
group nogroup

# User "iplog" has write permission for the directory "/var/run/iplog"
pid-file /var/run/iplog/iplog.pid

# Log to /var/log/iplog
logfile /var/log/iplog

# Use the syslog(3) facility log_daemon.
facility log_daemon

# Use the syslog(3) priority (level) log_info.
priority log_info

# Log the IP address as well as the hostname of packets.
set log_ip true

# Do not log the destination of packets.
set log_dest false

# Ignore DNS traffic from nameservers in /etc/resolv.conf.
#set ignore_dns

# Listen on eth0 and eth1
interface eth0

#ログから除外
ignore icmp
ignore tcp dport 53
ignore tcp sport 53
ignore udp dport 53
ignore udp sport 53
ignore tcp dport 80
ignore tcp sport 80

iplog

#!/bin/sh
#
# iplog This start and stops the iplog utility
#
# chkconfig: 345 97 03
# description: iplog's capabilities include the ability to detect \
# TCP port scans, TCP null scans, FIN scans, UDP and \
# ICMP "smurf" attacks, bogus TCP flags (used by \
# scanners to detect the operating system in use), \
# TCP SYN scans, TCP "Xmas" scans, ICMP ping floods, \
# UDP scans, and IP fragment attacks.
#
# processname: /usr/sbin/iplog
# config: /etc/iplog.conf
# pidfile: /var/run/iplog.pid

PATH=/sbin:/bin:/usr/bin:/usr/sbin

# Source function library.
#RedHat用なのでコメント化して新しいパスを入れる
#. /etc/init.d/functions
. /etc/rc.d/init.d/functions

# Get config.
test -f /etc/sysconfig/network && . /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "yes" ] || exit 0

[ -x /usr/sbin/iplog ] || exit 1
[ -r /etc/iplog.conf ] || exit 1

RETVAL=0

start(){
echo -n "Starting iplog: "
daemon /usr/sbin/iplog
RETVAL=$?
echo
touch /var/lock/subsys/iplog
return $RETVAL
}

stop(){
echo -n "Stopping iplog: "
killproc iplog
RETVAL=$?
echo
rm -f /var/lock/subsys/iplog
return $RETVAL
}

reload(){
echo -n "Reloading configuration: "
killproc iplog -HUP
RETVAL=$?
echo
return $RETVAL
}

restart(){
stop
start
}

condrestart(){
[ -e /var/lock/subsys/iplog ] && restart
return 0
}


# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status iplog
;;
restart)
restart
;;
reload)
reload
;;
condrestart)
condrestart
;;
*)
echo "Usage: iplog {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac

exit $RETVAL

iplogrotate

/var/log/iplog {
missingok
create 0600 root root
weekly
rotate 6
postrotate
service iplog restart
endscript
}

iplog.sh

#!/bin/sh
iplog=iplog-2.2.3-1
iplogdir=iplog-2.2.3
#
rpm --rebuild ${iplog}.src.rpm
cd /root/rpm/RPMS/i386/
rpm -ivh ${iplog}.i386.rpm
#
cp /root/Down/iplog.conf /etc/iplog.conf
#
groupadd nogroup
adduser -g nogroup -d /dev/null -s /bin/false iplog
#次に iplog.pid 用のディレクトリを作る.
mkdir /var/run/iplog
chown iplog.nogroup /var/run/iplog
#
if [ -f /etc/rc.d/init.d/iplog ]
then
cd /etc/rc.d/init.d
mv iplog iplog.back
fi
cd /root/Down
cp /root/Donw/iplog /etc/rc.d/init.d/iplog
cp /root/Down/iplogrotate /etc/logrotate.d/iplogrotate
echo '"/var/log/iplog" 2004-1-9' > /var/lib/logrotate.status
service iplog start

2.以上のファイルを「/root/Down」に用意したら、ターミナルを立ち上げ

# cd /root/Down
# chmod 711 ./iplog.sh
# ./iplog.sh

と、入力するとインストールされます。

<Pre Next>

■目次

■予定

VineでPHPを使うには

PHPAのインストール

SSLのチューニング


■最近観た映画3

 


■ここがサブタイトル