GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Installazione automatizzata di Perfect Server ISPConfig 3 su Debian 10 - 11 e Ubuntu 20.04

Questo tutorial ti guiderà attraverso l'installazione della configurazione del tuo server singolo ISPConfig 3 utilizzando il programma di installazione automatica ISPConfig. Questo programma di installazione segue le vecchie guide di Perfect Server ma è più modulare e facile da seguire. Se invece desideri configurare una configurazione multiserver con server dedicati per ciascun servizio, consulta la guida Perfect Multiserver.

Questa guida funziona sia per Debian 10, Debian 11 e Ubuntu 20.04. Useremo il nome host server1.example.com. Sostituirlo dove necessario. La guida richiede un sistema operativo di base appena installato e vuoto, non provare a usarlo su un sistema in cui hai già configurato altri servizi.

1. Accedi al server

Accedi come root o esegui

su -

per diventare l'utente root sul tuo server prima di procedere. IMPORTANTE :Devi usare 'su -' e non solo 'su', altrimenti la tua variabile PATH è impostata in modo errato da Debian.

2. Configura il nome host e gli host

Il nome host del tuo server dovrebbe essere un sottodominio come "server1.example.com". Non utilizzare un nome di dominio senza una parte di sottodominio come "example.com" come nome host poiché ciò causerà problemi in seguito con la configurazione. Innanzitutto, dovresti controllare il nome host in /etc/hosts e modificarlo se necessario. La riga dovrebbe essere:"Indirizzo IP - spazio - nome host completo incl. dominio - spazio - parte del sottodominio". Per il nostro nome host server1.example.com, il file sarà simile al seguente (alcune righe potrebbero essere diverse, possono variare in base al provider di hosting):

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

Quindi modifica il file /etc/hostname:

nano /etc/hostname

Deve contenere solo la parte del sottodominio, nel nostro caso:

server1

Infine, riavvia il server per applicare la modifica:

systemctl reboot

Accedi di nuovo e controlla se il nome host è corretto ora con questi comandi:

hostname
hostname -f

L'output sarà così:

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

Dovrai anche impostare un record DNS con il tuo provider DNS che punti al tuo server. Dovrebbe esserci un record A (e/o AAAA) per il sottodominio che punta al tuo IP pubblico.

3. Aggiorna il sistema

Per aggiornare i pacchetti di sistema, esegui il comando:

apt update && apt upgrade

4. Esegui il programma di installazione automatica

Ora possiamo eseguire il programma di installazione automatica. La configurazione di base contiene i seguenti pacchetti software (più le relative dipendenze ovviamente):Apache2, PHP (versioni 5.6 - 8.0), MariaDB, Postfix, Dovecot, Rspamd, BIND, Jailkit, Roundcube, PHPMyAdmin, Mailman, Webalizer, AWStats e GoAccess. Puoi facilmente scegliere di non utilizzare determinate funzioni o installare servizi extra passando argomenti al programma di installazione. Puoi visualizzare tutti gli argomenti con:

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

Ora puoi eseguire lo script con argomenti. Ad esempio, se desideri un'installazione normale con un intervallo di porte per FTP passivo + aggiornamenti automatici, esegui:

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

Dopo un po' vedrai:

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:

Rispondi "sì" e premi invio. Il programma di installazione verrà avviato.

Al termine dell'installazione, ti mostrerà l'amministratore di ISPConfig e la password di root di MySQL in questo modo:

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

Assicurati di annotare queste informazioni, poiché ti serviranno in seguito.

5. Configurazione del firewall

L'ultima cosa da fare è configurare il nostro firewall.

Accedi all'interfaccia utente di ISPConfig e vai su Sistema -> Firewall. Quindi fai clic su "Aggiungi nuovo record firewall".

Per una configurazione normale, sarebbe simile a questa:

TCP:

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

UDP:

53

Le porte necessarie per ogni servizio sono:

Web:20, 21, 22, 80, 443 e 40110:40210 (tutti TCP, nessun UDP)

Posta:25, 110, 143, 465, 587, 993 e 995 (tutti i TCP, nessun UDP)

DNS:53 (TCP e UDP)

Pannello:8080 e 8081 (Tutto TCP, nessun UDP)

Il tuo server è ora configurato e pronto per l'uso. Puoi accedere a https://server1.example.com:8080

6. Opzioni avanzate

Il programma di installazione automatica ha varie opzioni della riga di comando per ottimizzare l'installazione. Puoi ad es. scegli tra Apache e Nginx webserver e quali servizi devono essere installati sul sistema. Gli argomenti della riga di comando sono:

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.

Ad esempio, per installare un "Server perfetto" come l'installazione con Nginx invece di Apache, usa questo comando:

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

O per installare un server web Nginx senza servizi di posta elettronica e DNS:

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

7. Finalizzazione

La tua configurazione è ora completata!

Puoi supportare ISPConfig acquistando il nostro manuale:https://www.ispconfig.org/documentation/

I seguenti collegamenti sono alcuni utili tutorial/puntatori per ulteriori impostazioni:

  • Configurazione della posta (rDNS, SPF, DKIM):https://www.howtoforge.com/how-to-install-an-email-server-with-ispconfig-on-debian-10/
  • Modificare Roundcube:https://www.howtoforge.com/community/threads/tweaking-the-roundcube-settings.86387/
  • Configurazione di autoconfig (configurazione automatica per i tuoi client di posta):https://schaal-it.com/ispconfig-automail/
  • Migliora la sicurezza di PHPMyAdmin e l'interfaccia rspamd:https://www.howtoforge.com/community/threads/improving-the-security-of-phpmyadmin-and-rspamd-ui.86544/
  • Repository di codice e tracker dei problemi di ISPConfig Autoinstaller:https://git.ispconfig.org/ispconfig/ispconfig-autoinstaller

Se hai domande, chiedile sul forum.


Ubuntu
  1. Installazione del server Ubuntu 20.04

  2. Il server perfetto - Ubuntu 15.04 (nginx, BIND, Dovecot e ISPConfig 3)

  3. Configurazione ISPConfig Perfect Multiserver su Ubuntu 20.04 e Debian 10

  4. Installazione automatizzata di Perfect Server ISPConfig 3 su Debian 10 - 11 e Ubuntu 20.04

  5. Installazione automatizzata di Perfect Server ISPConfig 3 su Debian 10 - 11 e Ubuntu 20.04

Il server perfetto - Debian 8.4 Jessie (Apache2, BIND, Dovecot, ISPConfig 3.1)

Il server perfetto - Debian 9 (Stretch) con Apache, BIND, Dovecot, PureFTPD e ISPConfig 3.1

Il server perfetto - Debian 10 (Buster) con Apache, BIND, Dovecot, PureFTPD e ISPConfig 3.2

Installa e configura Virtualmin su Ubuntu 20.04 / Debian 10 Server

Il server perfetto - Ubuntu 11.04 [ISPConfig 3]

Il server perfetto - Ubuntu 11.10 [ISPConfig 3]