My virtualmin setup is behind a natted connection. I've got a 1:1 nat configured from the WAN ip assigned to the server to the LAN ip that is configured on the ethernet adapter on the server.
I have Virtualmin configured to use the wan ip in all dns records. This seems to be working fine. My problem occured when I started using SSL with LetEncrypt. Virtualmin creates a new apache vhost but then uses the wan ip to create the vhost. This breaks apache and doesn't allow it to bind to the right ip address on port 443 for the ssl host.
Is there a way that I can automate the creation of SSL websites so that I don't have to go in and manually edit the vhost to use the LAN ip? Or can I tell it to use the following type of config by default as this seems to work - using * in the virtualhost parameter.
SuexecUserGroup "#1001" "#1001" ServerName domain.tld
Comments
Submitted by oranjbox on Fri, 02/03/2017 - 21:32 Pro Licensee Comment #1
Submitted by oranjbox on Fri, 02/03/2017 - 23:17 Pro Licensee Comment #2
I'm pretty sure I've got this sorted out.
Submitted by andreychek on Fri, 02/03/2017 - 23:27 Comment #3
Howdy -- that's great!
I'll offer that if you haven't already, you may want to take a peek at System Settings -> Virtualmin Config -> Network Settings, and make sure that "Default virtual server IPv4 address" is set to the network interface, and "Default IP address for DNS records" is set to "Automatically detected external address".
Those two options should help when behind NAT.
Submitted by oranjbox on Sat, 02/04/2017 - 13:56 Pro Licensee Comment #4
Thanks! That's the route I took. I happened to find the answer in the forums after creating the ticket. It just took a bit more digging.
Submitted by andreychek on Sat, 02/04/2017 - 17:37 Comment #5
That's great then, glad to hear it's working for you.
Feel free to let us know if you have any additional questions!