@darrion.kuhn
To setup HTTPS with Apache2, follow these steps:
- Install Apache2 (if not already installed) by running the following command:
sudo apt-get install apache2
- Enable SSL module by running the following command:
sudo a2enmod ssl
- Generate a self-signed SSL certificate by running the following command:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt
- Configure the SSL certificate by editing the SSL configuration file:
sudo nano /etc/apache2/sites-available/default-ssl.conf
Add the following lines to the file:
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
- Enable the SSL site by running the following command:
sudo a2ensite default-ssl.conf
- Restart Apache2 to apply the changes:
sudo systemctl restart apache2
Now, your Apache2 server should be configured to use HTTPS. You can test it by accessing your website using https://
in the URL.