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, mobile ready 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 Let's Encrypt SSL su Ubuntu 20.04.
Prerequisiti
- Un server che esegue Ubuntu 20.04.
- Un nome di dominio valido puntato all'IP del tuo server.
- Una password di root è configurata sul server.
Per iniziare
Innanzitutto, si consiglia di aggiornare i pacchetti di sistema con l'ultima versione. Puoi aggiornare tutti i pacchetti eseguendo il comando seguente:
apt-get update -y
Una volta che tutti i pacchetti sono aggiornati, puoi procedere al passaggio successivo.
Installa il server LAMP
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 cambia 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 di MariaDB con il seguente comando:
mysql
Una volta effettuato l'accesso, crea 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;
Quindi, svuota 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
Quindi, sposta la directory estratta nella directory principale web di Apache:
mv typo3_src-10.4.9 /var/www/html/typo3
Quindi, dai l'autorizzazione e l'autorizzazione adeguate 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 [email protected] 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
Quindi, riavvia il servizio Apache per applicare le modifiche:
systemctl restart apache2
A questo punto, il server web 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 in un nuovo server, dovrai creare un FIRST_INSTALL file all'interno della directory principale web di TYPO3. Puoi crearlo con il seguente comando:
touch /var/www/html/typo3/FIRST_INSTALL
Quindi, aggiorna la pagina web. Dovresti vedere la seguente pagina:
Fare clic su Nessun problema rilevato, continuare con l'installazione, dovresti vedere la seguente pagina:
Fornisci il nome utente, la password, l'host del database e fai clic su Continua pulsante. Dovresti vedere la seguente pagina:
Seleziona il nome del database TYPO3 e fai clic su Continua pulsante. Dovresti vedere la seguente pagina:
Quindi, fornisci il tuo nome utente amministratore, password, nome del sito e fai clic su Continua pulsante. Verrai reindirizzato alla pagina di accesso di TYPO3:
Fornisci il nome utente e la password dell'amministratore e fai clic su Accedi pulsante. Dovresti vedere la dashboard di TYPO3 nella pagina seguente:
Proteggi TYPO3 con Let's Encrypt
Si consiglia di proteggere il tuo sito Web con Let's 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 Let's Encrypt SSL:
certbot --apache -d typo3.example.com
Ti verrà chiesto di fornire la tua email e di accettare i termini del 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): [email protected] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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
Quindi, 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 Let's 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 proteggi con Let's Encrypt SSL su Ubuntu 20.04. Ora puoi creare facilmente il tuo sito Web e blog tramite il browser web. Sentiti libero di chiedermi se hai domande.