Ricerca nel sito web

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


Su questa pagina

  1. Prerequisiti
  2. 1. Accedi al server
  3. 2. Configurare il nome host e gli host
  4. 3. Aggiorna il sistema
  5. 4. Esegui il programma di installazione automatica
  6. 5. Configurazione del firewall
  7. 6. Opzioni avanzate
  8. 7. Finalizzazione
  9. 8 Scarica come macchina virtuale

Questo tutorial ti guiderà attraverso l'installazione della tua configurazione di server singolo ISPConfig 3 utilizzando l'auto-installatore 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, Ubuntu 20.04 e Ubuntu 22.04, attualmente supporta solo l'architettura CPU x86_64 (nota anche come AMD64) mentre ARM non è supportato. Useremo il nome host server1.example.com. Sostituirlo dove necessario. La guida richiede un sistema operativo di base appena installato e vuoto, non tentare di utilizzarlo su un sistema in cui hai già configurato altri servizi.

Prerequisiti

  • Sistema operativo: Debian 10, Debian 11, Ubuntu 20.04 o Ubuntu 22.04.
  • Architettura CPU Intel o AMD a 64 bit (x86_64, nota anche come AMD64). Le CPU ARM non sono attualmente supportate.
  • Il sistema deve avere accesso a Internet per scaricare e installare il software con apt.
  • Inizia da un'installazione del sistema operativo di base pulita e vuota.

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. Configurare 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 in quanto ciò causerà problemi in seguito con la configurazione. Innanzitutto, dovresti controllare il nome host in /etc/hosts e modificarlo quando 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 a questo (alcune righe potrebbero essere diverse, a seconda del 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

Dovrà 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ì:

:~$ hostname -f
server1.example.com

Dovrai anche impostare un record DNS con il tuo provider DNS che punta 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, eseguire il comando:

apt update && apt upgrade

4. Eseguire il programma di installazione automatica

Ora possiamo eseguire il programma di installazione automatica. La configurazione di base contiene i seguenti pacchetti software (più le loro 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 all'installer. 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 non presidiati, esegui:

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

Dopo un po' di tempo, 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à ora avviato.

Quando il programma di installazione è terminato, 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 è impostare il nostro firewall.

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

Per una configurazione normale, sarebbe simile a questo:

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 (tutto TCP, no UDP)

Posta: 25, 110, 143, 465, 587, 993 e 995 (tutto TCP, no UDP)

DNS: 53 (TCP e UDP)

Centrale: 8080 e 8081 (tutto TCP, no 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 dispone di varie opzioni della riga di comando per ottimizzare l'installazione. Puoi ad es. scegliere 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 linux-console.net.

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 Perfect Server come setup 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

Oppure 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 terminata!

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

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

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

Se hai domande, chiedile sul forum.

8 Scarica come macchina virtuale

Questa configurazione è disponibile come download di una macchina virtuale in formato ova/ovf (compatibile con VMWare e Virtualbox) per gli abbonati howtoforge. La macchina virtuale è basata su Debian 11 e utilizza Apache come web server.

Dettagli di accesso per la VM

  • La password di root è: howtoforge
  • La password dell'utente \admin\ di ISPConfig è: howtoforge
  • C'è un altro utente shell con nome \amministratore\ e password: howtoforge
  • La password di root di MySQL è: 4VLc2vw5mZzqHNd4xURT

Si prega di cambiare tutte le password al primo accesso.

  • L'indirizzo IP della VM è 192.168.0.100