Ricerca nel sito web

Come installare Concrete5 CMS con Apache e Lets Encrypt SSL gratuito su Ubuntu 20.04


Su questa pagina

  1. Requisiti
  2. Per iniziare
  3. Installa Apache, MariaDB e PHP
  4. Crea un database Concrete5
  5. Scarica Concrete5 CMS
  6. Configura Apache per Concrete5 CMS
  7. Accedi all'interfaccia web di Concrete5 CMS
  8. Proteggi Concrete5 con Lets Encrypt SSL
  9. Conclusione

Concrete5 è un sistema di gestione dei contenuti open source utilizzato per pubblicare contenuti su Internet. È scritto in PHP e utilizza MariaDB come backend del database. Fornisce un builder facile da usare che ti aiuta a creare pagine e contenuti tramite il browser web. È flessibile, sicuro, mobile-ready e basato sull'architettura Model-View-Controller. Offre un ricco set di funzionalità tra cui editor di contenuti WYSIWYG, Media Manager, trascinamento dei contenuti, modifica nel contesto e molti altri.

In questo post, ti mostreremo come installare Concrete5 CMS con Apache e Lets Encrypt SSL su server Ubuntu 20.04.

Requisiti

  • Un server che esegue Ubuntu 20.04.
  • Un nome di dominio valido puntava all'IP del server.
  • Una password di root è configurata sul tuo server.

Iniziare

Innanzitutto, dovrai aggiornare l'indice del pacchetto APT all'ultima versione. Puoi aggiornarlo con il seguente comando:

apt-get update -y

Una volta aggiornato l'indice APT, puoi procedere al passaggio successivo.

Installa Apache, MariaDB e PHP

Successivamente, dovrai installare il server Web Apache, il server del database MariaDB, PHP e altre estensioni PHP sul tuo server. Puoi installarli tutti usando il seguente comando:

apt-get install apache2 mariadb-server php libapache2-mod-php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-ldap php-zip php-curl -y

Una volta installati tutti i pacchetti, modificare il file php.ini e impostare i valori desiderati:

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

Modifica le seguenti righe:

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 64M
date.timezone = Asia/Kolkata

Salva e chiudi il file quando hai finito, quindi riavvia il servizio Apache per applicare le modifiche:

systemctl restart apache2

Una volta terminato, puoi procedere al passaggio successivo.

Crea un database Concrete5

Successivamente, dovrai creare un database e un utente per Concrete5. Innanzitutto, accedi a 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 concrete5;
MariaDB [(none)]> CREATE USER 'concrete5user'@'localhost' IDENTIFIED BY 'password';

Successivamente, concedi tutti i privilegi al database Concrete5 con il seguente comando:

MariaDB [(none)]> GRANT ALL ON concrete5.* TO 'concrete5user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Successivamente, svuota i privilegi ed esci dalla console MariaDB con il seguente comando:

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

Una volta terminato, puoi procedere al passaggio successivo.

Scarica Concrete5 CMS

Per prima cosa, vai sul sito web di Concrete5 CMS, copia l'URL dell'ultima versione di Concrete5 e scaricalo con il seguente comando:

wget --trust-server-names https://www.concrete5.org/download_file/-/view/115589/ -O concrete5.zip

Una volta completato il download, estrai il file scaricato con il seguente comando:

unzip concrete5.zip

Successivamente, sposta la directory estratta nella directory principale del Web Apache utilizzando il seguente comando:

mv concrete5-* /var/www/html/concrete5

Quindi, imposta l'autorizzazione e la proprietà appropriate per la directory concrete5 con il seguente comando:

chown -R www-data:www-data /var/www/html/concrete5/
chmod -R 755 /var/www/html/concrete5/

Una volta terminato, puoi procedere al passaggio successivo.

Configura Apache per Concrete5 CMS

Successivamente, dovrai creare un file di configurazione dell'host virtuale Apache per Concrete5 CMS. Puoi crearlo con il seguente comando:

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

Aggiungi le seguenti righe:

<VirtualHost *:80>
     ServerAdmin 
     DocumentRoot /var/www/html/concrete5/
     ServerName concrete5.example.com

     <Directory /var/www/html/concrete5/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

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

</VirtualHost>

Salvare e chiudere il file quindi abilitare l'host virtuale Apache e il modulo di riscrittura con il seguente comando:

a2ensite concrete5.conf
a2enmod rewrite

Successivamente, riavvia il servizio Apache per applicare le modifiche:

systemctl restart apache2

Puoi anche controllare lo stato del servizio Apache usando il seguente comando:

systemctl status apache2

Dovresti ottenere il seguente output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-05-15 15:00:03 UTC; 4s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 15566 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 15585 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 13.5M
     CGroup: /system.slice/apache2.service
             ??15585 /usr/sbin/apache2 -k start
             ??15586 /usr/sbin/apache2 -k start
             ??15587 /usr/sbin/apache2 -k start
             ??15588 /usr/sbin/apache2 -k start
             ??15589 /usr/sbin/apache2 -k start
             ??15590 /usr/sbin/apache2 -k start

May 15 15:00:03 ubunt4 systemd[1]: Starting The Apache HTTP Server...

A questo punto, il web server Apache è configurato per ospitare Concrete5 CMS. Ora puoi procedere al passaggio successivo.

Accedi all'interfaccia web di Concrete5 CMS

Ora, apri il tuo browser web e accedi all'interfaccia web di Concrete5 CMS utilizzando l'URL http://concrete5.example.com. Verrai reindirizzato alla seguente pagina:

Seleziona la tua lingua e fai clic sul pulsante Freccia. Dovresti vedere la seguente pagina:

Assicurati che tutte le librerie richieste siano installate, quindi fai clic sul pulsante Continua con l'installazione, dovresti vedere la seguente pagina:

Qui, fornire nome utente amministratore, password, nome utente database, password e nome database, quindi fare clic sul pulsante Installa Concrete5 per avviare l'installazione. Una volta completata l'installazione, dovresti vedere la seguente pagina:

Ora, fai clic sul pulsante Modifica il tuo sito, dovresti vedere la dashboard di Concrete5 nella pagina seguente:

Proteggi Concrete5 con Lets Encrypt SSL

Successivamente, si consiglia di proteggere il proprio sito Web con Lets Encrypt SSL. Innanzitutto, installa il client Certbot utilizzando 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 concrete5.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 concrete5.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/concrete5-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/concrete5-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/concrete5-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/concrete5.conf to ssl vhost in /etc/apache2/sites-available/concrete5-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://concrete5.example.com

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/concrete5.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/concrete5.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 a Concrete 5 in modo sicuro utilizzando l'URL https://concrete5.example.com.

Conclusione

Nella guida sopra, hai imparato come installare Concrete5 CMS con Apache e Lets Encrypt SSL su Ubuntu 20.04. Ora puoi pubblicare facilmente i tuoi contenuti su Internet utilizzando il CMS Concrete5. Non esitate a chiedermi se avete domande.