How to enable and configure SSL (HTTPS) in Apache on Ubuntu 22.10

To enable SSL in Apache 2 on Ubuntu 20.10, you can follow these steps:

Install the Apache2 SSL module


sudo apt-get update

sudo apt-get install libssl-dev apache2-utils

sudo a2enmod ssl

Create a new SSL certificate and private key for your domain

Create a new SSL certificate and key pair for your domain. Make sure you change the your_domain.key to your own domain name; whilst it won't really make a difference, if you're securing a number of different domains it makes sense to create the keys with the domain they match as it can often be confusing when copying keys around servers if they're all named by default names!


sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/your_domain.key -out /etc/ssl/certs/your_domain.crt

Configure a virtual host for your domain in Apache


sudo nano /etc/apache2/sites-available/your_domain.conf


    ServerAdmin admin@your_domain.com
    ServerName your_domain.com
    DocumentRoot /var/www/your_domain
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/your_domain.crt
    SSLCertificateKeyFile /etc/ssl/private/your_domain.key

    
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    

Name

false
ltr
static_page
Tech Lab: How to enable and configure SSL (HTTPS) in Apache on Ubuntu 22.10
How to enable and configure SSL (HTTPS) in Apache on Ubuntu 22.10
Tech Lab
https://techlab.connektiv8.com/p/how-to-enable-and-configure-ssl-https.html
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/p/how-to-enable-and-configure-ssl-https.html
true
5093225316588518036
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network