“Cara Install Let’s Encrypt dengan Apache di Ubuntu 20.04 – new update”
Daftar Isi
Pengantar
Let’s Encrypt merupakan SSL yang bisa di pasang untuk domain dan tidak berbayar alias gratis.
Install Apache2
apt update
- Install apache
apt install apache2 -y systemctl enable apache2 systemctl status apache2
- Allow firewall
ufw allow 'Apache Full'
http://your_server_ip
Setting Virtualhost
- Buat direktori baru
mkdir -p /var/www/your_domain chown -R $USER:$USER /var/www/your_domain chmod -R 755 /var/www/your_domain
- Buat file
nano /var/www/your_domain/index.html
<html> <head> <title>Welcome to Your_domain!</title> </head> <body> <h1>Success! The your_domain virtual host is working!</h1> </body> </html>
- Tambah konfig apache2
nano /etc/apache2/sites-available/your_domain.conf
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName your_domain ServerAlias www.your_domain DocumentRoot /var/www/your_domain ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
- Cek Config
a2ensite your_domain.conf a2dissite 000-default.conf apache2ctl configtest systemctl restart apache2
- Akses browser
http://your_domain
Install SSL Let’s Encrypt
- Install package
apt install certbot python3-certbot-apache -y
- Install ssl
sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): you@your_domain
Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: your_domain 2: www.your_domain - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel):
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
- Renewal SSL
systemctl status certbot.timer sudo certbot renew --dry-run
- Akses domain
https://domainname
Penutup
Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cara Install Let’s Encrypt dengan Apache di Ubuntu 20.04 – new update. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.
(Visited 508 times, 1 visits today)