Come installare TYPO3 CMS con Lets Encrypt SSL su Ubuntu 20.04
Questo tutorial esiste per queste versioni del sistema operativo
- Ubuntu 20.04 (Focal Fossa)
- Ubuntu 14.04 LTS (Trusty Tahr)
Su questa pagina
- Prerequisiti
- Per iniziare
- Installa il server LAMP
- Crea un database per TYPO3
- Installa TYPO3 CMS
- Configura Apache per TYPO3
- Accedi a TYPO3 CMS
- Proteggi TYPO3 con Lets Encrypt
- Conclusione
TYPO3 è un sistema di gestione dei contenuti gratuito e open source scritto in PHP. È un CMS di classe enterprise che combina codice open source con affidabilità e reale scalabilità. Funziona su un server Web e supporta molti sistemi operativi tra cui Windows, Linux, macOS, ecc. È un CMS semplice, reattivo, pronto per i dispositivi mobili e sicuro e può essere facilmente personalizzato ed esteso senza scrivere alcun codice. È una scelta molto popolare e ottima per far funzionare rapidamente il tuo sito web.
In questo tutorial, ti mostreremo come installare TYPO3 CMS con il web server Apache e Lets Encrypt SSL su Ubuntu 20.04.
Prerequisiti
- Un server che esegue Ubuntu 20.04.
- Un nome di dominio valido indicato con l'IP del tuo server.
- Il server è configurato con una password di root.
Iniziare
Innanzitutto, si consiglia di aggiornare i pacchetti di sistema con l'ultima versione. Puoi aggiornare tutti i pacchetti eseguendo il seguente comando:
apt-get update -y
Una volta aggiornati tutti i pacchetti, puoi procedere al passaggio successivo.
Installa LAMP Server
Successivamente, dovrai installare il server web Apache, MariaDB, PHP e altre estensioni PHP nel tuo server. Puoi installarli tutti con il seguente comando:
apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-xml php-cli php-zip curl git gnupg2 -y
Dopo aver installato tutti i pacchetti, modifica il file php.ini e modifica alcune impostazioni consigliate:
nano /etc/php/7.4/apache2/php.ini
Modifica le seguenti righe:
memory_limit = 256M upload_max_filesize = 100M post_max_size = 100M max_execution_time = 360 max_input_vars = 1500 date.timezone = Asia/Kolkata
Salva e chiudi il file, quindi riavvia il servizio Apache per applicare le modifiche:
systemctl restart apache2
Crea un database per TYPO3
Successivamente, dovrai creare un database e un utente per TYPO3. Innanzitutto, accedi alla shell MariaDB con il seguente comando:
mysql
Una volta effettuato l'accesso, creare un database e un utente con il seguente comando:
MariaDB [(none)]> CREATE DATABASE typo3db;
MariaDB [(none)]> CREATE USER ''@'localhost' IDENTIFIED BY 'password';
Quindi, concedi tutti i privilegi a typo3db con il seguente comando:
MariaDB [(none)]> GRANT ALL ON typo3db.* TO 'typo3'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Successivamente, scarica i privilegi ed esci da MariaDB con il seguente comando:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
A questo punto, il tuo database MariaDB è configurato.
Installa TYPO3 CMS
Innanzitutto, dovrai scaricare l'ultima versione di TYPO3 dal loro sito Web ufficiale. Puoi usare il comando curl per scaricarlo:
curl -L -o typo3_src.tgz https://get.typo3.org/10.4.9
Una volta completato il download, estrai il file scaricato con il seguente comando:
tar -xvzf typo3_src.tgz
Successivamente, sposta la directory estratta nella directory principale del Web Apache:
mv typo3_src-10.4.9 /var/www/html/typo3
Quindi, dai l'autorizzazione e il permesso appropriati con il seguente comando:
chown -R www-data:www-data /var/www/html/typo3
chmod -R 775 /var/www/html/typo3
Una volta terminato, puoi procedere al passaggio successivo.
Configura Apache per TYPO3
Quindi, crea un file di configurazione dell'host virtuale Apache per ospitare TYPO3 CMS. Puoi crearlo con il seguente comando:
nano /etc/apache2/sites-available/typo3.conf
Aggiungi le seguenti righe:
<VirtualHost *:80> ServerAdmin DocumentRoot /var/www/html/typo3 ServerName typo3.example.com <Directory /var/www/html/typo3> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Salva e chiudi il file, quindi abilita il file di configurazione dell'host virtuale e riscrivi il modulo con il seguente comando:
a2ensite typo3.conf
a2enmod rewrite
Successivamente, riavvia il servizio Apache per applicare le modifiche:
systemctl restart apache2
A questo punto, il web server Apache è configurato per servire TYPO3. Ora puoi procedere al passaggio successivo.
Accedi a TYPO3 CMS
Ora, apri il tuo browser web e accedi a TYPO3 utilizzando l'URL http://typo3.example.com. Dovresti vedere la seguente pagina:
Se stai installando TYPO3 su un nuovo server, dovrai creare un file FIRST_INSTALL all'interno della directory root web di TYPO3. Puoi crearlo con il seguente comando:
touch /var/www/html/typo3/FIRST_INSTALL
Successivamente, aggiorna la pagina web. Dovresti vedere la seguente pagina:
Clicca su Nessun problema rilevato, continua con l'installazione, dovresti vedere la seguente pagina:
Fornisci il nome utente, la password, l'host del tuo database e fai clic sul pulsante Continua. Dovresti vedere la seguente pagina:
Seleziona il nome del tuo database TYPO3 e fai clic sul pulsante Continua. Dovresti vedere la seguente pagina:
Successivamente, fornisci il nome utente, la password, il nome del sito dell'amministratore e fai clic sul pulsante Continua. Verrai reindirizzato alla pagina di accesso di TYPO3:
Fornisci il nome utente e la password dell'amministratore e fai clic sul pulsante Accedi. Dovresti vedere la dashboard di TYPO3 nella pagina seguente:
Proteggi TYPO3 con Lets Encrypt
Ti consigliamo di proteggere il tuo sito web con Lets Encrypt Free SSL. Innanzitutto, installa il client Certbot per installare e gestire SSL. Puoi installarlo con il seguente comando:
apt-get install python3-certbot-apache -y
Una volta installato, esegui il seguente comando per proteggere il tuo sito web con Lets Encrypt SSL:
certbot --apache -d typo3.example.com
Ti verrà chiesto di fornire la tua email e di accettare i termini di servizio come mostrato di seguito:
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator standalone, Installer None Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server at https://acme-v02.api.letsencrypt.org/directory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (A)gree/(C)ancel: A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Plugins selected: Authenticator apache, Installer apache Obtaining a new certificate Performing the following challenges: http-01 challenge for typo3.example.com Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/typo3-le-ssl.conf Enabled Apache socache_shmcb module Enabled Apache ssl module Deploying Certificate to VirtualHost /etc/apache2/sites-available/typo3-le-ssl.conf Enabling available site: /etc/apache2/sites-available/typo3-le-ssl.conf
Successivamente, seleziona se reindirizzare o meno il traffico HTTP su HTTPS come mostrato di seguito:
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: No redirect - Make no further changes to the webserver configuration. 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Digita 2 e premi Invio per installare Lets Encrypt SSL per il tuo sito web:
Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/typo3.conf to ssl vhost in /etc/apache2/sites-available/typo3-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://typo3.example.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=typo3.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/typo3.example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/typo3.example.com/privkey.pem Your cert will expire on 2020-10-23. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
Ora puoi accedere al CMS TYPO3 in modo sicuro utilizzando l'URL https://typo3.example.com.
Conclusione
Congratulazioni! hai installato correttamente TYPO3 CMS e lo hai protetto con Lets Encrypt SSL su Ubuntu 20.04. Ora puoi creare facilmente il tuo sito Web e il tuo blog tramite il browser web. Non esitate a chiedermi se avete domande.