GNU/Linux >> Znalost Linux >  >> Debian

Perfect Server Automated ISPConfig 3 instalace na Debian 10 - 11 a Ubuntu 20.04

Tento tutoriál vás provede instalací vašeho vlastního nastavení jednoho serveru ISPConfig 3 pomocí automatického instalátoru ISPConfig. Tento instalační program se řídí starými příručkami Perfect Server, ale je modulárnější a lze jej snadno sledovat. Pokud chcete místo toho nastavit nastavení více serverů s vyhrazenými servery pro každou službu, podívejte se na průvodce Perfect Multiserver.

Tato příručka funguje pro Debian 10, Debian 11 a Ubuntu 20.04. Použijeme název hostitele server1.example.com. V případě potřeby jej vyměňte. Průvodce vyžaduje čerstvě nainstalovaný a prázdný základní OS, nezkoušejte jej používat na systému, kde jste již nakonfigurovali jiné služby.

1. Přihlaste se na server

Přihlaste se jako root nebo spusťte

su -

a stát se uživatelem root na vašem serveru, než budete pokračovat. DŮLEŽITÉ :Musíte použít 'su -' a ne pouze 'su', jinak je vaše proměnná PATH v Debianu nastavena špatně.

2. Nakonfigurujte název hostitele a hostitele

Název hostitele vašeho serveru by měla být subdoména jako „server1.example.com“. Nepoužívejte název domény bez části subdomény, jako je „example.com“, jako název hostitele, protože by to později způsobilo problémy s nastavením. Nejprve byste měli zkontrolovat název hostitele v /etc/hosts a v případě potřeby jej změnit. Řádek by měl být:"IP adresa - mezera - celé jméno hostitele včetně domény - mezera - část subdomény". Pro náš název hostitele server1.example.com bude soubor vypadat takto (některé řádky se mohou lišit, mohou se lišit podle poskytovatele hostingu):

nano /etc/hosts
127.0.0.1 localhost.localdomain   localhost
# This line should be changed to the correct servername:
127.0.1.1 server1.example.com server1
# The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters

Poté upravte soubor /etc/hostname:

nano /etc/hostname

Bude obsahovat pouze část subdomény, v našem případě:

server1

Nakonec restartujte server, aby se změna uplatnila:

systemctl reboot

Znovu se přihlaste a pomocí těchto příkazů zkontrolujte, zda je název hostitele správný:

hostname
hostname -f

Výstup by měl být takto:

[email protected]:~$ hostname
server1
[email protected]:~$ hostname -f
server1.example.com

Budete také muset nastavit DNS záznam u svého poskytovatele DNS, který ukazuje na váš server. Měl by existovat záznam A (a/nebo AAAA) pro subdoménu, která ukazuje na vaši veřejnou IP.

3. Aktualizujte systém

Chcete-li aktualizovat systémové balíčky, spusťte příkaz:

apt update && apt upgrade

4. Spusťte automatický instalační program

Nyní můžeme spustit automatický instalační program. Základní nastavení obsahuje následující softwarové balíčky (plus jejich závislosti samozřejmě):Apache2, PHP (verze 5.6 - 8.0), MariaDB, Postfix, Dovecot, Rspamd, BIND, Jailkit, Roundcube, PHPMyAdmin, Mailman, Webalizer, AWStats a GoAccess. Předáním argumentů instalačnímu programu se můžete snadno rozhodnout nepoužívat určité funkce nebo instalovat další služby. Všechny argumenty můžete zobrazit pomocí:

wget -O - https://get.ispconfig.org | sh -s -- --help

Nyní můžete spustit skript s argumenty. Pokud například chcete normální instalaci s rozsahem portů pro pasivní FTP + bezobslužné upgrady, spusťte:

wget -O - https://get.ispconfig.org | sh -s -- --use-ftp-ports=40110-40210 --unattended-upgrades

Po nějaké době uvidíte:

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:

Odpovězte „ano“ a stiskněte Enter. Nyní se spustí instalační program.

Po dokončení instalace vám zobrazí administrátorské heslo ISPConfig a heslo root MySQL takto:

[INFO] Your ISPConfig admin password is: 5GvfSSSYsdfdYC
[INFO] Your MySQL root password is: kkAkft82d!kafMwqxdtYs

Nezapomeňte si tyto informace zapsat, protože je budete později potřebovat.

5. Nastavení brány firewall

Poslední věcí, kterou musíte udělat, je nastavit náš firewall.

Přihlaste se do uživatelského rozhraní ISPConfig a přejděte na Systém -> Firewall. Poté klikněte na „Přidat nový záznam brány firewall“.

Pro normální nastavení by to vypadalo takto:

TCP:

20,21,22,25,80,443,40110:40210,110,143,465,587,993,995,53,8080,8081

UDP:

53

Nezbytné porty pro každou službu jsou:

Web:20, 21, 22, 80, 443 a 40110:40210 (vše TCP, bez UDP)

E-mail:25, 110, 143, 465, 587, 993 a 995 (všechny TCP, bez UDP)

DNS:53 (TCP a UDP)

Panel:8080 a 8081 (všechny TCP, bez UDP)

Váš server je nyní nastaven a připraven k použití. Můžete se přihlásit na adrese https://server1.example.com:8080

6. Pokročilé možnosti

Automatická instalace má různé možnosti příkazového řádku pro doladění nastavení. Můžete např. vyberte si mezi webovým serverem Apache a Nginx a které služby mají být nainstalovány v systému. Argumenty příkazového řádku jsou:

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.

Chcete-li například nainstalovat nastavení typu „Perfect Server“ s Nginx namísto Apache, použijte tento příkaz:

wget -O - https://get.ispconfig.org | sh -s -- --use-nginx --use-ftp-ports=40110-40210 --unattended-upgrades

Nebo nainstalovat webový server Nginx bez služeb e-mailu a DNS:

wget -O - https://get.ispconfig.org | sh -s -- --use-nginx --no-dns --no-mail --use-ftp-ports=40110-40210 --unattended-upgrades

7. Finalizace

Vaše nastavení je nyní hotovo!

ISPConfig můžete podpořit zakoupením našeho manuálu:https://www.ispconfig.org/documentation/

Následující odkazy představují některé užitečné návody/ukazatele pro další nastavení:

  • Nastavení pošty (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/
  • Nastavení autoconfig (automatická konfigurace pro vaše e-mailové klienty):https://schaal-it.com/ispconfig-automail/
  • Zlepšete zabezpečení PHPMyAdmin a rozhraní rspamd:https://www.howtoforge.com/community/threads/improving-the-security-of-phpmyadmin-and-rspamd-ui.86544/
  • Úložiště kódu a nástroj pro sledování problémů ISPConfig Autoinstaller:https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller

Pokud máte nějaké dotazy, zeptejte se jich na fóru.


Debian
  1. Perfect Server Automated ISPConfig 3 instalace na Debian 10 - 11 a Ubuntu 20.04

  2. The Perfect Server – Ubuntu 15.04 (nginx, BIND, Dovecot a ISPConfig 3)

  3. Perfect Server Automated ISPConfig 3 instalace na Debian 10 - 11 a Ubuntu 20.04

  1. Nastavení ISPConfig Perfect Multiserver na Ubuntu 20.04 a Debian 10

  2. Aktualizujte ISPConfig Perfect Server z Debian 10 na Debian 11

  3. Nainstalujte poštovní server Postfix a Dovecot na Ubuntu nebo Debian

  1. Instalace phpVirtualBox na Debian Linux a webový server Apache2

  2. Instalace serveru Ubuntu 20.04

  3. The Perfect Server – Debian 8 Jessie (Apache2, BIND, Dovecot, ISPConfig 3)