HTTPS in Local Network (Ubuntu Server 20.04)¶
sudo su
openssl req -x509 -days 1 -newkey rsa:2048 -keyout /home/carloz/localhost.key -out /home/carloz/localhost.crt
Enter PEM pass phrase: misal 1234 (antara 4 - 1024 character)
country name : ID
state or province : Jawa Tengah
locality name : Kudus
organization name : AUWO
organizational unit name : AUWO2
common name : ganteng
email addr : carloz@ganteng.com
isi dengan :
<VirtualHost *:443>
ServerName 127.0.1.1
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile "/home/carloz/localhost.crt"
SSLCertificateKeyFIle "/home/carloz/localhost.key"
<Directory /var/www/html>
AllowOverride all
</Directory>
</VirtualHost>
cek status :
jika ada error, silahkan oprec2 sendiri
misal error "Invalid command 'SSLEngine', blablablaa....", seperti gambar :
maka dapat dengan :
lalu setelah error hilang :
enter passphrase : 1234
done
buka web browser, masukkan https://localhost/
atau https://ip/
jika ada warning, tinggal klik advanced...
, accept the risk and continue
suatu ketika kok terjadi loading lama di web, coba
masukkan kode rsa nya '1234'