GNU/Linux >> Belajar Linux >  >> Ubuntu

Cara Menginstal Platform Jejaring Sosial Friendica di Ubuntu 20.04

Friendica adalah platform jejaring sosial gratis, open-source dan terdesentralisasi yang membantu Anda membangun dan memelihara proyek jejaring sosial Anda sendiri. Ini memiliki dukungan bawaan untuk ActivityPub termasuk, Mastodon, Hubzilla, OStatus, Pleroma dan banyak lagi. Ini memungkinkan Anda untuk mengimpor situs web dan blog Anda ke aliran sosial Anda melalui umpan RSS/Atom. Ini menyediakan dasbor pengguna dan admin yang kuat yang membantu Anda mengelola jaringan sosial Anda dari perangkat apa pun.

Dalam tutorial ini, kami akan menunjukkan cara menginstal Friendica dengan Apache dan Let's Encrypt SSL di Ubuntu 20.04.

Prasyarat

  • Server yang menjalankan Ubuntu 20.04.
  • Nama domain valid yang ditunjukkan dengan IP server Anda.
  • Sandi root dikonfigurasi untuk server.

Memulai

Sebelum memulai, Anda perlu memperbarui paket sistem Anda ke versi terbaru. Anda dapat memperbaruinya menggunakan perintah berikut:

apt-get update -y

Setelah server Anda diperbarui, Anda dapat melanjutkan ke langkah berikutnya.

Instal Server LAMP

Friendica berjalan di server web, ditulis dalam PHP dan menggunakan MySQL sebagai database backend. Jadi tumpukan LAMP harus diinstal di sistem Anda. Jika belum terinstal, Anda dapat menginstalnya dengan perintah berikut:

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

Setelah semua paket terinstal, edit file php.ini dan buat beberapa perubahan:

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

Ubah baris berikut:

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

Simpan dan tutup file setelah Anda selesai.

Buat Basis Data Friendica

Selanjutnya, Anda perlu membuat database dan pengguna untuk Friendica. Pertama, sambungkan ke MySQL dengan perintah berikut:

mysql

Setelah terhubung, buat database dan pengguna dengan perintah berikut:

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

Selanjutnya, berikan semua hak istimewa ke database Friendica dengan perintah berikut:

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

Selanjutnya, flush hak istimewa dan keluar dari MySQL dengan perintah berikut:

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

Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.

Unduh Friendica

Sebelum mengunduh Friendica, Anda harus menginstal Komposer di sistem Anda. Anda dapat menginstalnya dengan perintah berikut:

apt-get install composer -y

Setelah terinstal, ubah direktori ke root web Apache dan unduh versi terbaru Friendica dari repositori Git:

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

Setelah unduhan selesai, ubah direktori ke friendica dan instal dependensi PHP yang diperlukan dengan perintah berikut:

cd friendica
composer install --no-dev

Selanjutnya, unduh add-on Friendica dengan perintah berikut:

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

Selanjutnya, atur kepemilikan dan izin yang tepat ke direktori friendica:

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

Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.

Konfigurasi Apache untuk Friendica

Selanjutnya, Anda perlu membuat file konfigurasi virtual host Apache untuk meng-host Friendica. Anda dapat membuatnya dengan perintah berikut:

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

Tambahkan baris berikut:

<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>

Simpan dan tutup file kemudian aktifkan Apache virtual host dan rewrite module dengan perintah berikut:

a2ensite friendica.conf
a2enmod rewrite

Selanjutnya, muat ulang layanan Apache untuk menerapkan perubahan:

systemctl restart apache2

Anda dapat memverifikasi status layanan Apache dengan perintah berikut:

systemctl status apache2

Anda akan mendapatkan output berikut:

? 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...

Mengakses Dasbor Friendica

Sekarang, buka browser web Anda dan akses antarmuka web Friendica menggunakan URL http://friendica.example.com . Anda akan diarahkan ke halaman pemeriksaan sistem:

Pastikan semua dependensi PHP sudah terinstall lalu klik tombol Next tombol. Anda akan melihat halaman berikut:

Berikan nama domain Anda, jalur penginstalan, dan klik Kirim tombol. Anda akan melihat halaman berikut:

Berikan nama basis data, nama pengguna basis data, kata sandi Anda dan klik tombol Kirim . Anda akan melihat halaman pengaturan Situs:

Berikan email administrator, bahasa, zona waktu, dan klik Kirim tombol. Setelah instalasi selesai, Anda akan melihat halaman berikut:

Sekarang, klik pendaftaran tombol halaman dan selesaikan proses pendaftaran untuk mengakses Friendica.

Amankan Friendica dengan Let's Encrypt SSL

Itu selalu merupakan ide yang baik untuk mengamankan situs web Anda dengan Let's Encrypt SSL. Anda perlu menginstal klien Certbot untuk menginstal dan mengelola SSL. Anda dapat menginstalnya dengan perintah berikut:

apt-get install python3-certbot-apache -y

Setelah Certbot terinstal, jalankan perintah berikut untuk mengamankan situs web Anda dengan Let's Encrypt SSL:

certbot --apache -d friendica.example.com

Anda akan diminta untuk memberikan email Anda dan menerima persyaratan layanan seperti yang ditunjukkan di bawah ini:

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

Selanjutnya, pilih apakah akan mengarahkan lalu lintas HTTP ke HTTPS seperti yang ditunjukkan di bawah ini:

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

Ketik 2 dan tekan Enter untuk menginstal Let's Encrypt SSL untuk situs web Anda:

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

Sekarang, Anda dapat mengakses situs web Anda dengan aman menggunakan URL https://friendica.example.com.

Kesimpulan

Selamat! Anda telah berhasil menginstal dan mengkonfigurasi platform jejaring sosial Friendica di server Ubuntu 20.04. Sekarang Anda dapat mengelola komunitas jejaring sosial Anda dari lokasi pusat.


Ubuntu
  1. Cara Menginstal Logstash di Ubuntu 18.04

  2. Cara Menginstal Platform eCommerce Bagisto di Ubuntu 20.04

  3. Cara Menginstal R di Ubuntu 18.04

  1. Cara Memasang Jaringan Sosial Elgg di Ubuntu 18.04 LTS

  2. Cara Menginstal Plone CMS di Ubuntu 18.04

  3. Cara Menginstal platform eCommerce Cezerin di Ubuntu 18.04 LTS

  1. Cara Menginstal FlintCMS di Ubuntu 18.04 LTS

  2. Cara Menginstal Memcached di Ubuntu 20.04 LTS

  3. Cara Menginstal platform e-commerce LiteCart di Ubuntu 20.04 LTS