Freitag, 31. Oktober 2008

Versionsinfo abschalten apache & php

/etc/apache2/apache2.conf


# ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
LogLevel notice


Options -FollowSymLinks -Includes -Indexes -MultiViews
#
#
#



/etc/apache2/sites-available/default
# ErrorLog
# CustomLog


/etc/apache2/conf.d/security


ServerTokens Prod
ServerSignature Off
TraceEnable Off



/usr/include/apache2/ap_release.h
#define AP_SERVER_BASEVENDOR "Restricted server"
#define AP_SERVER_BASEPRODUCT "Secure Web Server"




---------


httpd.conf

ServerTokens Prod
ServerSignature Off



php.ini


expose_php = Off
display_errors=Off
register_globals = Off


bei SuSE mit apache v2.xx und php5


/etc/php5/apache2/php.ini

expose_php = Off
display_errors=Off
register_globals = Off



/etc/sysconfig/apache2

APACHE_SERVERTOKENS="Prod"
APACHE_SERVERSIGNATURE="off"

Montag, 1. September 2008

Leerzeilen entfehrenen mit grep

grep -v "^$" /path/to/file

z.B. grep -v "#" /usr/local/nagios/etc/nagios.cfg | grep -v "^$"

Freitag, 27. Juni 2008

Dateien in jpg-Bildern verstecken

cat bild1.jpg archiv.rar > bild2.jpg

# file bild2.jpg
bild2.jpg: JPEG image data, JFIF standard 1.01

# unrar e bild2.jpg

Extracting from bild2.jpg

Mittwoch, 13. Februar 2008

CFG Files ohne # Ausgeben

grep -v "#" /path/file

z.B. grep -v "#" /etc/nagios/nagios.cfg

Dienstag, 5. Februar 2008

Verzeichnisschutz Apache

Alle verzeichnisse ab /html/ nicht mehr Indexieren


Options -Indexes



Indexierung in diesem einem Verz. /info zulassen


Options +Indexes

Montag, 3. Dezember 2007

Teaming / bonding

Beispiel unter Fedora Core Linux

Doku:

/usr/share/doc/kernel-doc-x.x.x/Documentation/networking/bonding.txt


/etc//modprobe.conf


alias bond0 bonding
alias eth0 pcnet32
alias eth1 pcnet32
options bond0 mode=0 miimon=100 use_carrier=1



/etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=172.16.132.135
NETMASK=255.255.255.0
GATEWAY=172.16.132.254
USERCTL=no
BOOTPROTO=none
ONBOOT=yes


/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:C5:30:A5
MASTER=bond0
SLAVE=yes
ONBOOT=yes


/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
ONBOOT=yes

Freitag, 23. November 2007

dd via SSH (clone o. to file)

Clone:
--------
Qulle: wks & CLONE-PC via Knoppix CD/DVD booten.
sshd starten

wks> dd if=/dev/hda | ssh root@CLONE-PC dd of=/dev/hda


Sichern:
----------

wks> dd if=/dev/hda | ssh root@CLONE-PC dd of=/var/tmp/file.img


Restore:
----------

CLONE-PC> dd if=/var/tmp/file.img | ssh root@wks dd of=/dev/hda



Wenn man auf dem CLONE (mit LiveCD gebootet) keinen SSHD hat
und ein laufendes System clonen will:


CLONE> cd /path/to/root

CLONE> ssh user@server tar cf - /home | tar xpvf –