Content
Einige von Euch kennen sicherlich die Probleme mit den zwei mini_httpd - Varianten. Vor allem sollte man nicht von einer Version auf die andere umsteigen, da das zu unschönen Komplikationen führen kann.
Nun hat die Version 1.9.4 leider von Haus aus keine Logging-Funktion, so dass man brute_force_blocking mit mini_httpd 1.9.4 zusammen nicht einsetzen kann. Dieses Howto beschreibt, wie man mit einfachen Schritten mini_httpd 1.9.4 um eine Logging-Funktion erweitert, so dass es zusammen mit brute_force_blocking eingesetzt werden kann.
1. Erweitern von mini_http um Logging-Möglichkeiten:
1.1 Eintragen des Logfile-Parameters in die Config von mini_httpd:
Dazu öffnet man ganz gewöhnlich die Konfigurationsdatei vom Menü heraus und ergänzt die Datei um
- - - - - - - - - - -
MINI_HTTPD_LOGFILE='/var/log/mini_httpd.log' # none for no logging
- - - - - - - - - - -
Dies ist wichtig, da brute_force_blocking diesen Parameter abfrag und auswertet.
1.2 Eintragen des Parameters in die Startdatei von mini_httpd:
Mittels
- - - - - - - - - - -
joe /sbin/init.d/mini_httpd
- - - - - - - - - - -
in der Konsole öffnet man die eigentliche Startdatei. Vorher sollte man besser eine SICHERHEITSKOPIE erstellt haben!
Den Abschnitt
- - - - - - - - - - -
start) if [ "$MINI_HTTPD_START" = 'yes' ]
then
mini_httpd_opts=""
echo "Starting MINI_HTTPD-Status-Webserver ..."
mini_httpd_opts="$mini_httpd_opts -p $MINI_HTTPD_PORT"
if [ "$MINI_HTTPD_SSL" = 'yes' ]
then
mini_httpd_opts="$mini_httpd_opts -S -E /etc/httpd/mini_httpd.pem"
fi
# executable .conf-file directory opts
/usr/bin/mini_httpd -C /etc/mini_httpd_base.conf -d /usr/local/htdocs $mini_httpd_opts 2>/dev/null
sleep 3
echo
/etc/init.d/mini_httpd status
fi
;;
- - - - - - - - - - -
wird mittels copy+paste ersetzt durch:
- - - - - - - - - - -
start) if [ "$MINI_HTTPD_START" = 'yes' ]
then
mini_httpd_opts=""
echo "Starting MINI_HTTPD-Status-Webserver ..."
if [ ! "$MINI_HTTPD_LOGFILE" = 'none' ]
then
mini_httpd_opts="$mini_httpd_opts -l $MINI_HTTPD_LOGFILE"
fi
mini_httpd_opts="$mini_httpd_opts -p $MINI_HTTPD_PORT"
if [ "$MINI_HTTPD_SSL" = 'yes' ]
then
mini_httpd_opts="$mini_httpd_opts -S -E /etc/httpd/mini_httpd.pem"
fi
# executable .conf-file directory opts
/usr/bin/mini_httpd -C /etc/mini_httpd_base.conf -d /usr/local/htdocs $mini_httpd_opts 2>/dev/null
sleep 3
echo
/etc/init.d/mini_httpd status
fi
;;
- - - - - - - - - - -
und natürlich abspeichern. Nun kann mini_httpd automatisch erkennen, ob geloggt werden soll oder nicht. Fertig ist das "aufgebohrte" mini_httpd!!!
Noch schnell mittels dem Menü den mini_httpd stoppen und wieder starten. Wenn alles richtig war meldet er sich, dass er nun läuft.
Zur Kontrolle sollte man ein paar Seiten des mini_httpd per Browser aufrufen, und mittels
- - - - - - - - - - -
joe /var/log/mini_httpd.log
- - - - - - - - - - -
schauen, ob etwas in die Datei eingetragen wurde.
2. brute_force_blocking auf den mini_httpd ansetzen
Das geht nun wie gewohnt über das Menü. Einfach in die Konfigurationsdatei gehen und
- - - - - - - - - - -
BRUTE_FORCE_BLOCKING_MINI_HTTP='no' # monitor mini_http_server yes or no
- - - - - - - - - - -
auf 'yes' setzen. Das war's!
Für eventuelle Schäden, Datenverlust etc. pp. übernehme ich *keine* Haftung! Ich habe eigentlich selber kaum Ahnung von Linux!