/* Subject: Apache 2.4 SSL Self Signed Guide - Ubuntu 20.04 Install Guide Created Date: 2022-04-18 Author: Doyun Jung(정도윤) / rabbit.white@daum.net Description: */ # sudo a2enmod ssl # sudo systemctl restart apache2 ------------------------------------------------- | Creating the SSL Certificate | ------------------------------------------------- # sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt Country Name (2 letter code) [XX]:US State or Province Name (full name) []:Example Locality Name (eg, city) [Default City]:Example Organization Name (eg, company) [Default Company Ltd]:Example Inc Organizational Unit Name (eg, section) []:Example Dept Common Name (eg, your name or your server's hostname) []:your_domain_or_ip Email Address []:webmaster@example.com ------------------------------------------------ | Configuring Apache to Use SSL | ------------------------------------------------ # sudo vim /etc/apache2/sites-available/your_domain_or_ip.conf ServerName your_domain_or_ip DocumentRoot /var/www/your_domain_or_ip SSLEngine on SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key # sudo a2ensite your_domain_or_ip.conf # sudo apache2ctl configtest