GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Come installare Joomla con Apache2 e Lets Encrypt su Ubuntu 20.04

Joomla è un sistema di gestione dei contenuti open source utilizzato per la pubblicazione di applicazioni e siti Web online. È scritto in PHP e utilizza MySQL/MariaDB come back-end del database. Si tratta di un framework di applicazioni Web model-view-controller predisposto per dispositivi mobili, facile da usare e costruito su un framework di applicazioni web. Joomla viene fornito con un sacco di funzionalità e design che lo rendono una buona scommessa per la creazione di siti professionali.

In questo tutorial, ti mostreremo come installare Joomla CMS con Apache e proteggere con Let's Encrypt SSL su Ubuntu 20.04.

Prerequisiti

  • Un server che esegue Ubuntu 20.04 con 2 GB di RAM.
  • Un nome di dominio valido puntato al tuo server.
  • Sul tuo server è configurata una password di root.

Installa il server LAMP

Innanzitutto, dovrai installare il server web Apache, MariaDB, PHP e altre estensioni PHP nel tuo sistema. Puoi installarli usando il seguente comando:

apt-get install apache2 mariadb-server php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-json php7.4-opcache php7.4-mbstring php7.4-intl php7.4-xml php7.4-gd php7.4-zip php7.4-curl php7.4-xmlrpc unzip -y

Una volta installati tutti i pacchetti, modifica il file php.ini e modifica alcune impostazioni.

nano /etc/php/7.4/apache2/php.ini

Modifica i seguenti valori:

memory_limit = 512M
upload_max_filesize = 256M
post_max_size = 256M
output_buffering = Off
max_execution_time = 300
date.timezone = Asia/Kolkata

Salva e chiudi il file una volta terminato.

Crea un database

Per prima cosa, proteggi l'installazione di MariaDB e imposta la password root di MariaDB con il seguente comando:

mysql_secure_installation

Rispondi a tutte le domande come mostrato di seguito:

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Quindi, accedi alla shell MariaDB con il seguente comando:

mysql -u root -p

Fornisci la tua password di root MariaDB quando richiesto, quindi crea un database e un utente per Joomla con il seguente comando:

MariaDB [(none)]> CREATE DATABASE joomladb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
MariaDB [(none)]> GRANT ALL ON joomladb.* TO 'joomla'@'localhost' IDENTIFIED BY 'password';

Quindi, svuota i privilegi ed esci dalla shell MariaDB con il seguente comando:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Scarica e installa Joomla

Innanzitutto, scarica l'ultima versione di Joomla dal suo sito Web ufficiale con il seguente comando:

wget https://downloads.joomla.org/cms/joomla3/3-9-18/Joomla_3-9-18-Stable-Full_Package.zip

Una volta completato il download, decomprimere il file scaricato nella directory principale web di Apache con il seguente comando:

unzip Joomla_3-9-18-Stable-Full_Package.zip -d /var/www/html/joomla

Quindi, cambia la proprietà della directory di Joomla in www-data con il seguente comando:

chown -R www-data:www-data /var/www/html/joomla

Una volta terminato, puoi procedere al passaggio successivo.

Configura Apache per Joomla

Quindi, crea un nuovo file di configurazione dell'host virtuale Apache per servire Joomla.

nano /etc/apache2/sites-available/joomla.conf

Aggiungi il seguente contenuto:

<VirtualHost *:80>
  ServerName joomla.linuxbuz.com
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/joomla

  ErrorLog ${APACHE_LOG_DIR}/joomla-error.log
  CustomLog ${APACHE_LOG_DIR}/joomla-access.log combined

  <Directory /var/www/html/joomla>
      Options FollowSymLinks
      AllowOverride All
      Require all granted
  </Directory>

</VirtualHost>

Salvare e chiudere il file, quindi abilitare l'host virtuale Apache e riavviare il servizio Apache utilizzando il seguente comando:

a2ensite joomla
systemctl restart apache2

Una volta terminato, puoi procedere al passaggio successivo.

Proteggi Joomla con Let's Encrypt SSL

Innanzitutto, dovrai installare il client Certbot per installare e gestire Let's Encrypt SSL. Puoi installarlo con il seguente comando:

apt-get install certbot python3-certbot-apache -y

Una volta installato Certbot, esegui il seguente comando per scaricare e installare Let's Encrypt SSL per il tuo sito web:

certbot --apache -d joomla.linuxbuz.com

Ti verrà chiesto di fornire il tuo indirizzo email e di accettare i termini del servizio come mostrato di seguito:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
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

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for joomla.linuxbuz.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/joomla-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/joomla-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/joomla-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 completare l'installazione come mostrato di seguito.

Redirecting vhost in /etc/apache2/sites-enabled/joomla.conf to ssl vhost in /etc/apache2/sites-available/joomla-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://joomla.linuxbuz.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=joomla.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/joomla.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/joomla.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-08-19. 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"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - 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

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

A questo punto, il tuo sito Web Joomla è protetto con Let's Encrypt SSL. Ora puoi procedere al passaggio successivo.

Accedi a Joomla CMS

Ora apri il tuo browser web e digita l'URL https://joomla.linuxbuz.com. Verrai reindirizzato alla procedura guidata di installazione basata sul Web di Joomla:

Fornisci il nome del sito, l'e-mail dell'amministratore, la password e fai clic su Avanti pulsante. Dovresti vedere la procedura guidata di configurazione del database:

Fornisci il nome del tuo database Joomla, il nome utente del database, la password e fai clic su Avanti pulsante. Dovresti vedere la pagina di finalizzazione di Joomla:

Seleziona l'opzione desiderata e fai clic su Installa pulsante. Dovresti vedere la seguente pagina:

Rivedi tutte le configurazioni e fai clic sul pulsante Installa. Una volta installato Joomla, dovresti vedere la seguente schermata:

Ora rimuovi la directory di installazione e fai clic su Amministratore pulsante. Dovresti vedere la pagina di accesso di Joomla:

Fornisci il tuo nome utente Joomla, la password e fai clic sul Log dentro pulsante. Dovresti vedere la dashboard di Joomla nella pagina seguente:

Puoi anche accedere al tuo sito web Joomla visitando l'URL https://joomla.linuxbuz.com. Dovresti vedere il tuo sito web Joomla nella seguente pagina:

Conclusione

Congratulazioni! hai installato e protetto con successo Joomla con Let's Encrypt su Ubuntu 20.04. Ora puoi creare facilmente il tuo negozio eCommerce, sito web personale, sito social o blog. Sentiti libero di chiedermi se hai domande.


Ubuntu
  1. Come installare Nextcloud con Nginx e Lets Encrypt SSL su Ubuntu 20.04 LTS

  2. Come installare Magento 2 con Nginx e Lets Encrypt SSL su Ubuntu 20.04 LTS

  3. Come installare Shopware con NGINX e Lets crittografare su Ubuntu 18.04 LTS

  4. Come installare Grav CMS con Nginx e Lets Encrypt su Ubuntu 18.04 LTS

  5. Come installare Automatad CMS con Apache e Lets crittografare su Debian 10

Come installare ProjectSend con Apache e Lets Encrypt SSL su Ubuntu 20.04

Come installare Moodle con Nginx e Lets Encrypt SSL su Ubuntu 20.04

Come installare MediaWiki con Nginx e Lets Encrypt SSL su Ubuntu 20.04

Come installare Gitea con Nginx e Lets Encrypt SSL gratuito su Ubuntu 20.04

Come installare SonarQube con Lets Encrypt su Ubuntu 20.04

Come installare Joomla con LAMP su Ubuntu 20.04