Enable Https On Ubuntu Web Server (20.04)
Enable Https On Ubuntu Web Server (20.04)
04) | IT Blog
Enable https on
Ubuntu Web Server
(20.04)
We went through LAMP stack installation
on Ubuntu Server. Now we will enable
https by installing mod_ssl and creating
self-signed certificate.
Before we begin
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 1/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
Enable mod_ssl
We need to enable it
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 2/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
Enter following
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 3/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
<VirtualHost *:443>
ServerName
your_domain_or_ip
DocumentRoot
/var/www/your_domain_or_ip
SSLEngine on
SSLCertificateFile
/etc/ssl/certs/ssl1.crt
SSLCertificateKeyFile
/etc/ssl/private/ssl1.key
</VirtualHost>
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 4/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
sudo a2ensite
your_domain_or_ip.conf
https://192.168.60.3
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 5/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
HTTP to HTTPS
redirection
<VirtualHost *:80>
ServerName
your_domain_or_ip
Redirect /
https://your_domain_or_ip/
</VirtualHost>
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 6/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
Disclaimer
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 7/8
10/26/22, 8:39 AM Enable https on Ubuntu Web Server (20.04) | IT Blog
Search …
https://www.informaticar.net/enable-https-on-ubuntu-web-server-20-04/ 8/8