• Linux

    Install phpMyAdmin pada Ubuntu 18.04

    Sebelum melakukan instalasi, pastikan untuk melakukan update repository.

    sudo apt update
    sudo apt upgrad

    Install phpMyAdmin dan package pendukungnya serta masukkan konfigurasi untuk phpMyAdmin.

    sudo apt install phpmyadmin php-mbstring php-gettext 

    Jika instalasi selesai, hidupkan php extension untuk mbstring dan restart apache service.

    sudo phpenmod mbstring
    sudo systemctl restart apache2

    Edit file apache2.conf

    sudo nano /etc/apache2/apache2.conf 

    Tambahkan kode berikut ini pada akhir file:

    # phpMyAdmin Configuration
    Include /etc/phpmyadmin/apache.conf

    Restart apache service.

  • Linux

    Reverse Proxy

    Nyalakan module yang diperlukan pada apache.

    sudo a2enmod proxy 
    sudo a2enmod proxy_http
    sudo a2enmod proxy_balancer
    sudo a2enmod lbmethod_byrequests

    Restart apache server.

    sudo systemctl restart apache2 

    Buat virtulhost.

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName
      ProxyPreserveHost On ProxyPass / http://192.168.0.2:80/
    ProxyPassReverse / http://192.168.0.2:80/
    </VirtualHost>

    Restart apache.

    sudo systemctl restart apache2
  • RaspberryPi

    Cross-compilation Qt 5.9.6 for RaspberryPi

    Persiapan Raspberry Pi

    Update package

    Edit sources list /etc/apt/sources.list, kemudian uncomment baris deb-src:

    sudo nano /etc/apt/sources.list
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo reboot

    Update Raspberry Pi firmware

    sudo rpi-update
    sudo reboot

    Install dependencies

    sudo apt-get build-dep qt4-x11
    sudo apt-get build-dep libqt5gui5
    sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0

    Persiapan Linux Host

    Pada tutorial ini digunakan Ubuntu 16.04 x64.

    Update package

    sudo apt-get update
    sudo apt-get -y upgrade

    Install dependencies

    sudo apt-get install git bison python gperf

    Buat folder kerja

    sudo mkdir /opt/qt5pi
    sudo chown akhal:akhal /opt/qt5pi
    cd /opt/qt5pi

    Clone toolchain

    git clone https://github.com/raspberrypi/tools

    Tambahkan toolchain binary di variabel PATH

    nano ~/.bashrc

    Tambahkan baris berikut:

    export PATH=$PATH:/opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin

    Download QT Source

    https://download.qt.io/official_releases/qt/5.9/5.9.6/single/qt-everywhere-opensource-src-5.9.6.tar.xz

    Untar QT source

    tar -xvf t-everywhere-opensource-src-5.9.6.tar.xz

    Buat hf configuration

    cp -R qt-everywhere-opensource-src-5.9.6/qtbase/mkspecs/linux-arm-gnueabi-g++ qt-everywhere-opensource-src-5.9.6/qtbase/mkspecs/linux-arm-gnueabihf-g++
    sed -i -e 's/arm-linux-gnueabi-/arm-linux-gnueabihf-/g' qt-everywhere-opensource-src-5.9.6/qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf

    Copy raspberry pi sysroot

    mkdir sysroot sysroot/usr sysroot/opt
    rsync -avz akhal@192.168.1.100:/lib sysroot
    rsync -avz akhal@192.168.1.100:/usr/include sysroot/usr
    rsync -avz akhal@192.168.1.100:/usr/lib sysroot/usr
    rsync -avz akhal@192.168.1.100:/opt/vc sysroot/opt

    Buat symlinks to “missing” libraries

    mv sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0_backup
    ln -s sysroot/opt/vc/lib/libEGL.so sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0
    mv sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0_backup
    ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
    ln -s sysroot/opt/vc/lib/libEGL.so sysroot/opt/vc/lib/libEGL.so.1
    ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/opt/vc/lib/libGLESv2.so.2

    Ganti absolute symlinks dalam bentuk relative symlinks

    wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
    chmod +x sysroot-relativelinks.py
    ./sysroot-relativelinks.py sysroot

    Buat folder untuk build

    mkdir qt5build
    cd qt5build

    Konfigurasi QT Source

    ../qt-everywhere-opensource-src-5.9.6/configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtwebengine -skip qtscript -nomake examples -make libs -v

    Jika muncul error unknown CPU architecture ketika konfigurasi, tambahkan baris -no-use-gold-linker sehingga menjadi:

    ../qt-everywhere-opensource-src-5.9.6/configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtwebengine -skip qtscript -nomake examples -make libs -v -no-use-gold-linker

    Make

    Jika konfigurasi sudah selesai, jalankan perintah make.

    make
    make install

    Upload hasil compile ke Raspberry Pi

    cd /opt/qt5pi
    rsync -avz sysroot/usr/local/qt5pi akhal@192.168.1.100:/usr/local

    Konfigurasi Pada QT Creator

    Install QT

    Konfigurasi toolkit

    Buka QT Creator, kemudian pilih option dan tambahkan parameter-parameter berikut:

    • Tools->Options…->Devices->Add
      Generic Linux Device
      Edit host, username, dan password.
    • Tools->Build&Run->Debuggers->Add
      Edit name dan path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gdb )
    • Tools->Compilers->Add->GCC->C
      Edit name dan path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc )
    • Tools->Compilers->Add->GCC->C++
      Edit name dan path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ )
    • Tools->Qt Versions->Add
      Pilih /opt/qt5pi/sysroot/usr/local/qt5pi/bin/qmake
    • Tools->Kits->Add
      Edit name
      Device type: Generic Linux Device
      Device: raspberry pi device
      Sysroot: Choose /opt/qt5pi/sysroot
      C and C++: Choose prior created raspberry pi compilers
      Debugger: Choose prior created raspberry pi debugger
      Qt version: Choose prior created raspberry pi qt version

    Selesai

  • Linux

    Configure Static IP Addresses on Ubuntu 18.04 LTS Server

    Untuk mengganti ip pada Ubuntu server 18.04, dapat menggunakan NetPlan. Pertama-tama, lihat network device dengan menggunakan perintah ip addr. Misal yang akan diganti adalah eth0.
    Langkah selanjutnya buat file 01-netcfg.yaml di folder /etc/netplan.

    sudo nano /etc/netplan/01-netcfg.yaml

    Untuk mengganti ip address, tuliskan baris berikut:

    # This file describes the network interfaces available on your system
    # For more information, see netplan(5).
    network:
     version: 2
     renderer: networkd
     ethernets:
       eth0:
         dhcp4: no
         dhcp6: no
         addresses: [192.168.1.2/24]
         gateway4: 192.168.1.1
         nameservers:
           addresses: [8.8.8.8,8.8.4.4]

    Keluar dari editor, kemudian jalankan command berikut ini:

    sudo netplan apply
  • Linux

    Locale Issue on Ubuntu

    Error message:

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = (unset),
            LC_ALL = (unset),
            LC_TIME = "id_ID.UTF-8",
            LC_MONETARY = "id_ID.UTF-8",
            LC_ADDRESS = "id_ID.UTF-8",
            LC_TELEPHONE = "id_ID.UTF-8",
            LC_NAME = "id_ID.UTF-8",
            LC_MEASUREMENT = "id_ID.UTF-8",
            LC_IDENTIFICATION = "id_ID.UTF-8",
            LC_NUMERIC = "id_ID.UTF-8",
            LC_PAPER = "id_ID.UTF-8",
            LANG = "en_US.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
    locale: Cannot set LC_ALL to default locale: No such file or directory

    Edit bashrc:

    nano ~/.bashrc

    Tambahkan code berikut:

    export LC_ALL="en_US.UTF-8"
  • Linux

    Fujitsu Touchpad Not Working In Ubuntu 18.04

    Untuk mengatasi masalah touchpad yang tidak berfungsi, dapat dilakukan dengan menambahkan i8042.notimeout i8042.nomux pada grub.
    Edit parameter grub.

    sudo gedit /etc/default/grub

    Edit baris berikut GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" sehingga menjadi:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.notimeout i8042.nomux"

    Update grub:

    sudo update-grub

    Langkah terakhir, reboot system.

  • Linux

    Install Apache, MySQL dan PHP pada Ubuntu 16.04

    1. Update package manager.
      sudo apt-get update
    2. Install dan jalankan apache.
      sudo apt-get install apache2
      sudo systemctl start apache2.service
    3. Install MySQL.
      sudo apt-get install mysql-server
      sudo /usr/bin/mysql_secure_installation
    4. Install php.
      sudo apt-get install php

      Install PHP extensions GD, MySQL.

      sudo apt-get install -y php-{bcmath,bz2,intl,gd,mbstring,mcrypt,mysql,zip} && sudo apt-get install libapache2-mod-php -y
    5. Setting auto start untuk Apache dan MySQL.
      sudo systemctl enable apache2.service
      sudo systemctl enable mysql.service

      Restart Apache untuk menjalankan PHP.

      systemctl restart apache2.service
  • Linux

    Client does not support any combination of challenges that will satisfy the CA

    It is because Let’s Encrypt has currently disabled the TLS-SNI-01 challenge due to an identified security issue.

    Solution

    If you’re serving files for that domain out of a directory on that server, you can run the following command:

    certbot --authenticator webroot --webroot-path --installer nginx -d

    If you’re not serving files out of a directory on the server, you can temporarily stop your server while you obtain the certificate and restart it after Certbot has obtained the certificate. This would look like:

    certbot --authenticator standalone --installer nginx -d --pre-hook "service nginx stop" --post-hook "service nginx start"

    If using apache:

    certbot --authenticator standalone --installer apache -d --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"

    or

    apache2ctl stop
    letsencrypt --authenticator standalone --installer apache -d your.domain
  • Linux

    Let’s Encrypt & Apache pada Ubuntu 16.04

    Let’s Encrypt merupakan open Certificate Authority yang bersifat gratis. Layanan ini The service disediakan oleh Internet Security Research Group.

    Let’s Encrypt Client/Certbot

    Certbot adalah istilah untuk client yang digunakan untuk mengatur Let’s Encrypt certificates pada server.

    Certbot on Ubuntu 16.04 Xenial

    Pada ubuntu, package untuk certbot menggunakan nama python-letsencrypt-apache. Ketik command berikut install:

    sudo apt-get install python-letsencrypt-apache
    Set Up a New Cert: Apache

    Sebelum menjalankan Certbot, jangan lupa untuk membuka port yang digunakan. Untuk menjalankan Certbot/Letsencrypt, jalankan command berikut kemudian ikuti langkah-langkah yang ditunjukkan pada dialog info.

    sudo letsencrypt --apache

    Daftar domain yang muncul berdasarkan konfigurasi pada /etc/apache2/sites-available

    Renew Certificate

    Test renewal:

    letsencrypt renew --dry-run --agree-tos

    Jika berhasil, jalankan command berikut:

    letsencrypt renew --agree-tos

    let’s Encrypt menyarankan menjalankan script ini dua kali sehari sebagai cron job. Sertifikat dari let’s Encrypt berlaku selama 90 hari. Renewal tidak akan dilakukan kecuali sertifikat mendekati expiry date.

    Cara Lain:

    sudo apt install python3-certbot-apache
    sudo certbot --apache -d yourdomain.com