In the old days, when everything was in http.conf and Apache was young, it looked like:
Code: Select all
NameVirtualHost 1.2.3.4
<VirtualHost 1.2.3.4>
ServerName www.domain.tld
---other stuff---
</VirtualHost>
<VirtualHost 1.2.3.4>
ServerName www.seconddomain.tld
---other stuff---
</VirtualHost>
Code: Select all
http.conf unremmed:
NameVirtualHost *:80
www.domain.tld.conf:
<VirtualHost *:80>
ServerName www.domain.tld
---other stuff---
</VirtualHost>
www.seconddomain.tld.conf:
<VirtualHost *:80>
ServerName www.seconddomain.tld
---other stuff---
</VirtualHost>
Code: Select all
<VirtualHost 1.2.3.4:80>
--and--
<VirtualHost *:80>
To finally fix this, I had to move the NameVirtHost directive in http.conf to ABOVE the "Include conf.d/*.conf" line (in the default file, it is well below), and cause each of the domains to look like:
Code: Select all
www.domain.tld.conf:
<VirtualHost www.domain.tld:80>
ServerName www.domain.tld
---other stuff---
</VirtualHost>
www.seconddomain.tld.conf:
<VirtualHost www.seconddomain.tld:80>
ServerName www.seconddomain.tld
---other stuff---
</VirtualHost>
So...is this how things should look? Is this a valid configuration for name-based hosts? Will it all blow up when I try running certbot to get SSL certificates?
Edit: Turn off AutoParse URIs. Oops.