GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Come installare la piattaforma di social network Friendica su Ubuntu 20.04

Friendica è una piattaforma di social networking gratuita, open source e decentralizzata che ti aiuta a costruire e mantenere i tuoi progetti di social network. Ha il supporto integrato per ActivityPub tra cui Mastodon, Hubzilla, OSstatus, Pleroma e altro. Ti consente di importare i tuoi siti Web e blog nel tuo flusso social tramite feed RSS/Atom. Fornisce una potente dashboard per utenti e amministratori che ti aiuta a gestire il tuo social network da qualsiasi dispositivo.

In questo tutorial, ti mostreremo come installare Friendica con 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

Prima di iniziare, dovrai aggiornare i pacchetti di sistema all'ultima versione. Puoi aggiornarli usando il seguente comando:

apt-get update -y

Una volta aggiornato il tuo server, puoi procedere al passaggio successivo.

Installa il server LAMP

Friendica gira su webserver, scritto in PHP e usa MySQL come database backend. Quindi lo stack LAMP deve essere installato nel tuo sistema. Se non è installato, puoi installarlo 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-imagick php-xml php-cli php-zip php-sqlite3 curl git -y

Una volta installati tutti i pacchetti, modifica il file php.ini e apporta alcune modifiche:

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

Modifica le seguenti righe:

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 300
max_input_vars = 1500
date.timezone = Asia/Kolkata

Salva e chiudi il file quando hai finito.

Crea un database di Friendica

Successivamente, dovrai creare un database e un utente per Friendica. Innanzitutto, connettiti a MySQL con il seguente comando:

mysql

Una volta connesso, crea un database e un utente con il seguente comando:

MariaDB [(none)]> CREATE DATABASE friendicadb;
MariaDB [(none)]> CREATE USER 'friendica'@'localhost' IDENTIFIED BY 'password';

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

MariaDB [(none)]> GRANT ALL ON friendicadb.* TO 'friendica'@'localhost' WITH GRANT OPTION;

Quindi, svuota i privilegi ed esci da MySQL con il seguente comando:

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

Una volta terminato, puoi procedere al passaggio successivo.

Scarica Friendica

Prima di scaricare Friendica, dovrai installare Composer nel tuo sistema. Puoi installarlo con il seguente comando:

apt-get install composer -y

Una volta installato, cambia la directory in Apache web root e scarica l'ultima versione di Friendica dal repository Git:

cd /var/www/html
git clone https://github.com/friendica/friendica.git

Una volta completato il download, cambia la directory in friendica e installa le dipendenze PHP richieste con il seguente comando:

cd friendica
composer install --no-dev

Quindi, scarica i componenti aggiuntivi di Friendica con il seguente comando:

git clone https://github.com/friendica/friendica-addons.git

Quindi, imposta la proprietà e l'autorizzazione appropriate per la directory friendica:

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

Una volta terminato, puoi procedere al passaggio successivo.

Configura Apache per Friendica

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

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

Aggiungi le seguenti righe:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/friendica
     ServerName friendica.example.com


     <Directory /var/www/html/friendica/>
        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 l'host virtuale Apache e riscrivi il modulo con il seguente comando:

a2ensite friendica.conf
a2enmod rewrite

Quindi, ricarica il servizio Apache per applicare le modifiche:

systemctl restart apache2

Puoi verificare lo stato del servizio Apache con 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 Sun 2021-02-07 09:20:58 UTC; 6s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 33243 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 33259 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 15.1M
     CGroup: /system.slice/apache2.service
             ??33259 /usr/sbin/apache2 -k start
             ??33260 /usr/sbin/apache2 -k start
             ??33261 /usr/sbin/apache2 -k start
             ??33262 /usr/sbin/apache2 -k start
             ??33263 /usr/sbin/apache2 -k start
             ??33264 /usr/sbin/apache2 -k start

Feb 07 09:20:58 ubuntu2004 systemd[1]: Starting The Apache HTTP Server...

Accedi alla dashboard di Friendica

Ora apri il tuo browser web e accedi all'interfaccia web di Friendica utilizzando l'URL http://friendica.example.com . Verrai reindirizzato alla pagina di controllo del sistema:

Assicurati che tutte le dipendenze PHP siano installate, quindi fai clic su Avanti pulsante. Dovresti vedere la seguente pagina:

Fornisci il tuo nome di dominio, il percorso di installazione e fai clic su Invia pulsante. Dovresti vedere la seguente pagina:

Fornisci il nome del database, il nome utente del database, la password e fai clic su Invia . Dovresti vedere la pagina delle impostazioni del sito:

Fornisci l'e-mail dell'amministratore, la lingua, il fuso orario e fai clic su Invia pulsante. Una volta completata l'installazione, dovresti vedere la seguente pagina:

Ora, fai clic su registrazione pulsante pagina e completa la procedura di registrazione per accedere ad Friendica.

Proteggi Friendica con Let's Encrypt SSL

È sempre una buona idea proteggere il tuo sito Web con Let's Encrypt SSL. Sarà necessario installare il client Certbot per installare e gestire SSL. Puoi installarlo con il seguente comando:

apt-get install python3-certbot-apache -y

Una volta installato Certbot, esegui il comando seguente per proteggere il tuo sito Web con Let's Encrypt SSL:

certbot --apache -d friendica.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 friendica.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/friendica-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/friendica-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/friendica-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/friendica.conf to ssl vhost in /etc/apache2/sites-available/friendica-le-ssl.conf

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

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

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

Conclusione

Congratulazioni! hai installato e configurato correttamente la piattaforma di social network Friendica sul server Ubuntu 20.04. Ora puoi gestire la tua community di social network dalla posizione centrale.


Ubuntu
  1. Come installare Elgg Social Network su Ubuntu 18.04 LTS

  2. Come installare Plone CMS su Ubuntu 18.04

  3. Come installare Logstash su Ubuntu 18.04

  4. Come installare la piattaforma eCommerce Bagisto su Ubuntu 20.04

  5. Come installare R su Ubuntu 18.04

Come installare Usermin su Ubuntu 20.04

Come installare Podman su Ubuntu 20.04

Come installare OpenCV su Ubuntu 20.04

Come installare Sysdig su Ubuntu 20.04

Come installare il social network open source su Ubuntu 16.04

Come installare Elgg Social Network su Ubuntu 20.04