Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@allella
Last active February 14, 2016 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allella/b2de20d3df17a867f3c3 to your computer and use it in GitHub Desktop.
Save allella/b2de20d3df17a867f3c3 to your computer and use it in GitHub Desktop.
Updating Apache to Named Virtual Hosts For Multiple SSL Certificates on the Same 1 IP Address
# BE VERY CAREFUL IF YOU CHANGE YOUR Apache CONFIGURATION
# Backup your configuration before changing and run an error check before applying changes
# If you have 1 IP address for each SSL certificate then you probably don't need to do any of this
# If you have more than 1 site per IP address then this worked for me.
# It requires Apache with with SNI, which should already be part of Apache since it's been around for many years
# For more info see https://www.digicert.com/ssl-support/apache-multiple-ssl-certificates-using-sni.htm
# I changed to named Virtual Hosts https://httpd.apache.org/docs/2.2/en/vhosts/name-based.html , like this
vi /etc/httpd/conf/httpd.conf
# then change the port 443 NameVirtualHost to
NameVirtualHost *:443
# and for all https (port 443) virtual hosts sharing the same IP address change the opening tag
# of the part 443 vhost to the following
<VirtualHost *:443>
# Run an error check, which is usually like
/usr/sbin/apachectl configtest
# then restart Apache (for CentOS 6)
/etc/init.d/httpd reload
# CentOS 7 restart
systemctl reload httpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment