How to make virtual hosts accesible from the Internet?


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” 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”, when it’s not listed as an authoritative DNS server for my domain? Will that cause any problems?

See here:

Thanks for responding. In the end, it was much easier than I thought; I read the instructions here:

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.

That what’s I thought at first, but didn’t answer because you can specify only one TLD_SUFFIX, which is somewhat limiting.

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:


And then use that as my TLD_SUFFIX:


And then it’s just a matter of adding virtual hosts in devilbox:



But in example, how does the link to your www.test1.testserver.mydomain and the to www.test2.testserver.mydomain ?

Do you mean how to point a “real” domain like “” 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.

oh! ok then :sweat_smile: