<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kawanua Indie Developer</title>
    <description>The latest articles on DEV Community by Kawanua Indie Developer (@kawanuaid).</description>
    <link>https://dev.to/kawanuaid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F3814%2Ffa9fd2ce-b110-4e31-b3b7-f6d45baa80a6.png</url>
      <title>DEV Community: Kawanua Indie Developer</title>
      <link>https://dev.to/kawanuaid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kawanuaid"/>
    <language>en</language>
    <item>
      <title>Cara install Searx metasearch engine di Ubuntu 18.04</title>
      <dc:creator>Erol Joudy</dc:creator>
      <pubDate>Fri, 19 Mar 2021 20:16:20 +0000</pubDate>
      <link>https://dev.to/kawanuaid/cara-install-searx-metasearch-engine-di-ubuntu-18-04-13fi</link>
      <guid>https://dev.to/kawanuaid/cara-install-searx-metasearch-engine-di-ubuntu-18-04-13fi</guid>
      <description>&lt;p&gt;Searx adalah sebuah metasearch engine, yang tampilan hasil pencariannya adalah gabungan data pencarian milik beberapa search engine sekaligus. Cara kerjanya adalah, sesaat ketika pengguna mengirimkan input berupa keyword (kata kunci), pada saat bersamaan data dari beberapa search engine langsung diminta (query), untuk kemudian setelah selesai dikumpul akan langsung ditampilkan. Proses ini berjalan dengan sangat cepat.&lt;/p&gt;

&lt;p&gt;Searx merupakan produk opensoure, dan siapapun bisa dengan mudah membangun platformnya sendiri, untuk keperluan pribadi maupun bisnis.&lt;/p&gt;

&lt;p&gt;Konfigurasi VPS yang digunakan adalah sebagai berikut,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwea0tlvo9v1459vvlxo.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwea0tlvo9v1459vvlxo.jpeg" alt="Konfigurasi VPS" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Instalasi paket yg dibutuhkan
&lt;/h2&gt;

&lt;p&gt;Jalankan perintah berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Instalasi searx
&lt;/h2&gt;

&lt;p&gt;Untuk instalasi searx, jalankan perintah dibawah ini secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /usr/local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;git clone https://github.com/asciimoo/searx.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd searx &lt;span class="nt"&gt;-d&lt;/span&gt; /usr/local/searx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown &lt;/span&gt;searx:searx &lt;span class="nt"&gt;-R&lt;/span&gt; /usr/local/searx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Selanjutnya untuk instalasi dependencies, jalankan perintah dibawah secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;searx/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; searx &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dalam bash menu user &lt;code&gt;searx&lt;/code&gt;, jalankan perintah berikut secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;virtualenv searx-ve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;.&lt;/span&gt; ./searx-ve/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./manage.sh update_packages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Konfigurasi searx
&lt;/h2&gt;

&lt;p&gt;Masih dalam bash user &lt;code&gt;searx&lt;/code&gt;, jalankan perintah berikut,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"s/ultrasecretkey/&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-hex&lt;/span&gt; 16&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;/g"&lt;/span&gt; searx/settings.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit file &lt;code&gt;settings.yml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim searx/settings.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cari bagian &lt;code&gt;bind_address&lt;/code&gt; dan ubah nomor IP standar dengan IP server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;bind_address&lt;/span&gt; : &lt;span class="s2"&gt;"ISI_IP_SERVER_ANDA"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahan pada file ini, kemudian jalankan &lt;code&gt;searx&lt;/code&gt; dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python searx/webapp.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Akan muncul output seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WARNING:searx.webapp: *** Deprecation Warning ***
WARNING:searx.webapp: Python2 is deprecated
 * Serving Flask app "webapp" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
INFO:werkzeug: * Running on http://NO_IP_SERVER_ANDA:8888/ (Press CTRL+C to quit)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Cek instalasi Searx
&lt;/h2&gt;

&lt;p&gt;Buka alamat &lt;code&gt;http://NO_IP_SERVER_ANDA:8888&lt;/code&gt; pada browser, pastikan &lt;code&gt;searx&lt;/code&gt; sudah berjalan. Jika sudah, tekan Ctrl+C untuk menghentikan &lt;code&gt;searx&lt;/code&gt; dan langsung eksekusi perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"s/debug : True/debug : False/g"&lt;/span&gt; searx/settings.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keluar dari bash &lt;code&gt;searx&lt;/code&gt;, dengan mengetik &lt;code&gt;exit&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Instalasi uwsgi
&lt;/h2&gt;

&lt;p&gt;Jalankan perintah berikut untuk menginstalasi &lt;code&gt;uwsgi&lt;/code&gt; dan komponen pendukung lainnya.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;uwsgi uwsgi-plugin-python &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lalu buat file bernama &lt;code&gt;searx.ini&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vim /etc/uwsgi/apps-available/searx.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Salin dan isi dengan baris konten dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[uwsgi]&lt;/span&gt;
&lt;span class="c"&gt;# Who will run the code
&lt;/span&gt;&lt;span class="py"&gt;uid&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;searx&lt;/span&gt;
&lt;span class="py"&gt;gid&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;searx&lt;/span&gt;

&lt;span class="c"&gt;# disable logging for privacy
&lt;/span&gt;&lt;span class="py"&gt;disable-logging&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# Number of workers (usually CPU count)
&lt;/span&gt;&lt;span class="py"&gt;workers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;4&lt;/span&gt;

&lt;span class="c"&gt;# The right granted on the created socket
&lt;/span&gt;&lt;span class="py"&gt;chmod-socket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;666&lt;/span&gt;

&lt;span class="c"&gt;# Plugin to use and interpretor config
&lt;/span&gt;&lt;span class="py"&gt;single-interpreter&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;master&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;plugin&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;python&lt;/span&gt;
&lt;span class="py"&gt;lazy-apps&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;enable-threads&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# Module to import
&lt;/span&gt;&lt;span class="py"&gt;module&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;searx.webapp&lt;/span&gt;

&lt;span class="c"&gt;# Support running the module from a webserver subdirectory.
&lt;/span&gt;&lt;span class="py"&gt;route-run&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;fixpathinfo:&lt;/span&gt;

&lt;span class="c"&gt;# Virtualenv and python path
&lt;/span&gt;&lt;span class="py"&gt;virtualenv&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;/usr/local/searx/searx-ve/&lt;/span&gt;
&lt;span class="py"&gt;pythonpath&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;/usr/local/searx/&lt;/span&gt;
&lt;span class="py"&gt;chdir&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;/usr/local/searx/searx/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahan pada file diatas, kemudian jalankan perintah dibawah ini secara berurutan, guna mengaktifkan dan menjalankan &lt;code&gt;uwsgi&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /etc/uwsgi/apps-enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ../apps-available/searx.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; /etc/init.d/uwsgi restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instalasi berhasil, jika outputnya terlihat seperti ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ ok ] Restarting uwsgi (via systemctl): uwsgi.service.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Instalasi Nginx
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;uwsgi&lt;/code&gt; tidak dapat berjalan, apabila tidak ada webserver seperti Apache atau Nginx. Pada tutorial ini, webserver yang digunakan adalah Nginx.&lt;/p&gt;

&lt;p&gt;Instal &lt;code&gt;nginx&lt;/code&gt; dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Selanjutnya buatlah sebuah file yang berfungsi sebagai block server untuk &lt;code&gt;searx&lt;/code&gt; pada &lt;code&gt;nginx&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vim /etc/nginx/sites-available/searx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Isilah dengan baris konten dibawah ini.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;PERHATIAN&lt;/strong&gt;, domain yang digunakan sebagai contoh dalam artikel ini adalah &lt;code&gt;searx.contoh.com&lt;/code&gt;. Pastikan untuk menggantinya lebih dulu sebelum menyimpan perubahan pada file ini.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;server &lt;span class="o"&gt;{&lt;/span&gt;
    listen 80&lt;span class="p"&gt;;&lt;/span&gt;
    server_name searx.contoh.com&lt;span class="p"&gt;;&lt;/span&gt;
    root /usr/local/searx/searx&lt;span class="p"&gt;;&lt;/span&gt;

    location /static &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    location / &lt;span class="o"&gt;{&lt;/span&gt;
            include uwsgi_params&lt;span class="p"&gt;;&lt;/span&gt;
            uwsgi_pass unix:/run/uwsgi/app/searx/socket&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setelah disimpan, langkah selanjutnya membuat symlink dengan perintah,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart &lt;code&gt;nginx&lt;/code&gt; dan &lt;code&gt;uwsgi&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service nginx restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service uwsgi restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Langkah melindungi privasi (optional)
&lt;/h2&gt;

&lt;p&gt;Untuk keperluan privacy, nonaktifkan kemampuan untuk merekam data telemetri penggunaan pada &lt;code&gt;searx&lt;/code&gt; dengan cara memblokir log file. Jalankan langkah berikut.&lt;/p&gt;

&lt;p&gt;Edit file &lt;code&gt;/etc/nginx/sites-available/default&lt;/code&gt; dengan cara.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vim /etc/nginx/sites-available/searx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tambahkan baris dibawah ini persis dibawah baris &lt;code&gt;uwsgi_pass&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;access_log&lt;/span&gt; /&lt;span class="n"&gt;dev&lt;/span&gt;/&lt;span class="n"&gt;null&lt;/span&gt;;
&lt;span class="n"&gt;error_log&lt;/span&gt; /&lt;span class="n"&gt;dev&lt;/span&gt;/&lt;span class="n"&gt;null&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hasil akhirnya akan terlihat seperti ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;server &lt;span class="o"&gt;{&lt;/span&gt;
    listen 80&lt;span class="p"&gt;;&lt;/span&gt;
    server_name searx.contoh.com&lt;span class="p"&gt;;&lt;/span&gt;
    root /usr/local/searx/searx&lt;span class="p"&gt;;&lt;/span&gt;

    location /static &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    location / &lt;span class="o"&gt;{&lt;/span&gt;
            include uwsgi_params&lt;span class="p"&gt;;&lt;/span&gt;
            uwsgi_pass unix:/run/uwsgi/app/searx/socket&lt;span class="p"&gt;;&lt;/span&gt;
            access_log /dev/null&lt;span class="p"&gt;;&lt;/span&gt;
            error_log /dev/null&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart kembali &lt;code&gt;nginx&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service nginx restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sampai tahap ini, &lt;code&gt;searx&lt;/code&gt; sudah bisa diakses dengan menggunakan URL domain yang baru.&lt;/p&gt;

</description>
      <category>searx</category>
      <category>ubuntu</category>
      <category>linux</category>
      <category>indonesia</category>
    </item>
    <item>
      <title>Cara instalasi Matomo Web Analytics di Ubuntu 18.04</title>
      <dc:creator>Erol Joudy</dc:creator>
      <pubDate>Mon, 15 Mar 2021 18:09:16 +0000</pubDate>
      <link>https://dev.to/kawanuaid/cara-instalasi-matomo-web-analytics-di-ubuntu-18-04-202l</link>
      <guid>https://dev.to/kawanuaid/cara-instalasi-matomo-web-analytics-di-ubuntu-18-04-202l</guid>
      <description>&lt;p&gt;Matomo (sebelumnya bernama Piwik) adalah sebuah aplikasi untuk web analytics, yang saat ini populer digunakan sebagai alternatif untuk menggantikan Google Analytics. Matamo dapat melacak data pengunjung website, dan kemudian menampilkan hasilnya dalam sebuah laporan untuk di analisa. &lt;/p&gt;

&lt;p&gt;Matomo adalah sebuah aplikasi open source, dan progress pengembangannya bisa dilihat di Github. &lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/matomo-org" rel="noopener noreferrer"&gt;
        matomo-org
      &lt;/a&gt; / &lt;a href="https://github.com/matomo-org/matomo" rel="noopener noreferrer"&gt;
        matomo
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Empowering People Ethically 🚀 — Matomo is hiring! Join us → https://matomo.org/jobs Matomo is the leading open-source alternative to Google Analytics, giving you complete control and built-in privacy. Easily collect, visualise, and analyse data from websites &amp;amp; apps. Star us on GitHub ⭐️  – Pull Requests welcome! 
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Fitur yang dimiliki Matomo beberapa diantaranya adalah, A/B Testing, Heatmaps, Funnels, Tracking &amp;amp; Reporting API, Google AdWords, Facebook Ads, Bing Ads, Cost Per Click (CPC), dan masih banyak lagi.&lt;/p&gt;

&lt;p&gt;Dalam tutorial ini akan dikupas cara instalasi Matomo web analytics di Ubuntu 18.04, dengan menggunakan Nginx sebagai web server-nya, PHP7.4, MariaDB, dan untuk sertifikat SSL akan menggunakan Let’s Encrypt.&lt;/p&gt;




&lt;h2&gt;
  
  
  Instalasi dasar
&lt;/h2&gt;

&lt;p&gt;Pilih timezone tempat Anda tinggal, dengan menjalankan perintah dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg-reconfigure tzdata
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Selanjutnya lakukan instalasi beberapa dependencies.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;curl wget vim git unzip socat &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi MariaDB
&lt;/h2&gt;

&lt;p&gt;Jalankan perintah berikut untuk melakukan instalasi MariaDB.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mariadb-server &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Untuk mengecek apakah MariaDB sudah berjalan dengan normal, cek dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;● mariadb.service - MariaDB 10.1.44 database server
   Loaded: loaded &lt;span class="o"&gt;(&lt;/span&gt;/lib/systemd/system/mariadb.service&lt;span class="p"&gt;;&lt;/span&gt; enabled&lt;span class="p"&gt;;&lt;/span&gt; vendor preset: enabled&lt;span class="o"&gt;)&lt;/span&gt;
   Active: active &lt;span class="o"&gt;(&lt;/span&gt;running&lt;span class="o"&gt;)&lt;/span&gt; since 46s ago
     Docs: man:mysqld&lt;span class="o"&gt;(&lt;/span&gt;8&lt;span class="o"&gt;)&lt;/span&gt;
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 1975 &lt;span class="o"&gt;(&lt;/span&gt;mysqld&lt;span class="o"&gt;)&lt;/span&gt;
   Status: &lt;span class="s2"&gt;"Taking your SQL requests now..."&lt;/span&gt;
    Tasks: 27 &lt;span class="o"&gt;(&lt;/span&gt;limit: 658&lt;span class="o"&gt;)&lt;/span&gt;
   CGroup: /system.slice/mariadb.service
           └─1975 /usr/sbin/mysqld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Selanjutnya jalankan perintah berikut untuk mengamankan instalasi MariaDB.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Lalu jawablah semua pertanyaan yang muncul dengan konfigurasi berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Enter current password &lt;span class="k"&gt;for &lt;/span&gt;root &lt;span class="o"&gt;(&lt;/span&gt;enter &lt;span class="k"&gt;for &lt;/span&gt;none&lt;span class="o"&gt;)&lt;/span&gt;: isi_password
Change the root password? &lt;span class="o"&gt;[&lt;/span&gt;Y/n] n
Remove anonymous &lt;span class="nb"&gt;users&lt;/span&gt;? &lt;span class="o"&gt;[&lt;/span&gt;Y/n] Y
Disallow root login remotely? &lt;span class="o"&gt;[&lt;/span&gt;Y/n] Y
Remove &lt;span class="nb"&gt;test &lt;/span&gt;database and access to it? &lt;span class="o"&gt;[&lt;/span&gt;Y/n] Y
Reload privilege tables now? &lt;span class="o"&gt;[&lt;/span&gt;Y/n] Y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Buat database untuk Matomo
&lt;/h2&gt;

&lt;p&gt;Login ke MariaDB dengan menggunakan perintah,&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql &lt;span class="nt"&gt;-u&lt;/span&gt; root &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Isi password MariaDB untuk user &lt;code&gt;root&lt;/code&gt; ketika diminta, dan setelah masuk jalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE DATABASE matomodba;
CREATE USER 'matomo'@'localhost' IDENTIFIED BY 'isi-password-disini';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON matomodba.* TO 'matomo'@'localhost';
GRANT FILE ON *.* TO 'matomo'@'localhost';
FLUSH PRIVILEGES;
exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Untuk nama database &lt;code&gt;matomodba&lt;/code&gt; bisa diganti sesuai selera, namun untuk database user disarankan tetap menggunakan &lt;code&gt;matomo&lt;/code&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Instalasi PHP
&lt;/h2&gt;

&lt;p&gt;Sebelum melakukan instalasi PHP 7.4, jalankan perintah dibawah ini untuk mengaktifkan repository-nya.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;software-properties-common &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:ondrej/php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Lakukan instalasi PHP 7.4 dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;php7.4 php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-xml php7.4-xsl php7.4-zip php7.4-bz2 libapache2-mod-php7.4 &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Cek versi PHP dengan perintah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PHP 7.4.5 &lt;span class="o"&gt;(&lt;/span&gt;cli&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;built: Apr 19 2020 07:36:30&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt; NTS &lt;span class="o"&gt;)&lt;/span&gt;
Copyright &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt; The PHP Group
Zend Engine v3.4.0, Copyright &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt; Zend Technologies
    with Zend OPcache v7.4.5, Copyright &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt;, by Zend Technologies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Aktifkan firewall
&lt;/h2&gt;

&lt;p&gt;Pada tutorial ini menggunakan firewall bawaan Ubuntu yaitu &lt;code&gt;ufw&lt;/code&gt;. Aktifkan dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow OpenSSH
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi sertifikat SSL
&lt;/h2&gt;

&lt;p&gt;Tindakan mengamankan website dengan sertifikat SSL, sangatlah disarankan. Untuk memperoleh sertifikat SSL dari Let’s Encrypt, pada artikel ini akan menggunakan &lt;code&gt;acme.sh&lt;/code&gt; dan mesti diinstall terlebih dulu, dengan menjalankan perintah berikut ini secara berurutan.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /etc/letsencrypt
&lt;span class="nb"&gt;sudo &lt;/span&gt;curl https://get.acme.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Tutup terminal yang sedang digunakan, kemudian buka kembali dan lakukan pengecekan versinya,&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;acme.sh &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;https://github.com/acmesh-official/acme.sh
v2.8.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Selanjutnya, jalankan perintah dibawah ini untuk registrasi sertifikat RSA dan ECC/ECDSA untuk domain yang akan digunakan, disini akan menggunakan &lt;code&gt;contoh.com&lt;/code&gt;. &lt;strong&gt;Pastikan domain Anda sudah diarahkan ke server ini&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;acme.sh &lt;span class="nt"&gt;--issue&lt;/span&gt; &lt;span class="nt"&gt;--standalone&lt;/span&gt; &lt;span class="nt"&gt;--home&lt;/span&gt; /etc/letsencrypt &lt;span class="nt"&gt;-d&lt;/span&gt; contoh.com &lt;span class="nt"&gt;--keylength&lt;/span&gt; 2048
&lt;span class="nb"&gt;sudo &lt;/span&gt;acme.sh &lt;span class="nt"&gt;--issue&lt;/span&gt; &lt;span class="nt"&gt;--standalone&lt;/span&gt; &lt;span class="nt"&gt;--home&lt;/span&gt; /etc/letsencrypt &lt;span class="nt"&gt;-d&lt;/span&gt; contoh.com &lt;span class="nt"&gt;--keylength&lt;/span&gt; ec-256
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Ingat, ganti &lt;code&gt;contoh.com&lt;/code&gt; diatas dengan nama domain dari Matomo Anda.&lt;/p&gt;

&lt;p&gt;Langkah ini selesai apabila kode certificate-nya sudah muncul. Tampilannya mirip seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;-----BEGIN&lt;/span&gt; CERTIFICATE-----
MIIEjDCCA3SgAwIBAgISBN92sUegDEJB8biuLJRE52LRMA0GCSqGSIb3DQEBCwUA
...
&lt;span class="nv"&gt;FEZiTnEu5NFMfLAWZuKKYg&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;
&lt;span class="nt"&gt;-----END&lt;/span&gt; CERTIFICATE-----
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi Nginx
&lt;/h2&gt;

&lt;p&gt;Untuk cara instalasi Nginx, silahkan baca artikel berikut.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Selanjutnya, buat konfigurasi Matomo untuk Nginx, dengan menjalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vim /etc/nginx/sites-available/matomo.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Isi dengan baris konfigurasi dibawah ini. Jangan lupa mengganti &lt;code&gt;contoh.com&lt;/code&gt; dengan nama domain Anda sebelum konfigurasi dibawah ini disimpan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;server&lt;/span&gt; {

  &lt;span class="n"&gt;listen&lt;/span&gt; [::]:&lt;span class="m"&gt;443&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt; &lt;span class="n"&gt;http2&lt;/span&gt;;
  &lt;span class="n"&gt;listen&lt;/span&gt; &lt;span class="m"&gt;443&lt;/span&gt; &lt;span class="n"&gt;ssl&lt;/span&gt; &lt;span class="n"&gt;http2&lt;/span&gt;;
  &lt;span class="n"&gt;listen&lt;/span&gt; [::]:&lt;span class="m"&gt;80&lt;/span&gt;;
  &lt;span class="n"&gt;listen&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;;

  &lt;span class="n"&gt;server_name&lt;/span&gt; &lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com&lt;/span&gt;;
  &lt;span class="n"&gt;root&lt;/span&gt; /&lt;span class="n"&gt;var&lt;/span&gt;/&lt;span class="n"&gt;www&lt;/span&gt;/&lt;span class="n"&gt;matomo&lt;/span&gt;/;
  &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;.&lt;span class="n"&gt;php&lt;/span&gt;;

  &lt;span class="n"&gt;ssl_certificate&lt;/span&gt; /&lt;span class="n"&gt;etc&lt;/span&gt;/&lt;span class="n"&gt;letsencrypt&lt;/span&gt;/&lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com&lt;/span&gt;/&lt;span class="n"&gt;fullchain&lt;/span&gt;.&lt;span class="n"&gt;cer&lt;/span&gt;; 
  &lt;span class="n"&gt;ssl_certificate_key&lt;/span&gt; /&lt;span class="n"&gt;etc&lt;/span&gt;/&lt;span class="n"&gt;letsencrypt&lt;/span&gt;/&lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com&lt;/span&gt;/&lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com&lt;/span&gt;.&lt;span class="n"&gt;key&lt;/span&gt;; 
  &lt;span class="n"&gt;ssl_certificate&lt;/span&gt; /&lt;span class="n"&gt;etc&lt;/span&gt;/&lt;span class="n"&gt;letsencrypt&lt;/span&gt;/&lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com_ecc&lt;/span&gt;/&lt;span class="n"&gt;fullchain&lt;/span&gt;.&lt;span class="n"&gt;cer&lt;/span&gt;;
  &lt;span class="n"&gt;ssl_certificate_key&lt;/span&gt; /&lt;span class="n"&gt;etc&lt;/span&gt;/&lt;span class="n"&gt;letsencrypt&lt;/span&gt;/&lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com_ecc&lt;/span&gt;/&lt;span class="n"&gt;contoh&lt;/span&gt;.&lt;span class="n"&gt;com&lt;/span&gt;.&lt;span class="n"&gt;key&lt;/span&gt;;

  &lt;span class="n"&gt;location&lt;/span&gt; ~ ^/(&lt;span class="n"&gt;index&lt;/span&gt;|&lt;span class="n"&gt;matomo&lt;/span&gt;|&lt;span class="n"&gt;piwik&lt;/span&gt;|&lt;span class="n"&gt;js&lt;/span&gt;/&lt;span class="n"&gt;index&lt;/span&gt;).&lt;span class="n"&gt;php&lt;/span&gt; {
    &lt;span class="n"&gt;include&lt;/span&gt; &lt;span class="n"&gt;snippets&lt;/span&gt;/&lt;span class="n"&gt;fastcgi&lt;/span&gt;-&lt;span class="n"&gt;php&lt;/span&gt;.&lt;span class="n"&gt;conf&lt;/span&gt;;
    &lt;span class="n"&gt;fastcgi_param&lt;/span&gt; &lt;span class="n"&gt;HTTP_PROXY&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;; 
    &lt;span class="n"&gt;fastcgi_pass&lt;/span&gt; &lt;span class="n"&gt;unix&lt;/span&gt;:/&lt;span class="n"&gt;var&lt;/span&gt;/&lt;span class="n"&gt;run&lt;/span&gt;/&lt;span class="n"&gt;php&lt;/span&gt;/&lt;span class="n"&gt;php7&lt;/span&gt;.&lt;span class="m"&gt;4&lt;/span&gt;-&lt;span class="n"&gt;fpm&lt;/span&gt;.&lt;span class="n"&gt;sock&lt;/span&gt;; 
  }

  &lt;span class="n"&gt;location&lt;/span&gt; = /&lt;span class="n"&gt;plugins&lt;/span&gt;/&lt;span class="n"&gt;HeatmapSessionRecording&lt;/span&gt;/&lt;span class="n"&gt;configs&lt;/span&gt;.&lt;span class="n"&gt;php&lt;/span&gt; {
    &lt;span class="n"&gt;include&lt;/span&gt; &lt;span class="n"&gt;snippets&lt;/span&gt;/&lt;span class="n"&gt;fastcgi&lt;/span&gt;-&lt;span class="n"&gt;php&lt;/span&gt;.&lt;span class="n"&gt;conf&lt;/span&gt;;
    &lt;span class="n"&gt;fastcgi_param&lt;/span&gt; &lt;span class="n"&gt;HTTP_PROXY&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;;
    &lt;span class="n"&gt;fastcgi_pass&lt;/span&gt; &lt;span class="n"&gt;unix&lt;/span&gt;:/&lt;span class="n"&gt;var&lt;/span&gt;/&lt;span class="n"&gt;run&lt;/span&gt;/&lt;span class="n"&gt;php&lt;/span&gt;/&lt;span class="n"&gt;php7&lt;/span&gt;.&lt;span class="m"&gt;4&lt;/span&gt;-&lt;span class="n"&gt;fpm&lt;/span&gt;.&lt;span class="n"&gt;sock&lt;/span&gt;;
  }

  &lt;span class="n"&gt;location&lt;/span&gt; ~* ^.+\.&lt;span class="n"&gt;php&lt;/span&gt;$ {
    &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;;
    &lt;span class="n"&gt;return&lt;/span&gt; &lt;span class="m"&gt;403&lt;/span&gt;;
  }

  &lt;span class="n"&gt;location&lt;/span&gt; / {
    &lt;span class="n"&gt;try_files&lt;/span&gt; $&lt;span class="n"&gt;uri&lt;/span&gt; $&lt;span class="n"&gt;uri&lt;/span&gt;/ =&lt;span class="m"&gt;404&lt;/span&gt;;
  }

  &lt;span class="n"&gt;location&lt;/span&gt; ~ /(&lt;span class="n"&gt;config&lt;/span&gt;|&lt;span class="n"&gt;tmp&lt;/span&gt;|&lt;span class="n"&gt;core&lt;/span&gt;|&lt;span class="n"&gt;lang&lt;/span&gt;) {
    &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;;
    &lt;span class="n"&gt;return&lt;/span&gt; &lt;span class="m"&gt;403&lt;/span&gt;;
  }

  &lt;span class="n"&gt;location&lt;/span&gt; ~ \.(&lt;span class="n"&gt;gif&lt;/span&gt;|&lt;span class="n"&gt;ico&lt;/span&gt;|&lt;span class="n"&gt;jpg&lt;/span&gt;|&lt;span class="n"&gt;png&lt;/span&gt;|&lt;span class="n"&gt;svg&lt;/span&gt;|&lt;span class="n"&gt;js&lt;/span&gt;|&lt;span class="n"&gt;css&lt;/span&gt;|&lt;span class="n"&gt;htm&lt;/span&gt;|&lt;span class="n"&gt;html&lt;/span&gt;|&lt;span class="n"&gt;mp3&lt;/span&gt;|&lt;span class="n"&gt;mp4&lt;/span&gt;|&lt;span class="n"&gt;wav&lt;/span&gt;|&lt;span class="n"&gt;ogg&lt;/span&gt;|&lt;span class="n"&gt;avi&lt;/span&gt;|&lt;span class="n"&gt;ttf&lt;/span&gt;|&lt;span class="n"&gt;eot&lt;/span&gt;|&lt;span class="n"&gt;woff&lt;/span&gt;|&lt;span class="n"&gt;woff2&lt;/span&gt;|&lt;span class="n"&gt;json&lt;/span&gt;)$ {
    &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;;
  }

  &lt;span class="n"&gt;location&lt;/span&gt; ~ /(&lt;span class="n"&gt;libs&lt;/span&gt;|&lt;span class="n"&gt;vendor&lt;/span&gt;|&lt;span class="n"&gt;plugins&lt;/span&gt;|&lt;span class="n"&gt;misc&lt;/span&gt;/&lt;span class="n"&gt;user&lt;/span&gt;) {
    &lt;span class="n"&gt;deny&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt;;
    &lt;span class="n"&gt;return&lt;/span&gt; &lt;span class="m"&gt;403&lt;/span&gt;;
  }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Aktifkan dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/matomo.conf /etc/nginx/sites-enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tambahkan Nginx ke firewall.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow &lt;span class="s2"&gt;"Nginx Full"&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lakukan pengecekan konfigurasi Nginx.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf &lt;span class="nb"&gt;test &lt;/span&gt;is successful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Langkah terakhir pada bagian ini, adalah dengan me-restart Nginx.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Instalasi Matomo Web Analytics
&lt;/h2&gt;

&lt;p&gt;Instalasi Matomo dilakukan dengan cara menjalankan perintah berikut ini secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/www/
&lt;span class="nb"&gt;sudo &lt;/span&gt;wget https://builds.matomo.org/matomo.zip &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;unzip matomo.zip
&lt;span class="nb"&gt;sudo rm &lt;/span&gt;matomo.zip
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; root:root /var/www/matomo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sampai pada langkah ini, Matomo sudah berhasil terpasang dan siap untuk dilakukan pengaturan, supaya dapat segera digunakan.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pengaturan Matomo Web Analytics
&lt;/h2&gt;

&lt;p&gt;Akses domain Matomo dari browser. Tekan Next pada langkah 1 pengaturan Matomo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjqor5fbxa5w70w5byov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsjqor5fbxa5w70w5byov.png" alt="Langkah 1" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pada langkah 2, adalah pengecekan konfigurasi sistem. Jika semuanya sudah memiliki tanda centang, maka konfigurasi sudah benar dan bisa dilanjutkan ke langkah selanjutnya. Tekan tombol Next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl03uhgdt0gyevbtaxja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl03uhgdt0gyevbtaxja.png" alt="Langkah 2" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pada langkah 3, isilah detil login database yang sudah diatur sebelumnya pada waktu pembuatan database. Klik Next untuk melanjutkan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2wcq18rdljmz22ag86j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2wcq18rdljmz22ag86j.png" alt="Langkah 3" width="800" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pada langkah 4 ini, apabila detil login database sudah benar, maka akan muncul pesan&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tables created with success!&lt;/strong&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;dan klik Next untuk lanjut ke langkah selanjutnya.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfpjc8zqumke2p6wtln6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfpjc8zqumke2p6wtln6.png" alt="Langkah 4" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Langkah 5 adalah membuat login Super User (admin) untuk Matomo. Isilah dengan login yang diinginkan, lanjutkan dengan menekan tombol Next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77fswx8qqs7u4cb3fo8l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77fswx8qqs7u4cb3fo8l.png" alt="Langkah 5" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Langkah 6 adalah langkah awal untuk mulai melakukan tracking menggunakan Matomo. Masukkan detil website pertama yang mau di tracking, tekan Next untuk melanjutkan ke langkah selanjutnya.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrsvwwz2yo98ewcubixe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvrsvwwz2yo98ewcubixe.png" alt="Langkah 6" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Langkah 7 menyediakan tracking code untuk disertakan pada website yang akan di-track dengan Matomo. Kode harus ditempelkan sebelum tag &lt;code&gt;&amp;lt;/head&amp;gt;&lt;/code&gt; pada halaman website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl2g4os0s62cuoa94ir0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl2g4os0s62cuoa94ir0.png" alt="Langkah 7" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pada langkah 8 adalah langkah terakhir untuk proses pengaturan Matomo, selanjutnya tekan tombol Continue to Matomo untuk segera masuk ke dashboard Matomo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3wigxy5ebsjgqpbmxq0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3wigxy5ebsjgqpbmxq0.png" alt="Langkah 8" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Selamat, proses instalasi Matomo selesai.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1c5rmlrg86ozm86k9xz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1c5rmlrg86ozm86k9xz.png" alt="Homepage Matomo" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Tautan berguna
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;(&lt;a href="https://matomo.org/docs/installation/#check-you-meet-the-minimum-requirements" rel="noopener noreferrer"&gt;https://matomo.org/docs/installation/#check-you-meet-the-minimum-requirements&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;(&lt;a href="https://github.com/matomo-org/matomo-nginx" rel="noopener noreferrer"&gt;https://github.com/matomo-org/matomo-nginx&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;(&lt;a href="https://github.com/acmesh-official/acme.sh/wiki" rel="noopener noreferrer"&gt;https://github.com/acmesh-official/acme.sh/wiki&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>matomo</category>
      <category>analytics</category>
      <category>ubuntu</category>
      <category>indonesia</category>
    </item>
    <item>
      <title>Cara install Nextcloud di Ubuntu 18.04 serta cara optimalisasi</title>
      <dc:creator>Erol Joudy</dc:creator>
      <pubDate>Sat, 13 Mar 2021 18:36:51 +0000</pubDate>
      <link>https://dev.to/kawanuaid/cara-install-nextcloud-di-ubuntu-18-04-serta-cara-optimalisasi-49pj</link>
      <guid>https://dev.to/kawanuaid/cara-install-nextcloud-di-ubuntu-18-04-serta-cara-optimalisasi-49pj</guid>
      <description>&lt;p&gt;Nextcloud adalah sebuah software open-source yang mirip dengan Dropbox, dan banyak digunakan sebagai solusi alternatif dari Google Drive, Dropbox, dan sejenisnya.&lt;/p&gt;

&lt;p&gt;File yang ada di PC atau laptop akan secara otomatis sinkron dengan yang ada di Nextcloud server, yang bisa diakses lewat perangkat yang lain termasuk smartphone. Pada artikel ini akan dijelaskan cara instalasi Nextcloud pada Ubuntu 18.04 dengan stack yang menggunakan Nginx, MariaDB, PHP7.4, dan Let's Encrypt SSL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Persiapan
&lt;/h2&gt;

&lt;p&gt;Pastikan semua package yang dibutuhkan sudah terpasang dengan cara menjalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install wget unzip zip libmagickcore-dev -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Instalasi Nginx
&lt;/h2&gt;

&lt;p&gt;Jalankan perintah dibawah ini untuk mulai instalasi Nginx.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install nginx -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Sesudah instalasi, aktifkan Nginx dengan perintah dibawah ini, jalankan secara berurutan.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start nginx
sudo systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Lalu cek apakah Nginx berjalan dengan normal.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Bisa juga dilihat pada artikel berikut.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi dan Konfigurasi PHP 7.4
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Instalasi PHP 7.4
&lt;/h3&gt;

&lt;p&gt;Versi terbaru PHP adalah &lt;code&gt;7.4&lt;/code&gt;, sedangkan bawaan untuk Ubuntu 18.04 adalah &lt;code&gt;7.2&lt;/code&gt;. Supaya bisa dipasang versi terakhir, maka diperlukan konfigurasi awal sebagai berikut.&lt;/p&gt;

&lt;p&gt;Jalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tekan tombol Enter jika pada layar muncul pertanyaan yang harus dikonfirmasi.&lt;/p&gt;

&lt;p&gt;Kemudian jalankan perintah berikut, untuk melakukan update/upgrade pada Ubuntu.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update -y &amp;amp;&amp;amp; sudo apt upgrade -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Untuk mulai instalasi PHP 7.4 beserta komponen yang dibutuhkan oleh Nextcloud, jalankan perintah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install php7.4 php7.4-fpm php7.4-bcmath php7.4-gmp php7.4-curl php7.4-cli php7.4-mysql php7.4-gd php7.4-common php7.4-xml php7.4-json php7.4-intl php7.4-imagick php7.4-dev php7.4-common php7.4-mbstring php7.4-zip php7.4-soap php7.4-bz2 -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lalu cek versi PHP yang sedang aktif dengan cara berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php -version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output yang diharapkan terlihat seperti ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PHP 7.4.16 (cli) (built: Mar  5 2021 07:54:20) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Konfigurasi PHP 7.4
&lt;/h3&gt;

&lt;p&gt;Lakukan konfigurasi yang pertama terhadap file &lt;code&gt;php.ini&lt;/code&gt; yang berlokasi di &lt;code&gt;/etc/php/7.4/fpm/&lt;/code&gt; dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/php/7.4/fpm/php.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dalam editor tekan Ctrl+W lalu ketik &lt;code&gt;date.timezone&lt;/code&gt; akhiri dengan tekan Enter. Lakukan cara ini untuk memudahkan pencarian sebuah teks tertentu dalam sebuah dokumen yang panjang, jika menggunakan editor &lt;code&gt;nano&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Cari dan ubah baris berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;;date.timezone =
;cgi.fix_pathinfo=1
memory_limit = 128M
;opcache.enable=1
;opcache.memory_consumption=128
;opcache.interned_strings_buffer=8
;opcache.max_accelerated_files=10000
;opcache.revalidate_freq=2
;opcache.save_comments=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sehingga menjadi seperti ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date.timezone = Asia/Makassar
cgi.fix_pathinfo=0
memory_limit = 512M
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=1
opcache.save_comments=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahan pada file tersebut. Lanjutkan untuk mengubah konfigurasi pada file &lt;code&gt;php.ini&lt;/code&gt; yang berlokasi di &lt;code&gt;/etc/php/7.4/cli/&lt;/code&gt; dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/php/7.4/cli/php.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cari dan ubah baris berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;;date.timezone =
;cgi.fix_pathinfo=1
;opcache.enable=1
;opcache.memory_consumption=128
;opcache.interned_strings_buffer=8
;opcache.max_accelerated_files=10000
;opcache.revalidate_freq=2
;opcache.save_comments=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sehingga menjadi seperti ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date.timezone = Asia/Makassar
cgi.fix_pathinfo=0
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=1
opcache.save_comments=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jangan lupa untuk menyimpan perubahannya.&lt;/p&gt;

&lt;p&gt;Perubahan konfigurasi file berikutnya adalah terhadap file &lt;code&gt;www.conf&lt;/code&gt;, jalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/php/7.4/fpm/pool.d/www.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kemudian cari dan edit baris berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
pm.max_children = 1
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Menjadi seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
pm.max_children = 120
pm.start_servers = 12
pm.min_spare_servers = 6
pm.max_spare_servers = 18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahannya dan keluar dari editor. Selanjutnya restart &lt;code&gt;php7.4-fpm&lt;/code&gt; dengan cara berikut. Jalankan secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart php7.4-fpm
sudo systemctl enable php7.4-fpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verifikasi apakah php7.4-fpm berjalan dengan seharusnya, jalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ss -xa | grep php &amp;amp;&amp;amp; sudo systemctl status php7.4-fpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output yg diharapkan akan terlihat mirip seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;u_strLISTEN 0       128                        /run/php/php7.4-fpm.sock 1845793                                          * 0
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since 1min 49s ago
     Docs: man:php-fpm7.4(8)
 Main PID: 3549 (php-fpm7.4)
   Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 3 (limit: 4663)
   CGroup: /system.slice/php7.4-fpm.service
           ├─3549 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
           ├─3576 php-fpm: pool www
           └─3577 php-fpm: pool www
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi dan konfigurasi MariaDB
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Instalasi MariaDB
&lt;/h3&gt;

&lt;p&gt;Jalankan perintah berikut untuk mulai instalasi MariaDB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mariadb-server -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lanjutkan dengan mengaktifkan MariaDB, dengan cara jalankan perintah berikut secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start mariadb
sudo systemctl enable mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cek apakah MariaDB berjalan dengan normal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output yang diharapkan adalah seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;● mariadb.service - MariaDB 10.1.47 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: active (running) since 1min 33s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 20554 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 27 (limit: 4663)
   CGroup: /system.slice/mariadb.service
           └─20554 /usr/sbin/mysqld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Konfigurasi MariaDB
&lt;/h3&gt;

&lt;p&gt;Selanjutnya konfigurasi MariaDB dilakukan dengan perintah berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Akan terlihat output seperti berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tekan tombol Enter, sebab ini adalah pertama kalinya MariaDB diinstall, jadi root password masih kosong. Pada langkah berikutnya akan di set.&lt;/p&gt;

&lt;p&gt;Pertanyaan selanjutnya akan membantu untuk mengamankan instalasi MariaDB, jawablah dengan menuliskan &lt;code&gt;Y&lt;/code&gt; dan konfirmasikan dengan tombol Enter. Daftarkan root password baru, jika ditanyakan pada langkah berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set root password? [Y/n] Y
New password:
Re-enter new password:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seluruh proses konfigurasi MariaDB diatas, akan memiliki output akhir kurang lebih seperti ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Membuat database data Nextcloud
&lt;/h3&gt;

&lt;p&gt;Login ke MariaDB dengan perintah berikut. Isilah root password ketika diminta, akhiri dengan menekan tombol Enter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pada terminal akan muncul prompt berikut, jika berhasil masuk.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MariaDB [(none)]&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kemudian jalankan perintah dibawah ini secara berurutan. &lt;strong&gt;INGAT&lt;/strong&gt;, jangan lupa mengganti &lt;code&gt;NAMA_DB&lt;/code&gt; dengan nama database yg diinginkan, &lt;code&gt;DB_USER&lt;/code&gt; dengan username untuk database tersebut, dan &lt;code&gt;DB_PASS&lt;/code&gt; dengan password untuk database tersebut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create database NAMA_DB;
create user DB_USER@localhost identified by 'DB_PASS';
grant all privileges on NAMA_DB.* to DB_USER@localhost identified by 'DB_PASS';
flush privileges;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output akhirnya akan terlihat kurang lebih seperti berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MariaDB [(none)]&amp;gt; create database NAMA_DB;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]&amp;gt; create user DB_USER@localhost identified by 'DB_PASS';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]&amp;gt; grant all privileges on NAMA_DB.* to DB_USER@localhost identified by 'DB_PASS';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]&amp;gt; flush privileges;
Query OK, 0 rows affected (0.00 sec)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi Let's Encrypt
&lt;/h2&gt;

&lt;p&gt;Jalan perintah berikut untuk mulai instalasi certbot.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install certbot -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hentikan Nginx, untuk mencegah kegagalan pendaftaran sertifikat SSL karena belum ada server block rujukan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Untuk memulai proses pendaftaran sertifikat SSL, jalankan perintah dibawah ini. &lt;strong&gt;INGAT&lt;/strong&gt;, jangan lupa mengganti &lt;code&gt;EMAIL_ANDA&lt;/code&gt; dengan alamat email, dan &lt;code&gt;DOMAIN_ANDA&lt;/code&gt; dengan nama domain yg akan digunakan untuk Nextcloud. Pada artikel ini akan menggunakan domain &lt;code&gt;nextcloud.contoh.com&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot certonly --agree-tos --email EMAIL_ANDA --standalone -d nextcloud.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apabila saat eksekusi perintah diatas, kemudian muncul pesan error soal firewall, jangan sungkan untuk menghentikan firewall untuk sementara, jika menggunakan &lt;code&gt;ufw&lt;/code&gt; jalankan perintah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw disable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jangan lupa untuk mengaktifkan firewall kembali, apabila pesan error soal firewall sudah tidak ada, dan eksekusi perintah &lt;code&gt;certbot&lt;/code&gt; diatas berjalan dengan mulus. Aktifkan firewall dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw enable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Proses pendaftaran sertifikat SSL dikatakan berhasil, apabila outputnya terlihat mirip seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/nextcloud.contoh.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/nextcloud.contoh.com/privkey.pem
   Your cert will expire on 2021-07-28. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. 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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Instalasi Nextcloud
&lt;/h2&gt;

&lt;p&gt;Buka folder &lt;code&gt;/var/www&lt;/code&gt; dengan perintah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unduh Nextcloud.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo wget -q https://download.nextcloud.com/server/releases/latest.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jalankan perintah dibawah ini secara berurutan untuk meng-ekstrak file &lt;code&gt;latest.zip&lt;/code&gt;, sekaligus menyiapkan folder untuk instalasi Nextcloud.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo unzip -qq latest.zip
sudo chown -R www-data:www-data /var/www/nextcloud
sudo rm -fR latest.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Konfigurasi setelah instalasi
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Konfigurasi server block nginx untuk Nextcloud
&lt;/h3&gt;

&lt;p&gt;Jalankan perintah berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/sites-available/nextcloud
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Salin dan isi kode dibawah ini, lalu simpan filenya. &lt;strong&gt;INGAT&lt;/strong&gt;, jangan lupa mengganti domain &lt;code&gt;nextcloud.contoh.com&lt;/code&gt; dengan domain Anda.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;upstream php-handler {
    #server 127.0.0.1:9000;
    server unix:/var/run/php/php7.4-fpm.sock;
}

server {
    listen 80;
    listen [::]:80;
    server_name nextcloud.contoh.com;
    # enforce https
    return 301 https://$server_name:443$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name nextcloud.contoh.com;

    # Use Mozilla's guidelines for SSL/TLS settings
    # https://mozilla.github.io/server-side-tls/ssl-config-generator/
    # NOTE: some settings below might be redundant
    ssl_certificate /etc/letsencrypt/live/nextcloud.contoh.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/nextcloud.contoh.com/privkey.pem;

    # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this
    # topic first.
    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
    #
    # WARNING: Only add the preload option once you read about
    # the consequences in https://hstspreload.org/. This option
    # will add the domain to a hardcoded list that is shipped
    # in all major browsers and getting removed from this list
    # could take several months.
    add_header Referrer-Policy "no-referrer" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Download-Options "noopen" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Permitted-Cross-Domain-Policies "none" always;
    add_header X-Robots-Tag "none" always;
    add_header X-XSS-Protection "1; mode=block" always;

    # Remove X-Powered-By, which is an information leak
    fastcgi_hide_header X-Powered-By;

    # Path to the root of your installation
    root /var/www/nextcloud;

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    # The following 2 rules are only needed for the user_webfinger app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

    # The following rule is only needed for the Social app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/webfinger /public.php?service=webfinger last;

    location = /.well-known/carddav {
      return 301 $scheme://$host:$server_port/remote.php/dav;
    }
    location = /.well-known/caldav {
      return 301 $scheme://$host:$server_port/remote.php/dav;
    }
    location ^~ /.well-known            { return 301 /index.php$uri; }

    # set max upload size
    client_max_body_size 512M;
    fastcgi_buffers 64 4K;

    # Enable gzip but do not remove ETag headers
    gzip on;
    gzip_vary on;
    gzip_comp_level 4;
    gzip_min_length 256;
    gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
    gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;

    # Uncomment if your server is build with the ngx_pagespeed module
    # This module is currently not supported.
    #pagespeed off;

    location / {
        rewrite ^ /index.php;
    }

    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
        deny all;
    }
    location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny all;
    }

    location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
        fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
        set $path_info $fastcgi_path_info;
        try_files $fastcgi_script_name =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $path_info;
        fastcgi_param HTTPS on;
        # Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;
        # Enable pretty urls
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }

    location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
        try_files $uri/ =404;
        index index.php;
    }

    # Adding the cache control header for js, css and map files
    # Make sure it is BELOW the PHP block
    location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
        try_files $uri /index.php$request_uri;
        add_header Cache-Control "public, max-age=15778463";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        # Before enabling Strict-Transport-Security headers please read into
        # this topic first.
        add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
        #
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        add_header Referrer-Policy "no-referrer" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header X-Download-Options "noopen" always;
        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-Permitted-Cross-Domain-Policies "none" always;
        add_header X-Robots-Tag "none" always;
        add_header X-XSS-Protection "1; mode=block" always;

        # Optional: Don't log access to assets
        access_log off;
    }

    location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
        try_files $uri /index.php$request_uri;
        # Optional: Don't log access to other assets
        access_log off;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Aktifkan server block ini dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Periksa konfigurasi server block sebelum dijalankan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output yang diharapkan akan terlihat seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jalankan &lt;code&gt;nginx&lt;/code&gt; dan &lt;code&gt;php7.4-fpm&lt;/code&gt; dengan perintah dibawah ini secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
sudo systemctl restart php7.4-fpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Konfigurasi &lt;code&gt;ufw&lt;/code&gt; firewall
&lt;/h3&gt;

&lt;p&gt;Tambahkan layanan yang terkait dengan Nextcloud pada 'ufw' dengan cara berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup Nextcloud via browser
&lt;/h3&gt;

&lt;p&gt;Buka dan akses Nextcloud lewat browser &lt;code&gt;https://nextcloud.contoh.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F116mhczhkfp7142zqngn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F116mhczhkfp7142zqngn.png" alt="setup-nextcloud-browser" width="800" height="1041"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Isilah semua data yang diminta, dan klik tombol Finish Setup untuk memulai proses setup. Setelah selesai, berikut adalah tampilan dashboard dari Nextcloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xy2s0p5qw6t4prf8ugn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xy2s0p5qw6t4prf8ugn.png" alt="dashboard-nextcloud.png" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Selesai. Selamat mencoba.&lt;/p&gt;

</description>
      <category>nextcloud</category>
      <category>ubuntu</category>
      <category>linux</category>
      <category>indonesia</category>
    </item>
    <item>
      <title>Cara install Gitea di Ubuntu 18.04</title>
      <dc:creator>Erol Joudy</dc:creator>
      <pubDate>Thu, 11 Mar 2021 18:43:10 +0000</pubDate>
      <link>https://dev.to/kawanuaid/cara-install-gitea-di-ubuntu-18-04-41lh</link>
      <guid>https://dev.to/kawanuaid/cara-install-gitea-di-ubuntu-18-04-41lh</guid>
      <description>&lt;p&gt;Gitea adalah sebuah git server yang merupakan solusi bagi para developer yang ingin mencari alternatif menyimpan koleksi repository. Gitea merupakan sebuah proyek open source berbasis Go.&lt;/p&gt;

&lt;p&gt;Salah satu keunggulan dari Gitea dibanding server self-hosted populer seperti Gitlab dan sejenisnya, adalah membutuhkan resource yang minim namun memiliki fitur yang melimpah seperti Github.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feec55c4b3dqwbrk79og8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feec55c4b3dqwbrk79og8.png" alt="Konfigurasi server untuk tutorial ini" width="800" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tutorial ini akan membahas cara instalasi Gitea di Ubuntu 18.04.&lt;/p&gt;

&lt;h2&gt;
  
  
  Persiapan
&lt;/h2&gt;

&lt;p&gt;Gitea mendukung penggunaan MySQL/MariaDB, SQLite, dan PostgreSQL sebagai backend database. Namun dalam artikel kali ini, akan menggunakan SQLite.&lt;/p&gt;

&lt;p&gt;Apabila SQLite belum terpasang pada sistem, silahkan install dengan menggunakan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install -y sqlite3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Instalasi Gitea
&lt;/h2&gt;

&lt;p&gt;Gitea memungkinkan penggunakan Docker image sebagai sarana untuk instalasi, juga tersedia dalam bentuk binary, source, dan package.&lt;/p&gt;

&lt;p&gt;Pada artikel ini, instalasi akan menggunakan bentuk binary. Silahkan ikuti langkah instalasi berikut.&lt;/p&gt;
&lt;h3&gt;
  
  
  Install Git
&lt;/h3&gt;

&lt;p&gt;Langkah pertama adalah dengan memasang Git pada server, jika belum ada sebelumnya.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Kemudian lakukan verifikasi instalasi Git dengan cara,&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Outputnya akan seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git version 2.25.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Tambahkan user git
&lt;/h3&gt;

&lt;p&gt;Tambah sebuah user baru untuk menjalankan Gitea dengan cara berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo adduser --system --group --disabled-password --shell /bin/bash --home /home/git --gecos 'Git Version Control' git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Perintah ini akan secara otomatis menambahkan sebuah user bernama &lt;code&gt;git&lt;/code&gt; dan mengatur direktori home pada &lt;code&gt;/home/git&lt;/code&gt;. Outputnya akan mirip dengan dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Adding system user `git' (UID 113) ...
Adding new group `git' (GID 117) ...
Adding new user `git' (UID 113) with group `git' ...
Creating home directory `/home/git' ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Unduh binary milik Gitea
&lt;/h3&gt;

&lt;p&gt;Kunjungi  &lt;a href="https://dl.gitea.io/gitea/" rel="noopener noreferrer"&gt;halaman unduhan Gitea&lt;/a&gt; dan lihat versi terakhir yang tersedia untuk diunduh. Disarankan jangan mengambil yg masih RC (release candidate). Pada saat artikel ini dibuat, versi terakhir saat artikel ini ditulis adalah &lt;code&gt;1.13.4&lt;/code&gt;. Apabila terdapat versi yang lebih baru, silahkan ganti variabel dari &lt;code&gt;VERSION&lt;/code&gt; pada perintah dibawah.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VERSION=1.13.4
sudo wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Perintah diatas adalah perintah untuk mengunduh Gitea ke direktori &lt;code&gt;/tmp&lt;/code&gt; dan selanjutnya pindahkan ke direktori &lt;code&gt;/usr/local/bin&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mv /tmp/gitea /usr/local/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Setelah itu, jalankan perintah berikut secara berurutan.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod +x /usr/local/bin/gitea
sudo mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
sudo chown git: /var/lib/gitea/{data,indexers,log}
sudo chmod 750 /var/lib/gitea/{data,indexers,log}
sudo mkdir /etc/gitea
sudo chown root:git /etc/gitea
sudo chmod 770 /etc/gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Membuat file unit systemd
&lt;/h3&gt;

&lt;p&gt;Unduh filenya dengan menggunakan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo wget https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service -P /etc/systemd/system/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Atau dengan cara manual, buat file &lt;code&gt;gitea.service&lt;/code&gt; di direktori &lt;code&gt;/etc/systemd/system/&lt;/code&gt; dengan menyalin kode dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
###
# Don't forget to add the database service requirements
###
#
#Requires=mysql.service
#Requires=mariadb.service
#Requires=postgresql.service
#Requires=memcached.service
#Requires=redis.service
#
###
# If using socket activation for main http/s
###
#
#After=gitea.main.socket
#Requires=gitea.main.socket
#
###
# (You can also provide gitea an http fallback and/or ssh socket too)
#
# An example of /etc/systemd/system/gitea.main.socket
###
##
## [Unit]
## Description=Gitea Web Socket
## PartOf=gitea.service
##
## [Socket]
## Service=gitea.service
## ListenStream=&amp;lt;some_port&amp;gt;
## NoDelay=true
##
## [Install]
## WantedBy=sockets.target
##
###

[Service]
# Modify these two values and uncomment them if you have
# repos with lots of files and get an HTTP error 500 because
# of that
###
#LimitMEMLOCK=infinity
#LimitNOFILE=65535
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
# If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file
# (manually creating /run/gitea doesn't work, because it would not persist across reboots)
#RuntimeDirectory=gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini  --custom-path /home/git/custom
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# If you want to bind Gitea to a port below 1024, uncomment
# the two values below, or use socket activation to pass Gitea its ports as above
###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE
###

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Setelah selesai, jalankan perintah ini secara berurutan untuk menjalankan Gitea.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl daemon-reload
sudo systemctl enable --now gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Pastikan Gitea sudah aktif dengan mengeksekusi perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Outputnya akan mirip dengan dibawah.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;● gitea.service - Gitea (Git with a cup of tea)
   Loaded: loaded (/etc/systemd/system/gitea.service; enabled; vendor preset: enabled)
   Active: active (running) since 5s ago
 Main PID: 5111 (gitea)
    Tasks: 7
   Memory: 90.8M
      CPU: 542ms
   CGroup: /system.slice/gitea.service
           └─5111 /usr/local/bin/gitea web --config /etc/gitea/app.ini
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Konfigurasi awal Gitea
&lt;/h3&gt;

&lt;p&gt;Pada tahap ini Gitea sudah aktif, saatnya untuk melakukan pengaturan lewat web browser.&lt;/p&gt;

&lt;p&gt;Secara default, Gitea beroperasi menggunakan port &lt;code&gt;3000&lt;/code&gt;. Pada sistem yang menggunakan &lt;code&gt;ufw&lt;/code&gt; firewall, diharuskan untuk membuka port ini dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 3000/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Buka browser dan akses alamat &lt;code&gt;http://HOSTNAME_ANDA:3000&lt;/code&gt; atau &lt;code&gt;http://IP_SERVER:3000&lt;/code&gt; dan tampilannya akan seperti ini.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht0ou3ls3rl4ncwtznds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fht0ou3ls3rl4ncwtznds.png" alt="Alt Text" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Klik Explore pada menu kiri atas yang akan membuka halaman pengaturan Gitea.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn915ffzt31msoou6iam4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn915ffzt31msoou6iam4.png" alt="Alt Text" width="800" height="672"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adapun pengaturan yang disarankan adalah sebagai berikut.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database Settings&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database Type: &lt;code&gt;SQLite3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Path: &lt;code&gt;/var/lib/gitea/data/gitea.db&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;General Settings&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Site Title: Enter your organization name.&lt;/li&gt;
&lt;li&gt;Repository Root Path: &lt;code&gt;/home/git/gitea-repositories&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git LFS Root Path: &lt;code&gt;/var/lib/gitea/data/lfs&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run As Username: &lt;code&gt;git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SSH Server Domain: Masukkan domain atau nomor IP server.&lt;/li&gt;
&lt;li&gt;SSH Port: &lt;code&gt;22&lt;/code&gt;, ganti apabila SSH menggunakan port yang lain.&lt;/li&gt;
&lt;li&gt;Gitea HTTP Listen Port: &lt;code&gt;3000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Gitea Base URL: Masukkan http dan nama domain atau nomor IP server.&lt;/li&gt;
&lt;li&gt;Log Path: &lt;code&gt;/var/lib/gitea/log&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pengaturan diatas bisa diatur ulang kemudian dengan cara mengedit langsung file konfigurasi Gitea.&lt;/p&gt;

&lt;p&gt;Klik Install Gitea. Dalam waktu singkat browser akan membuka halaman login.&lt;/p&gt;

&lt;p&gt;Klik &lt;strong&gt;Register&lt;/strong&gt; dan lakukan pendaftaran user baru. User ini akan secara otomatis menjadi administrator.&lt;/p&gt;

&lt;p&gt;Untuk menyelesaikan tahap instalasi Gitea, jalankan perintah berikut ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod 750 /etc/gitea
sudo chmod 640 /etc/gitea/app.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Konfigurasi Nginx sebagai Proxy SSL
&lt;/h2&gt;

&lt;p&gt;Tahap ini akan menunjukkan cara melakukan konfigurasi Nginx dan Lets Encrypt, agar Gitea dapat diakses via koneksi https dan tidak lagi menggunakan port. Tidak harus, namun &lt;strong&gt;sangat direkomendasikan&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Artikel ini akan menggunakan &lt;code&gt;git.contoh.com&lt;/code&gt; sebagai nama domain. Cek kembali pengaturan DNS dan pastikan nama domain sudah diarahkan ke alamat IP server ini, bisa dicek menggunakan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dig git.contoh.com +short
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output yang diharapkan adalah sebuah nomor IP, yaitu IP server ini.&lt;/p&gt;
&lt;h3&gt;
  
  
  Install Nginx
&lt;/h3&gt;

&lt;p&gt;Install Nginx dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Lalu periksa apakah berjalan normal dengan perintah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Outputnya akan terlihat mirip seperti ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since 1min 1s ago
     Docs: man:nginx(8)
 Main PID: 30035 (nginx)
    Tasks: 2 (limit: 661)
   CGroup: /system.slice/nginx.service
           ├─30035 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─30038 nginx: worker process
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Lakukan konfigurasi pada firewall untuk nginx, jika menggunakan &lt;code&gt;ufw&lt;/code&gt; firewall lakukan perintah berikut secara berurutan.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw disable
sudo ufw allow 'Nginx Full'
sudo ufw enable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Periksa status firewall dengan cara ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Outputnya kurang lebih akan terlihat seperti berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                  
Nginx Full                 ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)             
Nginx Full (v6)            ALLOW       Anywhere (v6)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Setelah itu buka browser dan coba akses alamat &lt;code&gt;http://IP_ADDRESS&lt;/code&gt;, apabila terlihat halaman dengan tulisan,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Welcome to nginx!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Berarti langkah instalasi Nginx selesai. Cara instalasi diatas bisa juga dibaca pada artikel berikut.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Buat server block
&lt;/h3&gt;

&lt;p&gt;Langkah selanjutnya, adalah membuat server block untuk domain &lt;code&gt;git.contoh.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Pertama, sediakan direktori yang akan menjadi tempat menaruh semua file website nantinya. Jalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /var/www/git.contoh.com/public_html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Selanjutnya buat file &lt;code&gt;index.html&lt;/code&gt; yang akan menjadi halaman utama dari domain &lt;code&gt;git.contoh.com&lt;/code&gt; dengan menjalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /var/www/git.contoh.com/public_html/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Pada editor teks yang terbuka, salin kode dibawah ini atau silahkan gunakan kode milik sendiri.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en" dir="ltr"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8"&amp;gt;
    &amp;lt;title&amp;gt;Welcome to git.contoh.com&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Success! git.contoh.com home page!&amp;lt;/h1&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Simpan dan tutup editor teksnya, lalu eksekusi perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R www-data: /var/www/git.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Langkah kedua, pembuatan server block dengan cara berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/sites-available/git.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Pada editor teks yang terbuka, gunakan kode dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    listen [::]:80;

    root /var/www/git.contoh.com/public_html;

    index index.html;

    server_name git.contoh.com;

    access_log /var/log/nginx/git.contoh.com.access.log;
    error_log /var/log/nginx/git.contoh.com.error.log;

    location / {
        try_files $uri $uri/ =404;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Untuk mengaktifkan konfigurasi server block diatas, jalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/git.contoh.com /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Selanjutnya cek konfigurasi Nginx jika terdapat error.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Jika tanpa error, outputnya akan terlihat seperti berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Restart Nginx.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Silahkan cek server block yang baru dibuat apakah berfungsi dengan baik. Caranya dengan mengakses via browser alamat &lt;code&gt;http://git.contoh.com&lt;/code&gt;, hasil yang diharapkan adalah terlihat sebuah halaman yang bertuliskan,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Success! git.contoh.com home page!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cara instalasi server block untuk Nginx bisa juga dibaca pada artikel berikut.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Proteksi server block dengan Let's Encrypt
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Instalasi Certbot
&lt;/h4&gt;

&lt;p&gt;Untuk mendaftarkan certbot, jalankan perintah berikut secara berurutan. Perintah pada baris terakhir akan membutuhkan waktu yang agak lama, harap sabar menunggu hingga selesai.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install certbot
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Pendaftaran sertifikat SSL dari Let’s Encrypt
&lt;/h4&gt;

&lt;p&gt;Jalankan perintah berikut secara berurutan.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p /var/lib/letsencrypt/.well-known
chgrp www-data /var/lib/letsencrypt
chmod g+s /var/lib/letsencrypt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Buat file &lt;code&gt;letsencrypt.conf&lt;/code&gt; dengan cara berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/snippets/letsencrypt.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Salin dan isi kode dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;location ^~ /.well-known/acme-challenge/ {
  allow all;
  root /var/lib/letsencrypt/;
  default_type "text/plain";
  try_files $uri =404;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Simpan perubahan dan lanjutkan membuat file kedua yaitu &lt;code&gt;ssl.conf&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/snippets/ssl.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Salin dan isi kode dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssl_dhparam /etc/ssl/certs/dhparam.pem;

ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;

ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 30s;

add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Simpan perubahan, selanjutnya file &lt;code&gt;letsencrypt.conf&lt;/code&gt; harus dideklarasikan pada server block dengan cara berikut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/sites-available/git.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Tambahkan baris kode berikut ini dalam file tersebut.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  include snippets/letsencrypt.conf;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Konfigurasinya sekarang kurang lebih akan terlihat seperti ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    listen [::]:80;

    root /var/www/git.contoh.com/public_html;

    index index.html;

    server_name git.contoh.com;

    access_log /var/log/nginx/git.contoh.com.access.log;
    error_log /var/log/nginx/git.contoh.com.error.log;

    include snippets/letsencrypt.conf;

    location / {
        try_files $uri $uri/ =404;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Simpan perubahan, verifikasi kembali konfigurasinya jika sudah benar.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Jika bebas error, lanjutkan dengan me-restart nginx.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Sesudah restart, jalankan perintah berikut untuk mendaftarkan sertifikat SSL untuk server block domain yang baru dibuat diatas. Perhatikan, jangan lupa tulisan &lt;code&gt;ALAMAT_EMAIL&lt;/code&gt; diganti dengan alamat email milik Anda.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot certonly --agree-tos --email ALAMAT_EMAIL --webroot -w /var/lib/letsencrypt/ -d git.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Output yang dihasilkan apabila sertifikat SSL berhasil diperoleh, akan terlihat seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/git.contoh.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/git.contoh.com/privkey.pem
   Your cert will expire on 2021-06-28. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. 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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Sekarang setelah sertifikat SSL sudah diperoleh, edit kembali file konfigurasi server block.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/sites-available/git.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Salin dan update dengan menggunakan kode dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    server_name git.contoh.com;

    root /var/www/git.contoh.com/public_html;

    index index.html;

    include snippets/letsencrypt.conf;

    access_log /var/log/nginx/git.contoh.com.access.log;
    error_log /var/log/nginx/git.contoh.com.error.log;

    location / {
        try_files $uri $uri/ =404;
    }

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name git.contoh.com;

    root /var/www/git.contoh.com/public_html;

    index index.html;

    ssl_certificate /etc/letsencrypt/live/git.contoh.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/git.contoh.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/git.contoh.com/chain.pem;
    include snippets/ssl.conf;
    include snippets/letsencrypt.conf;

    # . . . kode lainnya
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Simpan perubahan, verifikasi kembali konfigurasinya jika sudah benar.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Jika bebas error, lanjutkan dengan me-restart nginx.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Buka browser, lalu coba akses domain kali dengan menggunakan &lt;code&gt;https://git.contoh.com&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;
  
  
  Pengaturan cronjob untuk certbot
&lt;/h4&gt;

&lt;p&gt;Langkah ini bertujuan untuk memastikan sertikat SSL Let's Encrypt diperpanjang secara otomatis, ketika akan habis masa berlakunya dalam waktu &lt;code&gt;30&lt;/code&gt; hari.&lt;/p&gt;

&lt;p&gt;Pertama, edit cronjob milik certbot dengan perintah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/cron.d/certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Ubah baris cronjob yang sudah ada menjadi seperti dibawah ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system &amp;amp;&amp;amp; perl -e 'sleep int(rand(3600))' &amp;amp;&amp;amp; certbot -q renew --renew-hook "systemctl reload nginx"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Simpan perubahan diatas, selanjutnya untuk mengecek proses perpanjangan sertifikat SSL, bisa dicoba dengan perintah &lt;code&gt;--dry-run&lt;/code&gt; berikut ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot renew --dry-run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Jika tidak muncul error, maka outputnya akan terlihat seperti ini.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

Congratulations, all renewals succeeded. The following certs have been renewed:
  /etc/letsencrypt/live/git.contoh.com/fullchain.pem (success)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - 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.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Cara memproteksi Nginx dengan Let's Encrypt bisa juga dibaca pada artikel berikut.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;div class="ltag__link__content"&gt;
    &lt;div class="missing"&gt;
      &lt;h2&gt;Article No Longer Available&lt;/h2&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Konfigurasi lanjutan Gitea
&lt;/h2&gt;

&lt;p&gt;Edit file konfigurasi server block untuk domain &lt;code&gt;git.contoh.com&lt;/code&gt; dengan menjalankan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/nginx/sites-enabled/git.contoh.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pada editor teks yang terbuka, salin dan update file dengan menggunakan kode dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    server_name git.contoh.com;

    include snippets/letsencrypt.conf;
    return 301 https://git.contoh.com$request_uri;
}

server {
    listen 443 ssl http2;
    server_name git.contoh.com;

    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    client_max_body_size 50m;

    # Proxy headers
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;

    # SSL parameters
    ssl_certificate /etc/letsencrypt/live/git.contoh.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/git.contoh.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/git.contoh.com/chain.pem;
    include snippets/letsencrypt.conf;
    include snippets/ssl.conf;

    # log files
    access_log /var/log/nginx/git.contoh.com.access.log;
    error_log /var/log/nginx/git.contoh.com.error.log;

    # Handle / requests
    location / {
       proxy_redirect off;
       proxy_pass http://127.0.0.1:3000;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahan, verifikasi kembali konfigurasinya jika sudah benar.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jika bebas error, lanjutkan dengan me-restart nginx.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Selanjutnya ganti url default Gitea dengan domain &lt;code&gt;git.contoh.com&lt;/code&gt; lewat perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/gitea/app.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pada editor teks, cari bagian &lt;code&gt;[server]&lt;/code&gt; kemudian ubah menjadi seperti berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[server]
DOMAIN           = git.contoh.com
ROOT_URL         = https://git.contoh.com/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahan, dan restart Gitea.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sampai pada langkah ini, Gitea sudah bisa diakses menggunakan alamat &lt;code&gt;https://git.contoh.com&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Konfigurasi notifikasi email
&lt;/h2&gt;

&lt;p&gt;Supaya Gitea bisa mengirimkan email notifikasi, dibutuhkan pengaturan lanjutan pada file konfigurasi Gitea.&lt;/p&gt;

&lt;p&gt;Buka file konfigurasi Gitea.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vim /etc/gitea/app.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cari bagian &lt;code&gt;[mailer]&lt;/code&gt; dan lakukan perubahan di bagian itu dengan memasukkan konfigurasi SMTP yang tepat. Konfigurasi yang salah, akan menyebabkan email notifikasi tidak akan terkirim.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[mailer]
ENABLED = true
HOST    = SMTP_SERVER:SMTP_PORT
FROM    = SENDER_EMAIL
USER    = SMTP_USER
PASSWD  = YOUR_SMTP_PASSWORD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simpan perubahan, dan restart kembali Gitea.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Untuk melakukan pengecekan apakah berfungsi dengan baik, kunjungi: Site Administration &amp;gt; Configuration &amp;gt; SMTP Mailer Configuration, dan cobalah untuk mengirim Test Email dari situ.&lt;/p&gt;

&lt;h2&gt;
  
  
  Upgrade Gitea
&lt;/h2&gt;

&lt;p&gt;Stop Gitea terlebih dulu dengan perintah berikut.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Kunjungi  &lt;a href="https://dl.gitea.io/gitea/" rel="noopener noreferrer"&gt;halaman unduhan Gitea&lt;/a&gt; dan lihat versi terbaru yang tersedia untuk diunduh. Lalu ganti variabel dari &lt;code&gt;VERSION&lt;/code&gt; pada perintah dibawah, dan jalankan perintah ini secara berurutan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VERSION=&amp;lt;VERSI_TERBARU_GITEA&amp;gt;
wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64
sudo mv /tmp/gitea /usr/local/bin
sudo chmod +x /usr/local/bin/gitea
sudo systemctl restart gitea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bisa juga dilakukan dengan membuat file &lt;code&gt;gitea-upgrade.sh&lt;/code&gt; dan mengisi-nya dengan kode dibawah ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

VERSION=&amp;lt;VERSI_TERBARU_GITEA&amp;gt;

echo -e "\n"
echo -e "\e[0;36m..---Upgrade Gitea---...\e[m"
echo "......" &amp;amp;&amp;amp; sudo systemctl stop gitea &amp;amp;&amp;amp; sleep 1
wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 &amp;amp;&amp;amp; sleep 1
sudo mv /tmp/gitea /usr/local/bin &amp;amp;&amp;amp; sleep 1
sudo chmod +x /usr/local/bin/gitea &amp;amp;&amp;amp; sleep 1
sudo systemctl restart gitea
echo -e "\e[0;36m&amp;gt;&amp;gt; SUKSES upgrade Gitea ke versi ${VERSION}.\e[m"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jangan lupa mengganti variable &lt;code&gt;VERSION&lt;/code&gt; terlebih dulu sebelum menyimpan file nya. Untuk mengeksekusinya, jalankan perintah berikut ini.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo bash gitea-upgrade.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Selesai.&lt;/p&gt;

</description>
      <category>gitea</category>
      <category>linux</category>
      <category>indonesia</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
