ElkArte è un potente software per forum gratuito, open source che ti consente di creare la tua community di forum online. È una piattaforma forum semplice, leggera e moderna basata su PHP e utilizza MySQL/MariaDB per archiviare i suoi dati. ElkArte viene fornito con una ricca serie di funzionalità tra cui Notifiche, Mi piace per i post, Bozze, Salvataggio automatico, Trascina e rilascia file allegati, Incorporamento video integrato per YouTube, Pubblicazione via e-mail, Misure anti-spam migliorate e molto altro.
In questo tutorial, spiegheremo come installare ElkArte su server Debian 10.
Requisiti
- Un server che esegue Debian 10.
- È stata impostata una password di root sul tuo server.
Per iniziare
Prima di iniziare, dovrai aggiornare il tuo sistema con l'ultima versione. Puoi farlo eseguendo il seguente comando:
apt-get update -y
apt-get upgrade -y
Una volta aggiornato il server, riavvia il server per applicare le modifiche.
Installa Apache, MariaDB e PHP
Innanzitutto, dovrai installare il server Web Apache, il server di database MariaDB, PHP e altre librerie richieste sul tuo server. Puoi installarli tutti eseguendo il seguente comando:
apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-pgsql php-xml php-cli php-imagick php-bcmath php-gmp php-zip unzip -y
Una volta installati tutti i pacchetti, apri il file php.ini e modifica alcune impostazioni:
nano /etc/php/7.3/apache2/php.ini
Modifica le seguenti righe:
memory_limit = 256M upload_max_filesize = 100M max_execution_time = 360 date.timezone = America/Chicago
Salva e chiudi il file quando hai finito. Quindi, riavvia il server web Apache con il seguente comando:
systemctl restart apache2
Configura database per ElkArte
Successivamente, dovrai creare un database e un utente per ElkArte. Per farlo, accedi alla shell di MariaDB con il seguente comando:
mysql -u root -p
Fornisci la tua password di root quando richiesto, quindi crea un database e un utente con il seguente comando:
MariaDB [(none)]> CREATE DATABASE elkartedb;
MariaDB [(none)]> CREATE USER 'elkarte'@'localhost' IDENTIFIED BY 'password';
Quindi, concedi tutti i privilegi a ElkArte con il seguente comando:
MariaDB [(none)]> GRANT ALL ON elkartedb.* TO 'elkarte'@'localhost' WITH GRANT OPTION;
Quindi, svuota i privilegi ed esci dalla shell MariaDB con il seguente comando:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Una volta terminato, puoi procedere al passaggio successivo.
Scarica ElkArte
Innanzitutto, dovrai scaricare l'ultima versione di ElkArte dal repository Git. Per scaricarlo, esegui il seguente comando:
wget https://github.com/elkarte/Elkarte/archive/master.zip
Una volta completato il download, decomprimere il file scaricato con il seguente comando:
unzip master.zip
Quindi, sposta la directory estratta nella directory principale web di Apache:
mv Elkarte-master /var/www/html/elkarte
Quindi, cambia la proprietà della directory elkarte e fornisci le autorizzazioni necessarie con il seguente comando:
chown -R www-data:www-data /var/www/html/elkarte
chmod -R 755 /var/www/html/elkarte
Una volta terminato, puoi procedere al passaggio successivo.
Crea host virtuale per ElkArte
Successivamente, dovrai creare un file di configurazione dell'host virtuale Apache per servire ElkArte. Puoi crearlo con il seguente comando:
nano /etc/apache2/sites-available/elkarte.conf
Aggiungi le seguenti righe:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/elkarte ServerName example.com <Directory /var/www/html/elkarte/> 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 quando hai finito. Quindi, abilita il file host virtuale e il modulo di riscrittura di Apache con il seguente comando:
a2ensite elkarte.conf
a2enmod rewrite
Infine, riavvia il server web Apache per applicare le modifiche:
systemctl restart apache2
Accedi all'interfaccia web di ElkArte
ElkArte è ora installato e configurato. È ora di accedere all'interfaccia web di ElkArte.
Apri il tuo browser web e digita l'URL http://example.com . Verrai reindirizzato alla pagina di benvenuto di ElkArte:
Fai clic su Continua pulsante. Dovresti vedere la seguente pagina:
Fornisci il nome del database, il nome utente del database, la password e fai clic su Continua pulsante. Dovresti vedere la seguente pagina:
Fornisci il nome del forum, l'URL del forum e fai clic sul pulsante Continua. Dovresti vedere la seguente pagina:
Ora, fai clic su Continua pulsante. Dovresti vedere la pagina di creazione dell'amministratore:
Fornisci il nome dell'amministratore, la password, l'e-mail e la password del database desiderati e fai clic su Continua pulsante. Una volta terminata l'installazione, dovresti vedere la seguente pagina:
Ora, fai clic su "il tuo forum appena installato ". Dovresti vedere la dashboard di ElkArte nella pagina seguente:
Proteggi ElkArte con Let's Encrypt
Innanzitutto, dovrai installare Certbot sul tuo server. Certbot viene utilizzato per ottenere un certificato SSL da Let's Encrypt e configurare Apache per utilizzare questo certificato.
Per impostazione predefinita, l'ultima versione di Certbot non è disponibile nel repository predefinito di Debian 10. Quindi dovrai aggiungere il repository Certbot sul tuo server.
Innanzitutto, aggiungi il repository Certbot con il seguente comando:
add-apt-repository ppa:certbot/certbot
Una volta aggiunto il repository, aggiorna il repository e installa Certbot con il seguente comando:
apt-get update -y
apt-get install certbot python-certbot-apache -y
Certbot è ora installato e pronto per l'uso.
Esegui il seguente comando per ottenere il certificato SSL per il tuo dominio:
certbot --apache -d example.com
Innanzitutto, dovrai fornire un indirizzo email valido e accettare i termini di 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 example.com Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/example.com-le-ssl.conf Deploying Certificate to VirtualHost /etc/apache2/sites-available/example.com-le-ssl.conf Enabling available site: /etc/apache2/sites-available/example.com-le-ssl.conf 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
Quindi, scegli l'opzione 2 per scaricare e installare il certificato SSL gratuito per il tuo dominio. Una volta che l'installazione è stata completata con successo. Dovresti ottenere il seguente output:
Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/example.com.conf to ssl vhost in /etc/apache2/sites-available/ example.com-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://example.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/example.com/privkey.pem Your cert will expire on 2019-10-22. 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
Congratulazioni! il tuo ElkArte è ora protetto con il certificato SSL. Ora puoi accedervi in modo sicuro visitando l'URL https://example.com .