{"id":1998,"date":"2025-03-26T09:00:10","date_gmt":"2025-03-26T09:00:10","guid":{"rendered":"https:\/\/cheapsslsecurity.com\/p\/?p=1998"},"modified":"2025-03-26T09:17:19","modified_gmt":"2025-03-26T09:17:19","slug":"sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address","status":"publish","type":"post","link":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/","title":{"rendered":"SNI on Apache: How to Host Multiple SSL Certificates  on a Single IP Address"},"content":{"rendered":"<h2>When working with web servers, it is often necessary to serve several sites protected by SSL certificates on one server.<\/h2>\n<p>Previously, this required a dedicated IP address for each domain, but since the invention of the Server Name Indication (SNI) technology, it has become possible to manage several certificates on a single IP address.<\/p>\n<p><!--more--><\/p>\n<h2>What is SNI and why is it needed?<\/h2>\n<p>SNI (Server Name Indication) is an extension of the TLS protocol that allows the server to determine for which domain the client is requesting a connection before establishing a secure channel. This allows the server to select the correct SSL certificate, even if different sites are hosted on the same IP.<\/p>\n<h2>Configuring SNI in Apache<\/h2>\n<p>To implement support for multiple SSL certificates on a single IP address on  Apache, do the following:<\/p>\n<h3>1. Check SNI support<\/h3>\n<p>SNI is supported on Apache starting from version 2.2.12. It is also important that OpenSSL is version 0.9.8j or higher. You can find out the current Apache version with one of the following commands:<\/p>\n<div class=\"code-with-bg\">\n<p>apache2 -v<br \/>\napachectl -v<br \/>\nhttpd -v<\/p>\n<\/div>\n<p>You can check the OpenSSL version with the command:<\/p>\n<div class=\"code-with-bg\">\n<span>openssl version<\/span><\/div>\n<h3>2. Set up virtual hosts with SSL<\/h3>\n<p>Each site on the server should be configured as a separate virtual host. In the Apache configuration file (\/etc\/apache2\/sites-available\/), create or edit configuration files for the domains. For example:<\/p>\n<div class=\"code-with-bg\">\n<div>\n&lt;VirtualHost *:443><br \/>\n    ServerName site1.com<br \/>\n    DocumentRoot \/var\/www\/site1<br \/>\n    SSLEngine on<br \/>\n    SSLCertificateFile \/etc\/ssl\/certs\/site1.crt<br \/>\n    SSLCertificateKeyFile \/etc\/ssl\/private\/site1.key<br \/>\n&lt;\/VirtualHost>\n<\/div>\n<\/div>\n<div class=\"code-with-bg\">\n<div>\n&lt;VirtualHost *:443><br \/>\n    ServerName site2.com<br \/>\n    DocumentRoot \/var\/www\/site2<br \/>\n    SSLEngine on<br \/>\n    SSLCertificateFile \/etc\/ssl\/certs\/site2.crt<br \/>\n    SSLCertificateKeyFile \/etc\/ssl\/private\/site2.key<br \/>\n&lt;\/VirtualHost>\n<\/div>\n<\/div>\n<p>For Apache servers: Confirm that the SSL module is enabled and that your virtual host configuration includes the necessary directives for SSL before &lt;VirtualHost>.<\/p>\n<h3>3. Enable SSL and SNI support in Apache<\/h3>\n<p>Before restarting the server, make sure that the necessary SSL modules are enabled in your Apache configuration.<\/p>\n<p>Then apply the changes:<\/p>\n<div class=\"code-with-bg\"><span>sudo systemctl restart apache2<\/span><\/div>\n<h3>4. Check everything is working<\/h3>\n<p>To verify that the server is handling requests with SNI correctly, use the command:<\/p>\n<div class=\"code-with-bg\"><span>openssl s_client -connect gogetssl.com:443 | openssl x509 -noout -text | grep DNS:<\/span><\/div>\n<p>This command will return DNS records with a more concise output, making it easier to identify relevant domain information.<\/p>\n<h2>Browser support and limitations.<\/h2>\n<p>SNI is supported by most modern browsers, including Google Chrome, Firefox, Safari, and Edge. However, some older versions of Internet Explorer (such as Windows XP) do not support this technology, so users of such systems may encounter errors when visiting the site.<\/p>\n<h3>Conclusion<\/h3>\n<p>SNI is a convenient way to use multiple SSL certificates on a single server without allocating a separate IP address for each site. This reduces costs and simplifies server administration while remaining a reliable and widely supported solution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with web servers, it is often necessary to serve several sites protected by SSL certificates on one server. Previously, this required a dedicated IP address for each domain, but since the invention of the Server Name Indication (SNI) &hellip; <a href=\"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,4,14,1],"tags":[],"class_list":["post-1998","post","type-post","status-publish","format-standard","hentry","category-ssl-advanced","category-ssl-basics","category-ssl-error-codes","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address - Cheap SSL Security<\/title>\n<meta name=\"description\" content=\"SNI (Server Name Indication) is an extension of the TLS protocol that facilitates the server&#039;s ability to identify the specific domain for which the client is seeking to establish a connection, prior to the creation of a secure channel.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address - Cheap SSL Security\" \/>\n<meta property=\"og:description\" content=\"SNI (Server Name Indication) is an extension of the TLS protocol that facilitates the server&#039;s ability to identify the specific domain for which the client is seeking to establish a connection, prior to the creation of a secure channel.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/\" \/>\n<meta property=\"og:site_name\" content=\"Cheap SSL Security\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CheapSSLSecurities\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-26T09:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-26T09:17:19+00:00\" \/>\n<meta name=\"author\" content=\"Vladislavs Dovoreckis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sslsecurity\" \/>\n<meta name=\"twitter:site\" content=\"@sslsecurity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vladislavs Dovoreckis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/\"},\"author\":{\"name\":\"Vladislavs Dovoreckis\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/3c82a53e4a962f90f3f1be2948c39eeb\"},\"headline\":\"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address\",\"datePublished\":\"2025-03-26T09:00:10+00:00\",\"dateModified\":\"2025-03-26T09:17:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/\"},\"wordCount\":479,\"articleSection\":[\"SSL Advanced\",\"SSL Basics\",\"SSL Errors\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/\",\"name\":\"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address - Cheap SSL Security\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#website\"},\"datePublished\":\"2025-03-26T09:00:10+00:00\",\"dateModified\":\"2025-03-26T09:17:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/3c82a53e4a962f90f3f1be2948c39eeb\"},\"description\":\"SNI (Server Name Indication) is an extension of the TLS protocol that facilitates the server's ability to identify the specific domain for which the client is seeking to establish a connection, prior to the creation of a secure channel.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SSL Help\",\"item\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSL Errors\",\"item\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/ssl-error-codes\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#website\",\"url\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/\",\"name\":\"Cheap SSL Security\",\"description\":\"Shop for SSL Certificates at Cheap Prices\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cheapsslsecurity.com\\\/p\\\/#\\\/schema\\\/person\\\/3c82a53e4a962f90f3f1be2948c39eeb\",\"name\":\"Vladislavs Dovoreckis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/678b0f8742583ba7eb96e5c4a0db9417f91f18ad9732a624504fed3fb4f2ac24?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/678b0f8742583ba7eb96e5c4a0db9417f91f18ad9732a624504fed3fb4f2ac24?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/678b0f8742583ba7eb96e5c4a0db9417f91f18ad9732a624504fed3fb4f2ac24?s=96&d=mm&r=g\",\"caption\":\"Vladislavs Dovoreckis\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address - Cheap SSL Security","description":"SNI (Server Name Indication) is an extension of the TLS protocol that facilitates the server's ability to identify the specific domain for which the client is seeking to establish a connection, prior to the creation of a secure channel.","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:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/","og_locale":"en_US","og_type":"article","og_title":"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address - Cheap SSL Security","og_description":"SNI (Server Name Indication) is an extension of the TLS protocol that facilitates the server's ability to identify the specific domain for which the client is seeking to establish a connection, prior to the creation of a secure channel.","og_url":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/","og_site_name":"Cheap SSL Security","article_publisher":"https:\/\/www.facebook.com\/CheapSSLSecurities","article_published_time":"2025-03-26T09:00:10+00:00","article_modified_time":"2025-03-26T09:17:19+00:00","author":"Vladislavs Dovoreckis","twitter_card":"summary_large_image","twitter_creator":"@sslsecurity","twitter_site":"@sslsecurity","twitter_misc":{"Written by":"Vladislavs Dovoreckis","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/#article","isPartOf":{"@id":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/"},"author":{"name":"Vladislavs Dovoreckis","@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/3c82a53e4a962f90f3f1be2948c39eeb"},"headline":"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address","datePublished":"2025-03-26T09:00:10+00:00","dateModified":"2025-03-26T09:17:19+00:00","mainEntityOfPage":{"@id":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/"},"wordCount":479,"articleSection":["SSL Advanced","SSL Basics","SSL Errors"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/","url":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/","name":"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address - Cheap SSL Security","isPartOf":{"@id":"https:\/\/cheapsslsecurity.com\/p\/#website"},"datePublished":"2025-03-26T09:00:10+00:00","dateModified":"2025-03-26T09:17:19+00:00","author":{"@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/3c82a53e4a962f90f3f1be2948c39eeb"},"description":"SNI (Server Name Indication) is an extension of the TLS protocol that facilitates the server's ability to identify the specific domain for which the client is seeking to establish a connection, prior to the creation of a secure channel.","breadcrumb":{"@id":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cheapsslsecurity.com\/p\/sni-on-apache-how-to-host-multiple-ssl-certificates-on-a-single-ip-address\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SSL Help","item":"https:\/\/cheapsslsecurity.com\/p\/"},{"@type":"ListItem","position":2,"name":"SSL Errors","item":"https:\/\/cheapsslsecurity.com\/p\/ssl-error-codes\/"},{"@type":"ListItem","position":3,"name":"SNI on Apache: How to Host Multiple SSL Certificates on a Single IP Address"}]},{"@type":"WebSite","@id":"https:\/\/cheapsslsecurity.com\/p\/#website","url":"https:\/\/cheapsslsecurity.com\/p\/","name":"Cheap SSL Security","description":"Shop for SSL Certificates at Cheap Prices","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cheapsslsecurity.com\/p\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cheapsslsecurity.com\/p\/#\/schema\/person\/3c82a53e4a962f90f3f1be2948c39eeb","name":"Vladislavs Dovoreckis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/678b0f8742583ba7eb96e5c4a0db9417f91f18ad9732a624504fed3fb4f2ac24?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/678b0f8742583ba7eb96e5c4a0db9417f91f18ad9732a624504fed3fb4f2ac24?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/678b0f8742583ba7eb96e5c4a0db9417f91f18ad9732a624504fed3fb4f2ac24?s=96&d=mm&r=g","caption":"Vladislavs Dovoreckis"}}]}},"_links":{"self":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts\/1998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/comments?post=1998"}],"version-history":[{"count":0,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/posts\/1998\/revisions"}],"wp:attachment":[{"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/media?parent=1998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/categories?post=1998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapsslsecurity.com\/p\/wp-json\/wp\/v2\/tags?post=1998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}