• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer

ATA ENDE

Catatan Orang Ende

  • Teknologi Informasi
    • IOT
    • Smart Home
    • Server
    • Mac OS
    • Android
  • Otomotif
    • BMW E36
  • DIY
  • Traveling
    • Ende
  • Olahraga
    • Running
  • Rohani
  • Lainnya
  • Privacy Policy
  • About
You are here: Home / IT / Mengamankan Apache dengan SSL Gratis Lets Encrypt

Mengamankan Apache dengan SSL Gratis Lets Encrypt

November 17, 2020 by lorenz Leave a Comment

Lets Encrypt adalah Certificate Authority (CA) yang menyediakan layanan ssl gratis untuk keamanan website. Dengan menggunakan layanan Lets Encrypt, kita bisa menambahkan https pada url website sehingga menambah keamanan, kepercayaan dan juga kualitas SEO yang baik. Proses instalasi Lets Encrypt untuk web server Apache pada server Ubuntu sendiri sangat mudah.

SSL gratis Lets Encrypt

Pada artikel ini saya akan membagikan langkah – langkah untuk menginstall ssl gratis Lets Encrypt pada server Ubuntu 16.04 dan web server Apache. Tentunya terlebih dahulu web server Apache harus sudah terinstall karena tidak saya sertakan proses instalasinya disini.

Berikut adalah langkah-langkah untuk menginstall Lets Encrypt

Install Certbot

Certbot adalah software tool yang digunakan untuk mendapatkan sertifikat ssl secara otomatis dari Lets Encrypt. Certbot tersedia pada repository Ubuntu dan saat ini dalam keadaan aktif didevelop oleh developer Certbot.

Tambahkan terlebih dahulu repository Certbot

$sudo add-apt-repository ppa:certbot/certbot
$sudo apt update

Install Certbot dengan plugin untuk webserver Apache

$sudo apt install python-certbot-apache

Setelah instalasi selesai, cek versi certbot yang terinstall. Saat instalasi versi certbot saya adalah certbot 0.31.0

$sudo certbot --version

Pastikan plugin Certbot untuk Apache sudah diinstal

$sudo certbot plugins

Output

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* apache
Description: Apache Web Server plugin
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.entrypoint:ENTRYPOINT

* standalone
Description: Spin up a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = certbot.plugins.standalone:Authenticator

* webroot
Description: Place files in webroot directory
Interfaces: IAuthenticator, IPlugin
Entry point: webroot = certbot.plugins.webroot:Authenticator
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Jika tampilan seperti di atas dengan modul *apache yang tertera maka Certbot sudah bisa digunakan dengan web server Apache

Download Sertifikat SSL

Plugin Apache yang sudah terinstall tadi akan otomatis mengkonfigurasi ssl pada file konfigurasi Apache dan sekaligus mereload servis Apache.

$sudo certbot --apache -d namadomain.com -d www.namadomain.com

Opsi -d menunjukkan nama domain server kita yang akan ditambahkan ssl-nya. Jika ini adalah kali pertama menginstall Certbot maka kita akan diminta memasukkan alamat email dan persetujuan pada Terms & Condition Lets Encrypt. Masukkan alamat email yang aktif karena email ini akan digunakan oleh Lets Encrypt untuk mengirim notifikasi perpanjangan masa aktif sertifikat SSL.

Output

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Certbot akan menanyakan opsi untuk redirect dari http ke https. Pilih nomor 1 jika kita tidak ingin redirect otomatis dari http ke https dan nomor 2 untuk redirect otomatis dari http ke https. Contohya jika user mengetik http://www.namadomain.com pada web browser, maka web server akan otomatis meredirect ke https://www.namadomain.com.

Plugin Certbot untuk apache akan otomatis mengupdate konfigurasi virtual host dan mereload servis Apache. Silahkan cek file konfigurasi virtual hosts di /etc/apache2/sites-enabled. Akan ada file baru yang ditambahakan untuk konfigurasi virtual host dengan support ssl/https. Sebaga contoh, domain non https saya ada di file 000-default.com. Plugin Certbot akan menambahkan file konfigurasi untuk https pada file 000-default-le-ssl.conf. Perhatikan ada tambahaan suffix -le-ssl pada nama file konfigurasi virtual host untuk https/ssl..

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://namadomain.com and
https://www.namadomain.com

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/namadomain.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/namadomain.com/privkey.pem
   Your cert will expire on 2021-02-14. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

Jika sukses anda akan mendapatkan pesan seperti di atas. Perhatikan sertifikat ssl kita disimpan di direktori /etc/letsencrypt/live/namadomain.com dan tanggal kadaluarsa yang biasanya berlaku tiga bulan ke depan.

Perpanjang Sertifikat Otomatis

Tools Certbot akan menghandle proses perpanjangan sertifikat secara otomatis jadi kita tidak perlu secara manual memperpanjang. Proses perpanjangan otomatis ini dijalankan oleh script cerbot.timer yang dikelola oleh system servis systemctl. Script ini berjalan dua kali sehari dan akan memperpanjang secara otomatis sertifikat jika berada dalam periode 30 hari sebelum kadaluarsa.

Untuk mengecek servis/scriptnya, gunakan perintah

$sudo systemctl status certbot.timer

Output

● certbot.timer - Run certbot twice daily
   Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Mon 2020-11-16 15:51:35 WIB; 19h ago

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Jika karena satu dan lain hal proses perpanjangan otomatis gagal, maka Lets Encrypt akan mengirimkan email notifkasi ke alamat email yang telah kita daftarkan sebelumnya.

Note:

Untuk mengubah alamat email, gunakankan perintah

$sudo certbot update_account

Oke prosesnya gampang bukan, dengan beberapa langkah di atas kita bisa mendapatkan sertifikat ssl gratis. Walaupun harus diperpanjang tiga bulan sekali namun kita tidak perlu direpotkan dengan proses perpanjangan manual. Yang perlu diperhatikan adalahs jangan lupa cek email juga. Jika ada kendala dalam perpanjangan otomatis, Lets Encrypt akan mengirimkan email notifikasi untuk dilakukan perpanjangan secara manual. Selamat mencoba!

Related posts:

  1. Cara Upgrade Ke PHP7.4 pada OS Openhabian
  2. Cara Online CCTV Hikvision dengan Hik-Connect
  3. Membangun Server Home Automation dengan Openhab dan Raspberry Pi
  4. Top 5 Extension Chrome untuk Screenshot

Filed Under: IT Tagged With: apache, https, lets encrypt, security, ssl, ubuntu

About lorenz

A husband, father, passionate software developer, diy lover, home baker, who loves to learn and create new things.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

About Me

A husband, father, passionate software developer, diy lover, home baker, who loves to learn and create new things. Read More…

Ende

Bukit Roja Ende Flores

Kembali lagi Ke Bukit Roja (Jilid 2)

May 3, 2021 By lorenz 187 Comments

Bukit Kezimara Ende

Bukit Kezimara, Spot Paralayang Instagramable di Kota Ende

April 29, 2021 By lorenz Leave a Comment

Bukit Woloweku Ende

Bukit Woloweku, Spot Foto Instagramable di Kota Ende

April 26, 2021 By lorenz Leave a Comment

More Posts from this Category

Smart Home

Ip camera hikvision

Cara Online IP Camera CCTV Hikvision

July 28, 2021 By lorenz Leave a Comment

Sonoff Slampher

Cara Menggunakan Sonoff Slampher (Fitting Lampu Otomatis)

July 19, 2021 By lorenz 3 Comments

Hik-connect

Cara Online CCTV Hikvision dengan Hik-Connect

February 1, 2021 By lorenz 187 Comments

More Posts from this Category

Tags

ads scanner android arduino berkat rumah bmw bmw e36 bmw m50 bukit roja cctv cooling system electrolux Error 1302 fan belt ffmpeg heart rate hik-connect hikvision home automation Huawei HG8245H5 ibadat pemberkatan rumah Indihome iot ip camera kipas radiator kota ende LAN Port lari m50 mesin cuci openhab raspberrypi running s20 smart home smarthome smart plug sonoff tasmota Telkom tensioner toren air tracking ubuntu USeeTV visco fan

My Strava

Footer

Recent Comments

  • Homepage on Memahami Konfigurasi Openhab: Things, Bridge dan Channels (2)
  • solorider.comforumsuserscanadian-pharmaceuticals on Kembali lagi Ke Bukit Roja (Jilid 2)
  • solorider.comforumsuserscanadian-pharmaceuticals on Cara Online CCTV Hikvision dengan Hik-Connect
  • top rated online canadian pharmacies on Kembali lagi Ke Bukit Roja (Jilid 2)
  • http://www.mjyoung.net/weblog/forums/users/canada-online-pharmacies/ on Cara Online CCTV Hikvision dengan Hik-Connect

Galery

Bukit Roja Ende
Bukit Roja Ende
Woloweku Ende
Woloweku Ende
Bukit Kezimara Ende
Bukit Kezimara Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende
Bukit Roja Ende

Social

  • Facebook
  • Instagram
  • Twitter
  • YouTube

Copyright © 2023 · Ataende.com