Hi
I have created a subdomain underneath my main domain. It went through all the steps without any issue.
However when I then attempt to navigate to the site, there are two issues
The site is still being seen as http instead of https, despite it showing that it has a certificate issued by Lets Encrypt
its not serving the content in the public_html folder
This is not the first time I have had these issues, however I have had to leave it until now. However now it has become a critical issue whereby we are ready to deploy our websites, but its impossible.
The redirect to SSL is a selectable option in Virtualmin > Website Options.
It can also be done in .htaccess if necessary for some oddball reason:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I can’t think of any reason why that should be necessary except maybe if the site was migrated from cPanel. They do some weird shit in .htaccess that should be carefully removed once the site is no longer on that panel.
As for public_html content not being served, what’s the exact absolute path? You may have the files in the wrong directory. That happened to me a few times right after I came over from the dark side.
Hi.
OK so I have just set the option to redirect to ssl, and it STILL takes me to a default page which is not SSL.
The site is a simple wiki placed in the sub server’s folder , ie : /home/three2o/domains.wiki.32yo.com/public_html
I set the options to use SSL as above, and also tried with a .htaccess file. Nothing changes
I have just made a change in the html of the default page stored in the above site… and it doesnt go there at all. it still shows the main website default one. (I tested this by making a change in the html of the main website)
I have just also made sure that each of the websites (32yo.com, test.32yo.com and wiki.32yo.com all have the redirect to SSL on, and now when I navigate to the sites, It tries to go to the HTTPS, but then cant find it, so reverts to http… even though there is a certificate and it should be using it.
I have no idea whats wrong.
This is about hundreth time I have tried to get this to work. I have even created new servers, thinking I did something wrong, and always have the same issue.
is also using the wrong certificate, both in fact are using the certificate for 32yo.com easiest answer is to request certs through the sub servers (test.32yo.com & wiki.32yo.com) ssl certificate management pages virtualmin server name server configuration ssl certificate lets encrypt and request a certificate for each, so a real world example is
virtualmin wiki.32yo.com server configuration ssl certificate lets encrypt
This assumes you have create the sub servers using the virtualmin module, if you have created the sub domains a different way (created the virtual server outside of virtualmin) this will not work & you will have to manually request & install the certificates
The page should look like this
The error logs and access logs are empty for test.32yo.com and dont even exist in wiki.32yo.com
I would expect that simply creating a sub server from virtualmin would set it up without any issues. I created them using the default settings , so it should just work out of the box, no?
This seems like a variation of “the wrong site shows up” from our troubleshooting guide, though I’m not sure how it would have happened.
It sounds like the first site configured in Apache is 32yo.com, and for whatever reason the other domains aren’t matching any configured VirtualHost, so it falls back to the first one. Apache has bizarre and incomprehensible heuristics for deciding what to serve in the event of no exact match.
If I had to guess, I would say you have IPv6 enabled in Apache, but it is misconfigured or these VirtualHosts do not have IPv6 config. (but, it could be SSL misconfigured, or other IP-related or port-related tomfoolery).
So it seems that the subservers are using *.80 and *.443.
However what IP address should they have? its all on the same server, so surely it. should be the same IP?
thanks
Yep, that’s the problem. It must be either all using the IP or all using *. Otherwise, the IP will “win” the matching. Apache behavior is insane on this.
I’m not sure how you got this mixed config, though. Virtualmin has a configuration for this, in Virtualmin Configuration->Defaults for new domains->Address format for Apache virtual hosts
You’ll need to fix it manually in the existing sites, I think, once you decide which one you’ll be using (use * if the IP changes regularly, or the IP if you’ll ever have other IPs or if the IP remains the same over time).