Ngulik CloudNgulik Linux

Cara Install SSL dan Costume Domain pada Zabbix pada Ubuntu

secara default setelah Anda berhasil menginstall zabbix di server maka zabbix frontend hanya dapat melalui HTTP (port 80). Maka dari ini untuk menginstall SSL pada zabbix, Anda dapat menggunakan free HTTPS certificate Certbot.

Install Certbot dan python3-certbot-apache

# apt-add-repository -r ppa:certbot/certbot

# apt update

# apt-get install certbot python3-certbot-apache

# certbot --apache -d zabbix.maringulik.com (domain atau subdomain yang Anda akan install certificate)

Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): admin@maringulik.com (isi dengan email Anda)

lease read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N

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

Setelah instalasi certificate menggunakan certbot berhasil maka Anda dapat coba akses zabbix menggunakan HTTPS

Dalam contoh gambar diatas, instalasi certificate sudah berhasil.

Lalu jika Anda tidak mgninginkan/zabbix ketika akses zabbix frontend maka Ada dapat melakukan konfigurasi pada  /etc/apache2/sites-enabled/zabbix-le-ssl.conf dan /etc/apache2/sites-available/zabbix-le-ssl.conf contoh berikut

# nano /etc/apache2/sites-enabled/zabbix-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /usr/share/zabbix
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName zabbix.maringulik.com
ServerAlias zabbix.maringulik.com
SSLCertificateFile /etc/letsencrypt/live/zabbix.maringulik.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/zabbix.maringulik.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

# nano /etc/apache2/sites-available/zabbix-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /usr/share/zabbix
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName zabbix.maringulik.com
ServerAlias zabbix.maringulik.com
SSLCertificateFile /etc/letsencrypt/live/zabbix.maringulik.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/zabbix.maringulik.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

# service apache2 restart

Maka zabbix frontend sudah dapat diakses tanpa tambahan /zabbix

Leave a Response