ISPConfig/Installation
topic - Kurzbeschreibung
Beschreibung
- Automatisierte ISPConfig 3-Installation
Diese Anleitung führt Sie durch die Installation Ihres eigenen ISPConfig 3 Einzelservers mit Hilfe des ISPConfig Auto-Installers. Dieser Installer folgt den alten Perfect Server Anleitungen, ist aber modularer und einfacher zu befolgen. Wenn Sie stattdessen ein Multiserver-Setup mit dedizierten Servern für jeden Dienst einrichten möchten, lesen Sie the Perfect Multiserver guide.
Diese Anleitung funktioniert sowohl für Debian 10, Debian 11, Ubuntu 20.04 und Ubuntu 22.04. Sie unterstützt derzeit nur die x86_64 (auch bekannt als AMD64) CPU-Architektur, während ARM nicht unterstützt wird. Wir werden den Hostnamen server1.example.com verwenden. Ersetzen Sie ihn, wenn nötig. Die Anleitung setzt ein frisch installiertes und leeres Basis-Betriebssystem voraus. Versuchen Sie nicht, sie auf einem System anzuwenden, auf dem Sie bereits andere Dienste konfiguriert haben.
- Voraussetzungen
- Betriebssystem: Debian 10, Debian 11, Ubuntu 20.04, oder Ubuntu 22.04.
- Intel oder AMD 64-Bit CPU Architektur (x86_64, auch bekannt als AMD64). ARM-CPUs werden zur Zeit nicht unterstützt.
- Das System muss einen Internetzugang haben, um Software mit apt herunterladen und installieren zu können.
- Beginnen Sie mit einer sauberen und leeren Basisinstallation des Betriebssystems.
Einloggen auf dem Server
Melden Sie sich als root an oder führen Sie
su -
unter Debian aus, um root-Benutzer auf Ihrem Server zu werden, bevor Sie fortfahren. WICHTIG: Sie müssen 'su -' und nicht nur 'su' verwenden, sonst wird Ihre PATH-Variable von Debian falsch gesetzt.
Unter Ubuntu verwenden Sie den Befehl:
sudo -s
um root-Benutzer zu werden.
Konfigurieren Sie den Hostnamen und die Hosts
Der Hostname Ihres Servers sollte eine Subdomain wie "server1.example.com" sein. Verwenden Sie keinen Domänennamen ohne einen Subdomänen-Teil wie "example.com" als Hostnamen, da dies später zu Problemen bei der Einrichtung führen kann. Als erstes sollten Sie den Hostnamen in /etc/hosts überprüfen und ihn gegebenenfalls ändern. Die Zeile sollte lauten: "IP-Adresse - Leerzeichen - vollständiger Hostname inkl. Domain - Leerzeichen - Subdomain-Teil". Für unseren Hostnamen server1.example.com sollte die Datei wie folgt aussehen (einige Zeilen können unterschiedlich sein, da sie von Hosting-Anbieter zu Hosting-Anbieter unterschiedlich sein können):
nano /etc/hosts 127.0.0.1 localhost.localdomain localhost # Diese Zeile sollte auf den richtigen Servernamen geändert werden: 127.0.1.1 server1.example.com server1 # Die folgenden Zeilen sind für IPv6-fähige Hosts wünschenswert ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters
Bearbeiten Sie dann die Datei /etc/hostname:
nano /etc/hostname
Sie soll nur den Teil mit der Subdomain enthalten, in unserem Fall:
server1
Schließlich starten Sie den Server neu, um die Änderung zu übernehmen:
systemctl reboot
Melden Sie sich erneut an und überprüfen Sie mit diesen Befehlen, ob der Hostname jetzt korrekt ist:
hostname hostname -f
Die Ausgabe sollte wie folgt aussehen:
root@server1:~$ hostname Server1 root@server1:~$ hostname -f server1.beispiel.com
Sie müssen auch einen DNS-Eintrag bei Ihrem DNS-Anbieter einrichten, der auf Ihren Server verweist. Es sollte einen A- (und/oder AAAA-) Eintrag für die Subdomain geben, der auf Ihre öffentliche IP verweist.
Update the system
To update the system packages, run the command:
apt update && apt upgrade
Run the autoinstaller
- The basic setup contains the following software packages (plus their dependencies of course):
Apache2, PHP (versions 5.6 - 8.0), MariaDB, Postfix, Dovecot, Rspamd, BIND, Jailkit, Roundcube, PHPMyAdmin, Mailman, Webalizer, AWStats and GoAccess
- You can easily choose not to use certain functions or install extra services by passing arguments to the installer
- See chapter 6 for available command-line options
Install ISPConfig with Apache web server
- You can now run the script with arguments
For example, if you want a normal install with Apache web server and a port range for Passive FTP + unattended-upgrades, run:
wget -O - https://get.ispconfig.org | sh -s -- --use-ftp-ports=40110-40210 --unattended-upgrades
The next steps are described in the chapter "Running the auto installer".
Install ISPConfig with Nginx web server
You can now run the script with arguments. For example, if you want a normal install with Nginx web server and a port range for Passive FTP + unattended-upgrades, run:
wget -O - https://get.ispconfig.org | sh -s -- --use-nginx --use-ftp-ports=40110-40210 --unattended-upgrades
Running the auto-installer
After some time, you will see:
WARNING! This script will reconfigure your complete server! It should be run on a freshly installed server and all current configuration that you have done will most likely be lost! Type 'yes' if you really want to continue:
Answer "yes" and hit enter. The installer will now start.
When the installer is finished, it will show you the ISPConfig admin and MySQL root password like this:
[INFO] Your ISPConfig admin password is: 5GvfSSSYsdfdYC [INFO] Your MySQL root password is: kkAkft82d!kafMwqxdtYs
- Make sure you write this information down, as you will need them later.
Setting up the firewall
- The last thing to do is to set up our firewall.
Log in to the ISPConfig UI, and go to System -> Firewall. Then click "Add new firewall record".
- For a normal setup, it would look like this
TCP: 20,21,22,25,80,443,40110:40210,110,143,465,587,993,995,53,8080,8081 UDP: 53
- The necessary ports for every service are
Web: 20, 21, 22, 80, 443 and 40110:40210 (All TCP, no UDP) Mail: 25, 110, 143, 465, 587, 993, and 995 (All TCP, no UDP) DNS: 53 (TCP and UDP) Panel: 8080 and 8081 (All TCP, no UDP)
- Your server is now set up and ready for use
You can log in at https://server1.example.com:8080
Advanced Options
- The auto-installer has various command-line options to fine-tune the setup
- You can view all arguments with
wget -O - https://get.ispconfig.org | sh -s -- --help
- You can e.g. choose between Apache and Nginx webserver and which services shall be installed on the system. The command-line arguments are
Usage: ispc3-ai.sh [] [...]
This script automatically installs all needed packages for an ISPConfig 3 setup using the guidelines from the "Perfect Server Setup" howtos on www.howtoforge.com.
- Possible arguments are
--help Show this help page --debug Enable verbose logging (logs each command with the exit code) --channel Choose the channel to use for ISPConfig. --channel=<stable|dev> "stable" is the latest ISPConfig release available on www.ispconfig.org "dev" is the latest stable-branch from the ISPConfig git repository: https://git.ispconfig.org/ispconfig/ispconfig3/tree/stable-3.1 -> The dev channel might contain bugs and less-tested features and should only be used in production by very experienced users. --lang Use language for ISPConfig installation. Specify with --lang=en|de (only en (English) and de (German) supported currently). --interactive Don't install ISPConfig in non-interactive mode. This is needed if you want to use expert mode, e. g. to install a slave server that shall be integrated into an existing multiserver setup. --use-nginx Use nginx webserver instead of apache2 --use-amavis Use amavis instead of rspamd for mail filtering --use-unbound Use unbound instead of bind9 for local resolving. Only allowed if --no-dns is set. --use-php Use specific PHP versions, comma separated, instead of installing multiple PHP, e.g. --use-php=7.4,8.0 (5.6, 7.0, 7.1, 7.2, 7.3, 7.4 and 8.0 available). --use-php=system disables the sury repository and just installs the system's default PHP version. ommiting the argument (use all versions) --use-ftp-ports This option sets the passive port range for pure-ftpd. You have to specify the port range separated by hyphen, e. g. --use-ftp-ports=40110-40210. If not provided the passive port range will not be configured. --use-certbot Use Certbot instead of acme.sh for issuing Let's Encrypt certificates. Not adviced unless you are migrating from a old server that uses Certbot. --no-web Do not use ISPConfig on this server to manage webserver setting and don't install nginx/apache or pureftpd. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma --no-mail Do not use ISPConfig on this server to manage mailserver settings. This will install postfix for sending system mails, but not dovecot and not configure any settings for ISPConfig mail. It implies --no-mailman. --no-dns Do not use ISPConfig on this server to manage DNS entries. Bind will be installed for local DNS caching / resolving only. --no-local-dns Do not install local DNS caching / resolving via bind. --no-firewall Do not install ufw and tell ISPConfig to not manage firewall settings on this server. --no-roundcube Do not install roundcube webmail. --roundcube Install Roundcube even when --no-mail is used. Manual configuration of Roundcube config is needed. --no-pma Do not install PHPMyAdmin on this server. --no-mailman Do not install Mailman mailing list manager. --no-quota Disable file system quota --no-ntp Disable NTP setup --unattended-upgrades Install UnattendedUpgrades. You can add extra arguments for automatic cleanup and automatic reboots when necessary with --unattended-upgrades=autoclean,reboot (or only one of them). --i-know-what-i-am-doing Prevent the autoinstaller to ask for confirmation before continuing to reconfigure the server.
- For example
To install a 'Perfect Server' like setup with Nginx instead of Apache, use this command
wget -O - https://get.ispconfig.org | sh -s -- --use-nginx --use-ftp-ports=40110-40210 --unattended-upgrades
Or to install an Nginx web server without Email and DNS services
wget -O - https://get.ispconfig.org | sh -s -- --use-nginx --no-dns --no-mail --use-ftp-ports=40110-40210 --unattended-upgrades
Finalizing
- Your setup is now done!
- You can support ISPConfig by purchasing the manual
- The followings links are some useful tutorials/pointers for further setup
- Setting up mail (rDNS, SPF, DKIM): https://www.howtoforge.com/how-to-install-an-email-server-with-ispconfig-on-debian-10/
- Tweaking Roundcube: https://www.howtoforge.com/community/threads/tweaking-the-roundcube-settings.86387/
- Setting up autoconfig (automatic configuration for your email clients): https://schaal-it.com/ispconfig-automail/
- Improve the security of PHPMyAdmin and the rspamd interface: https://www.howtoforge.com/community/threads/improving-the-security-of-phpmyadmin-and-rspamd-ui.86544/
- Code repository and issue tracker of the ISPConfig Autoinstaller: https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller
- Further questions
Download as a virtual machine
- This setup is available as a virtual machine download
- in ova/ovf format (compatible with VMWare and Virtualbox) for howtoforge subscribers.
- The Virtual machine is based on Debian 11 and uses Apache as web server.
Login details for the VM
- The IP address of the VM is 192.168.0.100
- The root password is: howtoforge
- The password of the ISPConfig "admin" user is: howtoforge
- There is another shell user with the name "administrator" and password: howtoforge
- The MySQL root password is: 4VLc2vw5mZzqHNd4xURT
- Change all passwords on the first login
Siehe auch
Dokumentation
RFC
Man-Pages
Info-Pages
Links
Einzelnachweise
Projekt
Weblinks
Testfragen
Testfrage 1
Testfrage 2
Testfrage 3
Testfrage 4
Testfrage 5