I currently have a desktop at home set up as a web server among other functions. It is running Ubuntu 12.04 and Apache 2.2.22. I have various virtual servers set up for different sites. Some of the virtual servers are for local use while others need to be accessed externally. However, right now they can all be accessed externally.
For example, I have a set of Phillips Hue lights in my house. One of the sites controls these lights. I also have sites that control other projects around the house. I want these sites to only be accessed on the LAN. Conversely, I also have instances of Gitlab and other sites I want to be able to access externally.
So, my question is: What do I have to do to isolate internal sites from the external ones? Like a local intranet for my home.
Is this handled in Apache, my domain name service, my home router? Do I need to set up a local DNS server? I would like to be able to just use a different sub-domain or directory to get to the local sites. For example, local.example.com would only be accessed on the LAN, while www.example.com would be accessed anywhere. www.example.com/local/ would also be acceptable for the local sites.