{"id":38759,"date":"2021-09-27T12:30:00","date_gmt":"2021-09-27T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=38759"},"modified":"2022-10-03T09:19:11","modified_gmt":"2022-10-03T14:19:11","slug":"how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/","title":{"rendered":"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\r\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"742\" height=\"372\" class=\"wp-image-38786\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg\" alt=\"How to Enable HTTPS protocol with Apache 2 on Ubuntu 20.04\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04-150x75.jpg 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>HTTPS is the secure version of Hypertext Transfer Protocol (HTTP). HTTPS uses the SSL\/TLS protocol for encryption and authentication, and for securing the communication between the browser and the web server. It encrypts HTTP requests and responses to prevent someone from sniffing the information that is shared between your browser and the web server. Without HTTPS, someone would be able to sniff and collect your website visitors&#8217; sensitive information such as login credentials and credit card details.<\/p>\r\n\r\n\r\n\r\n<p><!--more--><\/p>\r\n\r\n\r\n\r\n<p>In this tutorial, we will show you how to enable HTTPS protocol with Apache2 on our <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\">managed Ubuntu VPS<\/a>. By default, if you install Apache on your Ubuntu 20.04 server, it will create an apache virtual host for your server\u2019s hostname, and it only listens on the non-secure port (HTTP\/80). This means, that if you navigate to your server\u2019s hostname using a web browser, you will see the default page of Apache2 Ubuntu, and if you access it through HTTPS, it will throw an error message as Apache2 is not listening on port 443 and no SSL certificate is configured.<\/p>\r\n\r\n\r\n\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f2f232b8223\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f2f232b8223\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#Step-1-Log-in-via-SSH-and-Update-Packages\" >Step 1: Log in via SSH and Update Packages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#Step-2-Enable-Mod-SSL\" >Step 2: Enable Mod SSL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#Step-3-Create-a-Self-Signed-SSL-Certificate\" >Step 3: Create a Self-Signed SSL Certificate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#Step-4-Enable-HTTPS-and-Install-an-SSL-Certificate\" >Step 4: Enable HTTPS and Install an SSL Certificate<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-prerequisites\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>A server with Ubuntu 20.04 and Apache.<\/li>\r\n<li>A root user access or regular user with sudo privileges.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-1-Log-in-via-SSH-and-Update-Packages\"><\/span>Step 1: Log in via SSH and Update Packages<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Log in to your Ubuntu 20.04 VPS through SSH:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">ssh sshuser@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\n<p>Replace \u201csshuser\u201d with a user that has sudo privileges, or root. Additionally, replace \u201cIP_Address\u201d and \u201cPort_Number\u201d with your server\u2019s respective IP address and SSH port.<\/p>\r\n\r\n\r\n\r\n<p>Once logged in, you can check whether you have the proper Ubuntu 20.04 version installed on your server with the following command:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo lsb_release -a<\/pre>\r\n\r\n\r\n\r\n<p>You should get this output:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">No LSB modules are available.<br \/>Distributor ID: Ubuntu<br \/>Description: Ubuntu 20.04.3 LTS<br \/>Release: 20.04<br \/>Codename: focal<\/pre>\r\n\r\n\r\n\r\n<p>Then, run the following command to make sure that all installed packages on the server are updated to their latest available versions:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo apt update &amp;&amp; sudo apt upgrade<\/pre>\r\n\r\n\r\n\r\n<p>This ensures compatibility between packages.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-2-Enable-Mod-SSL\"><\/span>Step 2: Enable Mod SSL<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Before starting, we need to enable the Apache SSL module, run this command:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo a2enmod ssl<\/pre>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"858\" height=\"187\" class=\"wp-image-38790\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-with-apache-on-ubuntu-20.04.png\" alt=\"\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-with-apache-on-ubuntu-20.04.png 858w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-with-apache-on-ubuntu-20.04-300x65.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-with-apache-on-ubuntu-20.04-150x33.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-with-apache-on-ubuntu-20.04-768x167.png 768w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>As seen in the message after running the command, we need to restart Apache to activate the changes.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo systemctl restart apache2<\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-3-Create-a-Self-Signed-SSL-Certificate\"><\/span>Step 3: Create a Self-Signed SSL Certificate<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>A <a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-generate-a-self-signed-ssl-certificate-on-linux\/\">self-signed SSL certificate<\/a> is a good option to choose when you are trying or testing things out on your Apache server. While your personal certificate won\u2019t mean anything to browsers, and visitors will still get a warning message if they visit your site directly, you can at least be sure that you\u2019re protected against \u201cman-in-the-middle\u201d attacks. If you already have a paid SSL certificate, you can skip this step and continue.<\/p>\r\n\r\n\r\n\r\n<p>Run this command to generate a self-signed SSL certificate.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/server.yourdomain.com.key -out \/etc\/ssl\/certs\/server.yourdomain.com.crt<\/pre>\r\n\r\n\r\n\r\n<p>When running the command above, you will need to answer the prompts.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">Country Name (2 letter code) [AU]:<br \/>State or Province Name (full name) [Some-State]:<br \/>Locality Name (eg, city) []:<br \/>Organization Name (eg, company) [Internet Widgits Pty Ltd]:<br \/>Organizational Unit Name (eg, section) []:<br \/>Common Name (e.g. server FQDN or YOUR name) []:<br \/>Email Address []:<\/pre>\r\n\r\n\r\n\r\n<p>Make sure you type the domain\/subdomain you want to install the SSL certificate for. For instance, you can type server.yourdomain.com<\/p>\r\n\r\n\r\n\r\n<p>The command above will store the private key at \/etc\/ssl\/private\/server.yourdomain.com.key and the certificate file at \/etc\/ssl\/certs\/server.yourdomain.com.crt<\/p>\r\n\r\n\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-4-Enable-HTTPS-and-Install-an-SSL-Certificate\"><\/span>Step 4: Enable HTTPS and Install an SSL Certificate<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>In this tutorial, we will use a separate Apache virtual host file instead of the default configuration file. We assume that you already have a working apache virtual host for your domain. We can run the command below to copy yourdomain.com.conf configuration file to yourdomain.com-ssl.conf. Please change yourdomain.com to your own .conf file in the command to make sure it runs properly.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo cp -a \/etc\/apache2\/sites-available\/yourdomain.com{.conf,-ssl.conf}<\/pre>\r\n\r\n\r\n\r\n<p>Let&#8217;s edit the new file.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo nano \/etc\/apache2\/sites-available\/yourdomain.com-ssl.conf<\/pre>\r\n\r\n\r\n\r\n<p>Replace<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">&lt;VirtualHost *:80&gt;  <\/pre>\r\n\r\n\r\n\r\n<p>in the first line with<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">&lt;VirtualHost *:443&gt;<\/pre>\r\n\r\n\r\n\r\n<p>Then, add these three lines:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">SSLEngine on<br \/>SSLCertificateKeyFile \/etc\/ssl\/private\/server.yourdomain.com.key<br \/>SSLCertificateFile \/etc\/ssl\/certs\/server.yourdomain.com.crt<\/pre>\r\n\r\n\r\n\r\n<p>Save the file then exit.<\/p>\r\n\r\n\r\n\r\n<p>After this, we need to enable the SSL version of your site. We can run this command to enable the site:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo a2ensite yourdomain.com-ssl.conf<\/pre>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"702\" height=\"107\" class=\"wp-image-38791\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/https-protocol-with-apache-on-ubuntu-20.04.png\" alt=\"\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/https-protocol-with-apache-on-ubuntu-20.04.png 702w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/https-protocol-with-apache-on-ubuntu-20.04-300x46.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/https-protocol-with-apache-on-ubuntu-20.04-150x23.png 150w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>At last, check your apache2 configuration by running this command:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo apache2ctl -t<\/pre>\r\n\r\n\r\n\r\n<p>If everything is okay then you would see \u201cSyntax OK\u201d message, you can restart Apache.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">$ sudo systemctl restart apache2<\/pre>\r\n\r\n\r\n\r\n<p>Please note, if you already have a paid SSL certificate, you can edit the <strong>SSLCertificateKeyFile <\/strong>and <strong>SSLCertificateFile <\/strong>directives and point them to the correct path of your SSL certificate file and its private key.<\/p>\r\n\r\n\r\n\r\n<p>You can also run the command below to check if the SSL version of your website is enabled or not.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"821\" height=\"333\" class=\"wp-image-38794\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-apache-ubuntu-20.04.png\" alt=\"\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-apache-ubuntu-20.04.png 821w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-apache-ubuntu-20.04-300x122.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-apache-ubuntu-20.04-150x61.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/enable-https-protocol-apache-ubuntu-20.04-768x312.png 768w\" sizes=\"(max-width: 821px) 100vw, 821px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>That is all! When Apache restarts, it will be configured to allow SSL connections by using the generated self-signed SSL certificates. When you navigate to your website via HTTPS, you\u2019ll be warned that it\u2019s not a trusted certificate. That\u2019s okay. We know this since we signed it ourselves! Just proceed and you will see your actual website. This will not happen if you use a paid SSL certificate or an SSL certificate provided by Letsencrypt.<\/p>\r\n\r\n\r\n\r\n<p>Congratulations! At this point, you should be able to enable HTTPS protocol with Apache2 on Ubuntu 20.04.<\/p>\r\n\r\n\r\n\r\n<p>Of course, you don\u2019t have to know how to enable HTTPS protocol with Apache2 on Ubuntu 20.04 if you have an <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\">Ubuntu 20.04 VPS hosted<\/a> with us. You can simply ask our support team to enable HTTPS protocol with Apache2 on Ubuntu 20.04 for you. They are available 24\/7 and will be able to help you with the HTTPS protocol configuration.<\/p>\r\n\r\n\r\n\r\n<p>PS. If you enjoyed reading this blog post on how to enable HTTPS protocol with Apache2 on Ubuntu 20.04, feel free to share it on social networks or simply leave a comment in the comments section. Thank you.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>HTTPS is the secure version of Hypertext Transfer Protocol (HTTP). HTTPS uses the SSL\/TLS protocol for encryption and authentication, and &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#more-38759\" aria-label=\"Read more about How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":38786,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[1938,1937,1839],"class_list":["post-38759","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-ubuntu","tag-apache2","tag-https-protocol","tag-ubuntu-20-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How To Enable HTTPS Protocol With Apache 2 On Ubuntu 20.04<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will show you how to enable HTTPS protocol with Apache 2 on Ubuntu 20.04. Read on to find out more!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will show you how to enable HTTPS protocol with Apache2 on Ubuntu 20.04. Read on to find out more!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-27T17:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-03T14:19:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg?v=1629793089\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"In this tutorial, we will show you how to enable HTTPS protocol with Apache2 on Ubuntu 20.04. Read on to find out more!\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04\",\"datePublished\":\"2021-09-27T17:30:00+00:00\",\"dateModified\":\"2022-10-03T14:19:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/\"},\"wordCount\":874,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg\",\"keywords\":[\"apache2\",\"https protocol\",\"Ubuntu 20.04\"],\"articleSection\":[\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/\",\"name\":\"How To Enable HTTPS Protocol With Apache 2 On Ubuntu 20.04\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg\",\"datePublished\":\"2021-09-27T17:30:00+00:00\",\"dateModified\":\"2022-10-03T14:19:11+00:00\",\"description\":\"In this tutorial, we will show you how to enable HTTPS protocol with Apache 2 on Ubuntu 20.04. Read on to find out more!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg\",\"width\":742,\"height\":372,\"caption\":\"How to Enable HTTPS protocol with Apache 2 on Ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How To Enable HTTPS Protocol With Apache 2 On Ubuntu 20.04","description":"In this tutorial, we will show you how to enable HTTPS protocol with Apache 2 on Ubuntu 20.04. Read on to find out more!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04","og_description":"In this tutorial, we will show you how to enable HTTPS protocol with Apache2 on Ubuntu 20.04. Read on to find out more!","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2021-09-27T17:30:00+00:00","article_modified_time":"2022-10-03T14:19:11+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg?v=1629793089","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_description":"In this tutorial, we will show you how to enable HTTPS protocol with Apache2 on Ubuntu 20.04. Read on to find out more!","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04","datePublished":"2021-09-27T17:30:00+00:00","dateModified":"2022-10-03T14:19:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/"},"wordCount":874,"commentCount":9,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg","keywords":["apache2","https protocol","Ubuntu 20.04"],"articleSection":["Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/","name":"How To Enable HTTPS Protocol With Apache 2 On Ubuntu 20.04","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg","datePublished":"2021-09-27T17:30:00+00:00","dateModified":"2022-10-03T14:19:11+00:00","description":"In this tutorial, we will show you how to enable HTTPS protocol with Apache 2 on Ubuntu 20.04. Read on to find out more!","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2021\/08\/how-to-enable-https-protocol-with-apache2-on-ubuntu-20.04.jpg","width":742,"height":372,"caption":"How to Enable HTTPS protocol with Apache 2 on Ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-https-protocol-with-apache-2-on-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Enable HTTPS Protocol with Apache 2 on Ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=38759"}],"version-history":[{"count":9,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38759\/revisions"}],"predecessor-version":[{"id":51259,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/38759\/revisions\/51259"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/38786"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=38759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=38759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=38759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}