Install Flarum Forum di Ubuntu 20.04
Flarum adalah software free dan open source untuk membuat forum diskusi, terinspirasi dari esoTalk dan FluxBB. Flarum dirancang dengan target menjadi platform forum diskusi yang cepat dan mudah dalam deploy tidak ada kompleksitas dependensi library, keren dan responsive, dapat dikustomisasi, serta gratis dan terbuka.
Demo Flarum dapat dilihat di halaman support Flarum.
Server Requirements
Minimum server requirements untuk menjalankan Flarum:
- Web server: Apache atau Nginx
- PHP: v7.3+ dengan extension curl, dom, fileinfo, gd, json, mbstring, openssl, pdo_mysql, tokenizer, zip
- Database: MySQL 5.6+/8.0.23+ atau MariaDB 10.0.5+
- Composer
Pada tutorial ini menggunakan:
- OS Ubuntu 20.04
- Apache web server
- PHP v7.4
- Composer v2.3.9
- MariaDB 10.3
- SSL Let’s Encrypt
- Subdomain flarum.musaamin.my.id
- Flarum v1.3.1
Install Apache
Install Apache web server.
1 | sudo apt install apache2 -y |
Install MariaDB
Install MariaDB database.
1 | sudo apt install mariadb-server -y |
Menjalankan mysql_secure_installation.
1 | sudo mysql_secure_installation |
Jawab pertanyaan.
1 2 3 4 5 6 7 8 | Enter current password for root (enter for none): ENTER Set root password? [Y/n] ENTER New password: MASUKKAN_PASSWORD Re-enter new password: MASUKKAN_PASSWORD Remove anonymous users? [Y/n] ENTER Disallow root login remotely? [Y/n] ENTER Remove test database and access to it? [Y/n] ENTER Reload privilege tables now? [Y/n] ENTER |
Login ke MariaDB.
1 | sudo mysql |
Membuat database untuk Flarum.
1 2 3 4 | CREATE DATABASE flarum; GRANT ALL PRIVILEGES ON flarum.* TO flarum@localhost IDENTIFIED BY 'rahasia'; FLUSH PRIVILEGES; exit |
Install PHP
Install PHP dan extension yang dibutuhkan.
1 | sudo apt install php php-common php-cli php-mysql libapache2-mod-php php-gd php-curl php-json php-xmlrpc php-intl php-bcmath php-zip php-apcu php-mbstring php-fileinfo php-xml php-soap php-tokenizer -y |
Install Composer
Install Composer.
1 2 3 | sudo apt install unzip -y curl https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer |
Membuat Project Flarum
Membuat folder untuk Flarum.
1 2 | sudo mkdir -p /var/www/{.cache,flarum} sudo chown -R www-data:www-data /var/www/{.cache,flarum} |
Membuat project Flarum dengan menggunakan composer.
1 2 | cd /var/www/flarum sudo -u www-data composer create-project flarum/flarum . |
Konfigurasi Apache Virtual Host
Membuat file konfigurasi virtual host Flarum.
1 | sudo nano /etc/apache2/sites-available/flarum.conf |
Masukkan konfigurasi virtual host.
1 2 3 4 5 6 7 8 9 10 11 12 13 | <VirtualHost *:80> ServerName flarum.musaamin.my.id DocumentRoot /var/www/flarum/public <Directory /var/www/flarum/public> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/flarum_error.log CustomLog /var/log/apache2/flarum_access.log combined </VirtualHost> |
Mengaktifkan modul rewrite di Apache.
1 | sudo a2enmod rewrite |
Mengaktifkan virtual host Flarum.
1 | sudo a2ensite flarum.conf |
Restart Apache dan cek statusnya.
1 2 | sudo systemctl restart apache2 sudo systemctl status apache2 |
Browse http://flarum.musaamin.my.id, ditampilkan Install Flarum, tetapi masih protokol HTTP.
Install SSL Let’s Encrypt
Install certbot Let’s Encrypt untuk memasang SSL (HTTPS).
1 | sudo apt install certbot python3-certbot-apache -y |
Request SSL untuk domain Flarum.
1 | sudo certbot --non-interactive -m trial@musaamin.web.id --agree-tos --no-eff-email --apache -d flarum.musaamin.my.id --redirect |
Browse https://flarum.musaamin.my.id.
Install Flarum
Masukkan judul forum, akses database, dan akun admin.
- Forum Title = misal Forum MusaAmin.my.id
- MySQL Database = flarum
- MySQL Username = flarum
- MySQL Password = rahasia
- Admin Username = misal admin
- Admin Email = misal [email protected]
- Admin Password = misal rahasia
- Confirm Password = ulangi password-nya
Klik Install Flarum.
Flarum sudah terinstall.
Selamat mencoba 🙂