Arpwatch ?? Debian Jessie

????????? ???????????
vim /etc/apt/sources.list:

deb http://ftp.ua.debian.org/debian/ jessie main


aptitude update
aptitude -y install arpwatch libdbi-perl libdatetime-perl apache2 apache2-utils fcgiwrap libapache2-mod-fcgid iptables-persistent

??????????? ?????? arpwatch ?? ???????????? ??????? ?????????
vim /etc/arpwatch.conf:

eth0 -a -m admin@example.com

invoke-rc.d arpwatch restart

??????????? ??? ????????? ? arpwatch (http://sources.homelink.ru/arpwatch/arpwatch-rus.html)

mkdir /etc/arpwatch
wget http://sources.homelink.ru/arpwatch/arpwatch-homelink-20100228.tar.gz
tar xzf arpwatch-homelink-20100228.tar.gz -C /etc/arpwatch

??????? ???? ??????
mysql -u root -p
create database arpwatch;
use arpwatch;
source /etc/arpwatch/arpwatch.sql
grant insert on arpwatch.arpwatch to arpwatch2sql@localhost identified by 'arpwatchdbpass';
grant select on arpwatch.arpwatch to arpwatch2cgi@localhost identified by 'arpwatchdbpass';
flush privileges;
quit;

??????? ?????? ?? ???? ??????
mysql_config_editor set --login-path=arpwatch --host=localhost --user=arpwatch2sql --password

vim /etc/crontab:

*/5 * * * * root /etc/arpwatch/arpwatch2sql | mysql --login-path=arpwatch arpwatch

mkdir /var/www/arpwatch
cp /etc/arpwatch/{Webutils.pm,arpwatch.cgi,arpwatch-topstats.cgi} /var/www/arpwatch/
chown -R www-data:www-data /var/www/arpwatch

vim /var/www/arpwatch/Webutils.pm:

sub webutils_utminit(;$)
{
        my $dbh = DBI->connect("DBI:mysql:database=arpwatch:host=localhost",
                                "arpwatch2cgi", "arpwatchdbpass")
                or die "Cannot connect to database ".$DBI::errstr."\n";
        $dbh;
}

vim /etc/apache2/conf-enabled/arpwatch.conf:

Alias /arpwatch "/var/www/arpwatch/"
<Directory "/var/www/arpwatch/">
    Options ExecCGI
    DirectoryIndex arpwatch.cgi
    AllowOverride None
    AuthType Digest
    AuthName "arpwatch"
    AuthUserFile "/etc/arpwatch/.htpasswd"
    require user valid-user
</Directory>

a2enmod auth_digest
htdigest -c /etc/arpwatch/.htpasswd arpwatch admin

??? ??????????? ?????????? ????????????? ???? «-c» ?? ?????
chgrp www-data /etc/arpwatch/.htpasswd
invoke-rc.d apache2 reload

??? ????????? ????? ???????? ?? http://example.com/arpwatch

????????? ???? ??? apache
iptables -I INPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I INPUT 2 -s 192.168.0.0/24 -d 192.168.0.1 -i eth0 -p tcp -m state --state NEW --dport 80 -j ACCEPT
invoke-rc.d netfilter-persistent save

Arpwatch ?? Debian Jessie: 4 комментария

  1. ????????????.
    ? ??? ?? ???? ?????? ???????????, ????? ????? ? ??????, ????? ???? ?????? ????? ???????? ?????? ?? ???????????.
    ??? ?????? ?? ????? ??????.

  2. ???????????????? ??? 5, ??? ????? ???????, ???????? ?????????????? ?????? ????????, ????? ????? ????? ??????? ?? ???????, ?? ???? ?????? ?? ???? ????????.
    ???????? ??????????.

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *