Server Setup · 3 min read · Sep 29, 2025

Der perfekte SpamSnake - Ubuntu Jaunty Jackalope - Seite 2

10. Apache2

apt-get install apache2 apache2-suexec apache2-doc apache2-mpm-prefork apache2-utils libexpat1

Als nächstes installieren wir PHP5 als Apache-Modul:

aptitude install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Als nächstes bearbeiten wir /etc/apache2/mods-available/dir.conf und ändern die DirectoryIndex-Zeile:



          #DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
          DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

Jetzt müssen wir einige Apache-Module aktivieren (rewrite, suexec, include)

a2enmod rewrite   
a2enmod suexec   
a2enmod include

Starte Apache neu:

/etc/init.d/apache2 restart

11. Postfix und MySQL

Installiere die Pakete:

apt-get install postfix postfix-mysql postfix-doc mysql-server mysql-client procmail

MySQL:

Sie werden aufgefordert, ein Passwort für den MySQL-Root-Benutzer anzugeben - dieses Passwort gilt für den Benutzer root@localhost sowie [email protected], sodass wir später kein MySQL-Root-Passwort manuell angeben müssen:

Neues Passwort für den MySQL “root”-Benutzer: <– yourrootsqlpassword
Wiederhole das Passwort für den MySQL “root”-Benutzer: <– yourrootsqlpassword

Postfix:

Sie werden zwei Fragen gestellt. Antworten Sie wie folgt:

Allgemeiner Typ der Mail-Konfiguration: <– Internet Site
System-Mail-Name: <– server1.example.com

Wir möchten, dass MySQL auf allen Schnittstellen hört, nicht nur auf localhost, daher bearbeiten wir /etc/mysql/my.cnf und kommentieren die Zeile bind-address = 127.0.0.1 aus:

[...]
# Statt skip-networking ist es jetzt Standard, nur auf
# localhost zu hören, was kompatibler ist und nicht weniger sicher.
#bind-address           = 127.0.0.1
[...]

Dann starten wir MySQL neu:

/etc/init.d/mysql restart

Überprüfen Sie jetzt, ob das Networking aktiviert ist. Führen Sie aus

netstat -tap | grep mysql

Die Ausgabe sollte folgendermaßen aussehen:

tcp        0      0 *:mysql                 *:*                     LISTEN      4318/mysqld

Stoppen Sie Postfix:

postfix stop

Wir möchten Postfix mit Folgendem bearbeiten:

Bearbeiten Sie master.cf:

Wir müssen zwei Elemente unter dem Pickup-Service-Typ hinzufügen. Der Pickup-Service “holt” lokale E-Mails (lokal bedeutet “auf dieser Maschine”) und liefert sie aus. Dies ist eine Möglichkeit, die Inhaltsfilterung für E-Mails, die von dieser Maschine generiert werden, zu umgehen.

Es sollte so aussehen, wenn Sie fertig sind:

pickup    fifo  n       -       -       60      1       pickup
         -o content_filter=
         -o receive_override_options=no_header_body_checks

Bearbeiten Sie main.cf:

postconf -e "alias_maps = hash:/etc/aliases"  
newaliases  
postconf -e "myorigin = example.com"  
postconf -e "myhostname = server1.example.com"  
postconf -e "mynetworks = 127.0.0.0/8, 192.168.0.0/24"  
postconf -e "message_size_limit = 10485760"  
postconf -e "local_transport = error:No local mail delivery"  
postconf -e "mydestination = "  
postconf -e "local_recipient_maps = "  
postconf -e "virtual_alias_maps = hash:/etc/postfix/virtual"

Erstellen Sie /etc/postfix/virtual und fügen Sie Folgendes hinzu:

postmaster [email protected]
abuse [email protected]
root [email protected]

Fortfahren:

postmap /etc/postfix/virtual  
postconf -e "relay_recipient_maps = hash:/etc/postfix/relay_recipients"

Erstellen Sie /etc/postfix/relay_recipients und fügen Sie Folgendes hinzu:

@example.com OK
@example2.com OK

Fortfahren:

postmap /etc/postfix/relay_recipients  
postconf -e "transport_maps = hash:/etc/postfix/transport"

Erstellen Sie /etc/postfix/transport und fügen Sie Folgendes hinzu:

example.com smtp:[192.168.0.x]
example2.com smtp:[192.168.0.x]

Fortfahren:

postmap /etc/postfix/transport  
postconf -e "relay_domains = hash:/etc/postfix/relay_domains"

Erstellen Sie /etc/postfix/relay_domains und fügen Sie Folgendes hinzu:

example.com OK
example2.com OK

Fortfahren:

postmap /etc/postfix/relay_domains  
postconf -e "smtpd_helo_required = yes"  
postconf -e "smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain, permit"  
postconf -e "smtpd_recipient_restrictions = reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain, permit_mynetworks, reject_unauth_destination, reject_unauth_pipelining, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, permit"  
postconf -e "smtpd_data_restrictions = reject_unauth_pipelining"

Lassen Sie uns einen letzten Blick auf die Postfix-Konfiguration werfen:

less /etc/postfix/main.cf

Überprüfen Sie den Inhalt der Datei auf Fehler und reparieren Sie sie bei Bedarf. Starten Sie Postfix:

postfix start

Überprüfen Sie, ob Postfix antwortet:

telnet 127.0.0.1 25

Sie sollten sehen:

220 [yourFQDNhere] ESMTP Postfix (Ubuntu)

12. MailScanner Razor Pyzor DCC Clamav Installation

apt-get install mailscanner razor pyzor clamav-daemon

Lassen Sie uns mit MailScanner beginnen. Der MailScanner, der gerade aus den Repositories installiert wurde, ist eine sehr alte Version, also werden wir ihn jetzt entfernen und das MailScanner-Paket aus dem Quellcode installieren. Das Obige dient nur zur Installation der Abhängigkeiten.

apt-get remove mailscanner

Laden Sie http://www.mailscanner.info/files/4/tar/MailScanner-install-4.75.11-1.tar.gz nach /usr/src/mailscanner/ herunter und führen Sie aus:

tar xvfz MailScanner-install-4.75.11-1.tar.gz  
cd MailScanner-install-4.75.11  
./install.sh

Deaktivieren Sie den Standard-MailScanner:

mv /etc/MailScanner /etc/MailScanner.dist
Share: X/Twitter LinkedIn

Erhalte neue Beiträge in deinem Posteingang.

Kein Spam. Jederzeit abmelden.