'Add NameVirtualHost Directives if necessary for new vhost.
NameVirtualHosts was a directive in Apache < 2.4
https://httpd.apache.org/docs/2.2/mod/core.html#namevirtualhost
:param vhost: New virtual host that was recently created.
:type vhost: :class:`~certbot_apache.obj.VirtualHost`'

def _add_name_vhost_if_necessary(self, vhost):

    need_to_save = False
    for addr in vhost.addrs:
        addrs = set((addr,))
        if (addr.get_addr() in ('*', '_default_')):
            addrs.update((obj.Addr((a, addr.get_port())) for a in ('*', '_default_')))
        for test_vh in self.vhosts:
            if ((vhost.filep != test_vh.filep) and any(((test_addr in addrs) for test_addr in test_vh.addrs)) and (not self.is_name_vhost(addr))):
                self.add_name_vhost(addr)
                logger.info('Enabling    NameVirtualHosts    on    %s', addr)
                need_to_save = True
                break
    if need_to_save:
        self.save()
