I have a virtual server hosted at ISP with 2 public IPv4 addresses. I want to run several subdomains (more than 2) with Apache and serve them via both HTTP and HTTPS. The SSL cert is a wildcard one for *.mydomain.com.
I tried to configure Apache in Debian this way but failed. Either my virtualhosts are not accepted or I get SSL errors. (I know that Apache doesn't see hostname requested before serving the cert but the cert includes all subdomains possible)
Please help to create an httpd.conf that works best with Debian's Apache config layout.
All the details:
- Apache listening on *:80 for HTTP and *:443 for HTTPS
- All NameVirtualHosts, aliases etc. shall be defined for both ports/protocols at once
- default mydomain.com and www.mydomain.com should root to /var/www
- additional NameVirtualHosts for foo.mydomain.com and bar.mydomain.com etc. which can be configured specially, e.g. to have another DocumentRoot