{"id":2399,"date":"2018-07-16T04:05:57","date_gmt":"2018-07-16T09:35:57","guid":{"rendered":"https:\/\/www.rapidsslonline.com\/blog\/?p=2399"},"modified":"2025-06-05T12:08:54","modified_gmt":"2025-06-05T17:38:54","slug":"apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host","status":"publish","type":"post","link":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/","title":{"rendered":"Apache: Enable Multiple Domain SSL On One IP Using SNI through Virtual Host"},"content":{"rendered":"<h2><span lang=\"EN-US\">How to enable Apache Multiple Domain SSL on a single IP address with SNI<\/span><\/h2>\n<p>When you have multiple websites and want to run them on one IP address, you use name-based virtual hosting. Using a name-based host, you can quickly direct a user to the right site. However, this becomes a problem while using SSL\/TLS certificates. That&#8217;s because SSL\/TLS involves a handshake between client and server. HTTP header can only be sent after the handshake. As a result, the server doesn&#8217;t know which website it should serve. That&#8217;s why forces some people to purchase separate IP address<\/p>\n<p><!--more--><\/p>\n<p><strong>Here comes SNI (server name indication).<\/strong><\/p>\n<p>Server Name Indication (SNI) is an extension to the SSL\/TLS protocol.\u00a0The SNI extension allows you to host multiple SSL certificates on a single unique IP address. This is done by inserting HTTP header in the SSL\/TLS handshake. This saves some serious money.<\/p>\n<p>Sounds good? Want to go ahead and enable SNI on Apache using virtual host? Of course, you do. Here\u2019s how to do it.<\/p>\n<h2>Enable SNI on Apache through Virtual Host<\/h2>\n<p><strong>Note: <\/strong>Before you begin, we suggest you take a backup of your .conf file.<\/p>\n<ul>\n<li>To run multiple SSL certificates on one server, you\u2019ll need to create a virtual host. To do so, you\u2019ll need to add the below line to your .conf file.<\/li>\n<\/ul>\n<pre>Include my_other_site.conf<\/pre>\n<ul>\n<li>Once this line is added, go to the NameVirtualHost directive and add your server\u2019s IP address *:443 or whichever SSL port you\u2019re using.<\/li>\n<li>Now you need to direct SSLCertificateFile, SSLCertificateKeyFile, and SSLCertificateChainFile to the locations of the certificate files for every website that you want to secure.<\/li>\n<\/ul>\n<pre>&lt;VirtualHost *:443&gt;\n\u00a0ServerName www.yourdomainname.com\n\u00a0DocumentRoot \/var\/www\/domainname\n\u00a0SSLEngine on\n\u00a0SSLCertificateFile \/path\/to\/www_ yourdomainname _com.crt\n\u00a0SSLCertificateKeyFile \/path\/to\/www_ yourdomainname _com.key\n\u00a0SSLCertificateChainFile \/path\/to\/NameofCA.crt\n&lt;\/VirtualHost&gt;<\/pre>\n<pre>&lt;VirtualHost *:443&gt;\n\u00a0ServerName www.yourdomainname2.com\n\u00a0DocumentRoot \/var\/www\/domainname2\n\u00a0SSLEngine on\n\u00a0SSLCertificateFile \/path\/to\/www_yourdomainname2_com.crt\n\u00a0SSLCertificateKeyFile \/path\/to\/www_ yourdomainname2_com.key\n\u00a0SSLCertificateChainFile \/path\/to\/NameofCA.crt\n&lt;\/VirtualHost&gt;<\/pre>\n<p>If you want to use a <a href=\"https:\/\/www.rapidsslonline.com\/ssl-types\/wildcard-ssl-certificates.aspx\">Wildcard SSL<\/a> or a <a href=\"https:\/\/www.rapidsslonline.com\/ssl-types\/multi-domain-san-certificates.aspx\">Multi-Domain SSL<\/a> certificate, you must point to the same IP address. Here\u2019s how you should do it:<\/p>\n<pre>&lt;VirtualHost 192.168.1.1:443&gt;\n\u00a0ServerName www.yourdomainname.com\n\u00a0DocumentRoot \/var\/www\/\n\u00a0SSLEngine on\n\u00a0SSLCertificateFile \/path\/to\/your_domain_name.crt\n\u00a0SSLCertificateKeyFile \/path\/to\/your_private.key\n\u00a0SSLCertificateChainFile \/path\/to\/NameofCA.crt\n&lt;\/VirtualHost&gt;<\/pre>\n<pre>&lt;VirtualHost 192.168.1.1:443&gt;\n\u00a0ServerName domain2.yourdomainname.com\n\u00a0DocumentRoot \/var\/www\/domain2\n\u00a0SSLEngine on\n\u00a0SSLCertificateFile \/path\/to\/your_domain_name.crt\n\u00a0SSLCertificateKeyFile \/path\/to\/your_private.key\n\u00a0SSLCertificateChainFile \/path\/to\/NameofCA.crt\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Are all done? Well, you have just <strong>enabled SNI on your Apache server using Virtual Host<\/strong>. Open your sites and see SSL having been enabled on all of them.<\/p>\n<h3>One SSL Certificate for Multiple Domains<\/h3>\n<div style=\"margin-bottom: 20px;\">\n<div style=\"float: left; margin-right: 20px;\"><img decoding=\"async\" src=\"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2018\/09\/geotrust-small.png\" alt=\"GeoTrust Logo\" align=\"left\" \/><\/div>\n<div>GeoTrust Offers Multiple Domains SSL Certificate and It allows 250 multiple websites security with single SSL certificate on multiple servers.<\/p>\n<div style=\"text-align: right; float: right;\"><a class=\"more-link\" href=\"https:\/\/www.rapidsslonline.com\/ssl-types\/multi-domain-san-certificates.aspx\">Buy Multi-Domain SAN SSL &#8211; Save 25%<\/a><\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<\/div>\n<h2>Related Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/one-cert-multiple-domains\/\">Secure Multiple Domains with One SSL Certificate<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/rapidssl-vs-comodo-the-ultimate-comparison\/\">RapidSSL vs Comodo \u2014 The Ultimate Comparison<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/wildcard-ev-ssl-certificates-are-they-possible\/\">Wildcard EV SSL Certificates \u2014 Are They Possible?<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/how-to-redirect-http-to-https-on-apache\/\">How to Redirect HTTP to HTTPS on Apache \u2014 The Ultimate Guide<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/tls-vs-ssl-vs-https\/\">TLS vs SSL vs HTTPS<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/what-is-standard-ucc-ssl\/\">What is Standard UCC SSL and How Does It Protect Multiple Domains?<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/what-is-ssl-stripping-attack\/\">What is an SSL Stripping Attack \u2014 Explained by SSL Experts<\/a><\/li>\n<li><a href=\"https:\/\/www.rapidsslonline.com\/ssl\/fix-err-ssl-version-interference-google-chrome\/\">How to Fix \u2018ERR SSL VERSION INTERFERENCE\u2019 in Google Chrome<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How to enable Apache Multiple Domain SSL on a single IP address with SNI When you have multiple websites and want to run them on one IP address, you use &hellip; <span class=\"d-flex justify-content-end\"><a href=\"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/\" class=\"btn btn-blue\">Read More <span class=\"screen-reader-text\">Apache: Enable Multiple Domain SSL On One IP Using SNI through Virtual Host<\/span><\/a><\/span><\/p>\n","protected":false},"author":4,"featured_media":2195,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-2399","post","type-post","status-publish","format-standard","has-post-thumbnail","category-san-certificate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache: Enable Multiple SSL On One IP Using SNI through Virtual Host<\/title>\n<meta name=\"description\" content=\"Step-by-step instructions for using multidomain SAN or UCC SSL certificates on a single IP address by SSL security experts at RapidSSLonline.\" \/>\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.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache: Enable Multiple SSL On One IP Using SNI through Virtual Host\" \/>\n<meta property=\"og:description\" content=\"Step-by-step instructions for using multidomain SAN or UCC SSL certificates on a single IP address by SSL security experts at RapidSSLonline.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/\" \/>\n<meta property=\"og:site_name\" content=\"RapidSSLOnline Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/rsosslcertificates\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-16T09:35:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-05T17:38:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2017\/12\/ssl-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"540\" \/>\n\t<meta property=\"og:image:height\" content=\"360\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"seouser\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rsossl\" \/>\n<meta name=\"twitter:site\" content=\"@rsossl\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"seouser\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache: Enable Multiple SSL On One IP Using SNI through Virtual Host","description":"Step-by-step instructions for using multidomain SAN or UCC SSL certificates on a single IP address by SSL security experts at RapidSSLonline.","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.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/","og_locale":"en_US","og_type":"article","og_title":"Apache: Enable Multiple SSL On One IP Using SNI through Virtual Host","og_description":"Step-by-step instructions for using multidomain SAN or UCC SSL certificates on a single IP address by SSL security experts at RapidSSLonline.","og_url":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/","og_site_name":"RapidSSLOnline Blog","article_publisher":"https:\/\/www.facebook.com\/rsosslcertificates\/","article_published_time":"2018-07-16T09:35:57+00:00","article_modified_time":"2025-06-05T17:38:54+00:00","og_image":[{"width":540,"height":360,"url":"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2017\/12\/ssl-1.jpg","type":"image\/jpeg"}],"author":"seouser","twitter_card":"summary_large_image","twitter_creator":"@rsossl","twitter_site":"@rsossl","twitter_misc":{"Written by":"seouser","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#article","isPartOf":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/"},"author":{"name":"seouser","@id":"https:\/\/www.rapidsslonline.com\/blog\/#\/schema\/person\/e05c458ad703c5807d0c22c0ddf532c5"},"headline":"Apache: Enable Multiple Domain SSL On One IP Using SNI through Virtual Host","datePublished":"2018-07-16T09:35:57+00:00","dateModified":"2025-06-05T17:38:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/"},"wordCount":448,"commentCount":0,"image":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2017\/12\/ssl-1.jpg","articleSection":["SAN certificate"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/","url":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/","name":"Apache: Enable Multiple SSL On One IP Using SNI through Virtual Host","isPartOf":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#primaryimage"},"image":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2017\/12\/ssl-1.jpg","datePublished":"2018-07-16T09:35:57+00:00","dateModified":"2025-06-05T17:38:54+00:00","author":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/#\/schema\/person\/e05c458ad703c5807d0c22c0ddf532c5"},"description":"Step-by-step instructions for using multidomain SAN or UCC SSL certificates on a single IP address by SSL security experts at RapidSSLonline.","breadcrumb":{"@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#primaryimage","url":"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2017\/12\/ssl-1.jpg","contentUrl":"https:\/\/www.rapidsslonline.com\/blog\/wp-content\/uploads\/2017\/12\/ssl-1.jpg","width":540,"height":360,"caption":"Enable Multiple SSL On One IP Using SNI through Virtual Host"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rapidsslonline.com\/blog\/apache-enable-multiple-ssl-on-one-ip-using-sni-through-virtual-host\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rapidsslonline.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apache: Enable Multiple Domain SSL On One IP Using SNI through Virtual Host"}]},{"@type":"WebSite","@id":"https:\/\/www.rapidsslonline.com\/blog\/#website","url":"https:\/\/www.rapidsslonline.com\/blog\/","name":"RapidSSLOnline Blog","description":"SSL Best Practices for Secure Website","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rapidsslonline.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.rapidsslonline.com\/blog\/#\/schema\/person\/e05c458ad703c5807d0c22c0ddf532c5","name":"seouser","url":"https:\/\/www.rapidsslonline.com\/blog\/author\/seouser\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/posts\/2399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/comments?post=2399"}],"version-history":[{"count":0,"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/posts\/2399\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/media\/2195"}],"wp:attachment":[{"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/media?parent=2399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/categories?post=2399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rapidsslonline.com\/blog\/wp-json\/wp\/v2\/tags?post=2399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}