I set up an Apache HTTP server on my Macbook, just so I could have access to the full functionality of PHP while I learn the language. I don't have a registered domain name or consistent network access, so the idea of hosting an actual website on this server is not feasible; I'm just doing this for learning purposes.
Anyway, I was wondering something. I noticed that when I enter my private IP address into a web browser (not the loopback address but the actual DHCP-assigned address), I can access web pages hosted by my server, which I think means I can access it from outside my computer. However, when I enter my public IP address, I get a network timeout, which I would guess means I can't access my web server from outside the local network (unless the connection is just really slow).
I am wondering why this is. Is there a layer of security set up that prevents people from accessing computers inside a LAN from outside?