Das Hostsystem
Debian Debian 11.5 Bullseye amd64
Automatisierte Installation
Code: Alles auswählen
cd ~;
wget https://4noobs.de/download/file.php?id=252 -O setup_isp_debian.sh;
chmod u+x setup_isp_debian.sh;
./setup_isp_debian.sh
Manuelle Installation
Repo von Debian Buster
Code: Alles auswählen
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb-src http://deb.debian.org/debian buster-updates main contrib non-free
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb-src http://deb.debian.org/debian buster-backports main contrib non-free
Debian Server installieren (Server oder Desktop ist egal)
Wichtig: wer per SSH seinen Server aufsetzt, der sollte alle Schritte in einer Bash ausführen welche in einer Screen Session gestartet wurde. Nur so führt der Server alle Schritte bis zum Ende aus auch wenn die SSH Session unterbrochen wurde.
Code: Alles auswählen
sudo apt update && sudo apt -y install screen
Code: Alles auswählen
sudo screen bash
Der Hostname muss identisch (gleichnamig) sein zur verwendete Domain oder Subdomain die auf die Server IP zeigt. Die Server IP muss in der Domainverwaltung der Nameserver Einstellungen hinterlegt sein.
Beispiel:
Code: Alles auswählen
sudo nano /etc/hosts
Code: Alles auswählen
127.0.0.1 localhost
127.0.1.1 cloud.4noobs.de cloud
# The following lines are desirable for IPv6 capable hosts
#::1 localhost ip6-localhost ip6-loopback
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
Code: Alles auswählen
sudo nano /etc/hostname
Code: Alles auswählen
cloud
Server anschließend neu starten damit der neue Hostname übernommen wird.
Hinweis: Wenn die IP des Servers nicht in den Nameserver Einstellungen der Domain hinterlegt ist, kann der Hostname nicht aufgelöst werden. Dadurch lässt sich der Mailserver Dienst amavisd-new nicht konfigurieren.
Bei Heimservern, welche hinter einem DSL Anschluss mit öffentlicher IPv4 Adresse hängen, muss statt der Server IP die öffentliche IPv4 Adresse des DSL Anschlusses in den Nameserver Einstellungen der verwendeten Domain hinterlegt werden. Wer keine feste IP Adresse hat kann stattdessen auch einen CNAME Eintrag einen DynDNS Dienstes in den Nameserver Einstellungen hinterlegen. Zusätzlich muss ein Portforwarding im Router auf die lokale IP des Servers eingerichtet werden.
https://4noobs.de/viewtopic.php?f=4&t=1 ... rcona#p153
System bereinigen und für Groupware Installation vorbereiten
Code: Alles auswählen
sudo service sendmail stop; update-rc.d -f sendmail remove
Paketquellen aktualisieren
Code: Alles auswählen
sudo apt update && sudo apt -y full-upgrade
Code: Alles auswählen
sudo apt -y install ssh vim atop htop btop rsync mc net-tools openssh-server ntp postfix postfix-mysql postfix-doc mariadb-client mariadb-server openssl sudo apt-transport-https lsb-release ca-certificates curl
Code: Alles auswählen
mkdir -p /etc/systemd/system/mysql.service.d/
touch /etc/systemd/system/mysql.service.d/limits.conf;
echo '[Service]' > /etc/systemd/system/mysql.service.d/limits.conf;
echo 'LimitNOFILE=infinity' >> /etc/systemd/system/mysql.service.d/limits.conf
Code: Alles auswählen
apt install -y apache2 apache2-doc apache2-utils libapache2-mod-php php7.3 php7.3-common php7.3-gd php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear mcrypt imagemagick libruby libapache2-mod-python php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl memcached php-memcache php-imagick php7.3-zip php7.3-mbstring memcached libapache2-mod-passenger php7.3-soap php7.3-fpm php7.3-opcache php-apcu libapache2-reload-perl patch certbot;
Code: Alles auswählen
a2enmod suexec rewrite ssl actions include dav_fs dav auth_digest cgi headers actions proxy_fcgi alias;
Code: Alles auswählen
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
Code: Alles auswählen
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
Code: Alles auswählen
sudo apt-get update && sudo apt -y install php-mysql php7.3 php7.3-common php7.3-gd php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi php7.3-curl php7.3-intl php7.3-pspell php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-opcache php7.3-fpm php7.3-raphf php7.3-propro php7.3-zip php7.3-mbstring php7.3-bcmath php7.3-gmp php7.3-imagick php7.4 php7.4-common php7.4-gd php7.4-mysql php7.4-imap php7.4-cli php7.4-cgi php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-opcache php7.4-fpm php7.4-raphf php7.4-propro php7.4-zip php7.4-mbstring php7.4-bcmath php7.4-gmp php7.4-imagick php8.0 php8.0-common php8.0-gd php8.0-mysql php8.0-imap php8.0-cli php8.0-cgi php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xmlrpc php8.0-xsl php8.0-opcache php8.0-fpm php8.0-raphf php8.0-zip php8.0-mbstring php8.0-bcmath php8.0-gmp php8.0-imagick php8.1 php8.1-common php8.1-gd php8.1-mysql php8.1-imap php8.1-cli php8.1-cgi php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xmlrpc php8.1-xsl php8.1-opcache php8.1-fpm php8.1-raphf php8.1-zip php8.1-mbstring php8.1-bcmath php8.1-gmp php8.1-imagick php-apcu php-pear imagemagick libruby redis-server php-memcache php-imagick php-gettext php-bcmath php-gmp php-imagick openssl easy-rsa openvpn aptitude libreoffice clamav libnet-ldap-perl libconvert-asn1-perl ntp ntpdate bind9 dnsutils haveged fail2ban ufw javascript-common libjs-jquery-mousewheel php-net-sieve tinymce libnet-rblclient-perl libparse-syslog-perl php-mbstring php-curl software-properties-common
Code: Alles auswählen
update-alternatives --set php /usr/bin/php7.3;
Code: Alles auswählen
touch /etc/apache2/conf-available/httpoxy.conf;
echo '<IfModule mod_headers.c>' > /etc/apache2/conf-available/httpoxy.conf;
echo ' RequestHeader unset Proxy early' >> /etc/apache2/conf-available/httpoxy.conf;
echo '</IfModule>' >> /etc/apache2/conf-available/httpoxy.conf;
a2enconf httpoxy;
systemctl restart apache2;
Code: Alles auswählen
apt -y install pure-ftpd-common pure-ftpd-mysql;
openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048;
sed -i 's/^VIRTUALCHROOT=false/VIRTUALCHROOT=true/g' /etc/default/pure-ftpd-common;
echo 1 > /etc/pure-ftpd/conf/TLS;
mkdir -p /etc/ssl/private/;
openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem -subj "/C=DE/ST=Country/L=City/O=Company/CN=domain.tld";
chmod 600 /etc/ssl/private/pure-ftpd.pem;
systemctl restart pure-ftpd-mysql;
Installieren
Code: Alles auswählen
sudo apt -y install amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full unrar lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl postgrey;
Code: Alles auswählen
sudo service spamassassin stop
update-rc.d -f spamassassin remove
Code: Alles auswählen
sed -i 's/#smtp inet n - y - 1 postscreen/465 inet n - y - - smtpd/g' /etc/postfix/master.cf;
sed -i 's/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/g' /etc/postfix/master.cf;
sed -i 's/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/g' /etc/postfix/master.cf;
sed -i 's/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes/g' /etc/postfix/master.cf;
sed -i 's/# -o smtpd_client_restrictions=$mua_client_restrictions/ -o smtpd_client_restrictions=permit_sasl_authenticated,reject/g' /etc/postfix/master.cf;
sed -i 's/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/g' /etc/postfix/master.cf;
sed -i 's/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/g' /etc/postfix/master.cf;
sed -i 's/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes/g' /etc/postfix/master.cf;
sed -i 's/# -o smtpd_client_restrictions=$mua_client_restrictions/ -o smtpd_client_restrictions=permit_sasl_authenticated,reject/g' /etc/postfix/master.cf;
systemctl restart postfix.service;
Code: Alles auswählen
sed -i 's/^AllowSupplementaryGroups.*//g' /etc/clamav/clamd.conf;
echo 'AllowSupplementaryGroups true' >> /etc/clamav/clamd.conf;
Code: Alles auswählen
sudo freshclam
sudo service clamav-daemon start
ISPConfig3 installieren
Code: Alles auswählen
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xzf ISPConfig-3-stable.tar.gz
cd ispconfig3_install
cd install
php install.php
Hinweis: für ein Update von ISPConfig3 den gleichen Weg gehen, aber statt "php install.php" muss "php update.php" ausgeführt werden!
Nach der Installation von ISPConfig3 Rechner neustarten und über das
Webinterfache https://ipdesservers:8080 aufrufen und mit
Benutzer: admin
Passwort: "das bei der Installation vergebene Passwort"
einloggen.