| Line 1... |
Line 1... |
| 1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
| 2 |
# $Id: alcasar.sh 1534 2014-12-21 22:11:15Z richard $
|
2 |
# $Id: alcasar.sh 1536 2014-12-21 23:11:16Z richard $
|
| 3 |
|
3 |
|
| 4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
| 5 |
|
5 |
|
| 6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
| 7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
| Line 653... |
Line 653... |
| 653 |
echo "ServerTokens Prod" >> /etc/httpd/conf/httpd.conf
|
653 |
echo "ServerTokens Prod" >> /etc/httpd/conf/httpd.conf
|
| 654 |
echo "ServerSignature Off" >> /etc/httpd/conf/httpd.conf
|
654 |
echo "ServerSignature Off" >> /etc/httpd/conf/httpd.conf
|
| 655 |
[ -e /etc/httpd/conf/modules.d/00_base.conf.default ] || cp /etc/httpd/conf/modules.d/00_base.conf /etc/httpd/conf/modules.d/00_base.conf.default
|
655 |
[ -e /etc/httpd/conf/modules.d/00_base.conf.default ] || cp /etc/httpd/conf/modules.d/00_base.conf /etc/httpd/conf/modules.d/00_base.conf.default
|
| 656 |
$SED "s?^LoadModule authn_anon_module.*?#LoadModule authn_anon_module modules/mod_authn_anon.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
656 |
$SED "s?^LoadModule authn_anon_module.*?#LoadModule authn_anon_module modules/mod_authn_anon.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
| 657 |
$SED "s?^LoadModule status_module.*?#LoadModule status_module modules/mod_status.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
657 |
$SED "s?^LoadModule status_module.*?#LoadModule status_module modules/mod_status.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
| 658 |
$SED "s?^LoadModule autoindex_module.*?#LoadModule autoindex_module modules/mod_autoindex.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
- |
|
| 659 |
$SED "s?^LoadModule info_module.*?#LoadModule info_module modules/mod_info.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
658 |
$SED "s?^LoadModule info_module.*?#LoadModule info_module modules/mod_info.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
| 660 |
$SED "s?^LoadModule imagemap_module.*?#LoadModule imagemap_module modules/mod_imagemap.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
659 |
$SED "s?^LoadModule imagemap_module.*?#LoadModule imagemap_module modules/mod_imagemap.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
| 661 |
$SED "s?^LoadModule rewrite_module.*?#LoadModule rewrite_module modules/mod_rewrite.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
660 |
$SED "s?^LoadModule rewrite_module.*?#LoadModule rewrite_module modules/mod_rewrite.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
| 662 |
$SED "s?^LoadModule speling_module.*?#LoadModule speling_module modules/mod_speling.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
661 |
$SED "s?^LoadModule speling_module.*?#LoadModule speling_module modules/mod_speling.so?g" /etc/httpd/conf/modules.d/00_base.conf
|
| 663 |
[ -e /etc/httpd/conf/conf.d/ssl.conf.default ] || cp /etc/httpd/conf/conf.d/ssl.conf /etc/httpd/conf/conf.d/ssl.conf.default
|
662 |
[ -e /etc/httpd/conf/conf.d/ssl.conf.default ] || cp /etc/httpd/conf/conf.d/ssl.conf /etc/httpd/conf/conf.d/ssl.conf.default
|
| Line 1382... |
Line 1381... |
| 1382 |
{
|
1381 |
{
|
| 1383 |
tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
|
1382 |
tar xzf ./conf/nfsen/nfsen-1.3.6p1.tar.gz -C /tmp/
|
| 1384 |
# Add PortTracker plugin
|
1383 |
# Add PortTracker plugin
|
| 1385 |
for i in /var/www/html/acc/manager/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
|
1384 |
for i in /var/www/html/acc/manager/nfsen/plugins /var/log/netflow/porttracker /usr/share/nfsen/plugins
|
| 1386 |
do
|
1385 |
do
|
| 1387 |
[ ! -d $i ] && mkdir $i && chown -R apache:apache $i
|
1386 |
[ ! -d $i ] && mkdir -p $i && chown -R apache:apache $i
|
| 1388 |
done
|
1387 |
done
|
| 1389 |
$SED "s?^my \$PORTSDBDIR =.*?my \$PORTSDBDIR = \"/var/log/netflow/porttracker\";?g" /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm
|
1388 |
$SED "s?^my \$PORTSDBDIR =.*?my \$PORTSDBDIR = \"/var/log/netflow/porttracker\";?g" /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm
|
| 1390 |
# use of our conf file and init unit
|
1389 |
# use of our conf file and init unit
|
| 1391 |
cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
|
1390 |
cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/
|
| 1392 |
# Installation of nfsen
|
1391 |
# Installation of nfsen
|
| Line 1397... |
Line 1396... |
| 1397 |
# Create RRD DB for porttracker (only in it still doesn't exist)
|
1396 |
# Create RRD DB for porttracker (only in it still doesn't exist)
|
| 1398 |
cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
|
1397 |
cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.pm /usr/share/nfsen/plugins/
|
| 1399 |
cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.php /var/www/html/acc/manager/nfsen/plugins/
|
1398 |
cp /tmp/nfsen-1.3.6p1/contrib/PortTracker/PortTracker.php /var/www/html/acc/manager/nfsen/plugins/
|
| 1400 |
if [ "$(ls -A "/var/log/netflow/porttracker" 2>&1)" = "" ]; then sudo -u apache nftrack -I -d /var/log/netflow/porttracker; else echo "RRD DB already exists"; fi
|
1399 |
if [ "$(ls -A "/var/log/netflow/porttracker" 2>&1)" = "" ]; then sudo -u apache nftrack -I -d /var/log/netflow/porttracker; else echo "RRD DB already exists"; fi
|
| 1401 |
chmod -R 770 /var/log/netflow/porttracker
|
1400 |
chmod -R 770 /var/log/netflow/porttracker
|
| 1402 |
# Apache conf file
|
- |
|
| 1403 |
cat << EOF > /etc/httpd/conf/conf.d/nfsen.conf
|
- |
|
| 1404 |
Alias /nfsen /var/www/html/acc/manager/nfsen
|
- |
|
| 1405 |
<Directory /var/www/html/acc/manager/nfsen/>
|
- |
|
| 1406 |
DirectoryIndex nfsen.php
|
- |
|
| 1407 |
Options -Indexes
|
- |
|
| 1408 |
AllowOverride all
|
- |
|
| 1409 |
order allow,deny
|
- |
|
| 1410 |
allow from all
|
- |
|
| 1411 |
AddType application/x-httpd-php .php
|
- |
|
| 1412 |
php_flag magic_quotes_gpc on
|
- |
|
| 1413 |
php_flag track_vars on
|
- |
|
| 1414 |
</Directory>
|
- |
|
| 1415 |
EOF
|
- |
|
| 1416 |
# nfsen unit for systemd
|
1401 |
# nfsen unit for systemd
|
| 1417 |
cat << EOF > /lib/systemd/system/nfsen.service
|
1402 |
cat << EOF > /lib/systemd/system/nfsen.service
|
| 1418 |
# This file is part of systemd.
|
1403 |
# This file is part of systemd.
|
| 1419 |
#
|
1404 |
#
|
| 1420 |
# systemd is free software; you can redistribute it and/or modify it
|
1405 |
# systemd is free software; you can redistribute it and/or modify it
|
| Line 1450... |
Line 1435... |
| 1450 |
cp $DIR_CONF/nfsen/SURFmap_v3.3.1.tar.gz /tmp/
|
1435 |
cp $DIR_CONF/nfsen/SURFmap_v3.3.1.tar.gz /tmp/
|
| 1451 |
cp $DIR_CONF/nfsen/GeoLiteCity* /tmp/
|
1436 |
cp $DIR_CONF/nfsen/GeoLiteCity* /tmp/
|
| 1452 |
tar xzf /tmp/SURFmap_v3.3.1.tar.gz -C /tmp/
|
1437 |
tar xzf /tmp/SURFmap_v3.3.1.tar.gz -C /tmp/
|
| 1453 |
cd /tmp/
|
1438 |
cd /tmp/
|
| 1454 |
/usr/bin/sh SURFmap/install.sh
|
1439 |
/usr/bin/sh SURFmap/install.sh
|
| - |
|
1440 |
chown -R apache:apache /var/www/html/acc/manager/nfsen
|
| 1455 |
# clear the installation
|
1441 |
# clear the installation
|
| 1456 |
cd $DirTmp
|
1442 |
cd $DirTmp
|
| 1457 |
rm -rf /tmp/nfsen*
|
1443 |
rm -rf /tmp/nfsen*
|
| 1458 |
rm -rf /tmp/SURFmap*
|
1444 |
rm -rf /tmp/SURFmap*
|
| 1459 |
} # End of nfsen ()
|
1445 |
} # End of nfsen ()
|