So i have site1.com and site2.com with my registrar(cloudflare) and the DNS entries have all the admin, webmail, @ and www pointing to my system’s IP…
Well I only have a virtual server running for site1.com, but when you go to site2.com, it takes you to site1.com…how can i avoid this. If i ever intend to have someone else’s site on my server, i dont want people getting routed to the wrong site.
I have site1.com listed 4 times from the grep -i 'virtualhost' /etc/apache2/sites-enabled/*.conf (2 ipv4 entiers and 2 ipv6 entires for 80 and 443)
Network interface for virtual address set to eth0
Network interface for virtual address set as “From Network Interface”
Default IP address for DNS record - not behind a NAT router…i am on AWS lightsail
Note: site2.com is not a created virtual server on the host, just my DNS records are pointing to the public IP. Shouldn’t that return the default virtualmin server i have set up?
If you only have one public IP, but I think you’re saying you have a bunch of internal IPs configured in your Apache config. That can’t possibly work.
The private IP should be what is in the Apache configuration. But, if you only have one public IP, you obviously can only have one private IP, with anything resembling a simple Apache configuration (there are convoluted ways to make multiple IPs work with a single public IP, but it doesn’t make sense to do that).
So i elected to skip the setup of a default server to begin with…so I made site.com, then came back in and made virtualmin.site1.com as the default server.
From this, you have two virtual servers in Virtualmin:
site1
virtualmin.site1
And you have made virtualmin.site1 the default virtual server. Yet, site1 appears to be functioning as the default virtual server, i.e. site1 shows when you visit site2.
The only way that can happen is if site1 is indeed the default virtual server. Could you check if this is the case and also post a screenshot of Virtualmin → Server Configuration → Website Options for virtualmin.site1