I’m setting up devilbox on a VPS, so that my team can have a development server for our LAMP apps.
Now, I understand that creating virtual hosts accesible from your own local machine is easy: you just create subdirectories in your HOST_PATH_HTTPD_DATADIR, and they will be automatically available at your-subdirectory-name.TLD_SUFFIX (as long as you add that name in your local machine’s hosts file). But how do I make the virtual hosts available across the Internet?
I understand that first I’d have to add a DNS entry at, for example, “my website.mydomain.com” pointing at the VPS. But how do I configure the virtual host inside devilbox so that it responds to that DNS name? And what happens with devilbox’s own BIND server? Will it start answering queries for “my domain.com”, when it’s not listed as an authoritative DNS server for my domain? Will that cause any problems?
So I added a wildcard entry in my DNS server, and then I just configured the devilbox’s TLD_SUFFIX to respond to it. Then it was just a matter of adding virtualhosts, and they were all recognised automatically.
Yes you can, but then you can add an unlimited number of virtual hosts (I didn’t know you could add wildcard DNS suffixes, which is the trick that makes all of this possible).
What I did was to add a wildcard entry:
*.testservers.mydomain
And then use that as my TLD_SUFFIX:
TLD_SUFFIX=testservers.mydomain
And then it’s just a matter of adding virtual hosts in devilbox:
Do you mean how to point a “real” domain like “test1.com” to devilbox, instead of just a subdomain? Erm… I didn’t do it, since I didn’t need it. I’m not setting this for production. I’m just setting up test servers for my team to work together (this is why I need a VPS instead of a Docker stack running on my own computer). I haven’t researched how would it work with a top-level domain.