Cannot browse to dev vhost by hostname, IP
I've got me a new macbook pro last month and i decided to set up my MySQL / Apache / PHP stack manually. I followed several online guides and solved some problems, eventually i got it to work and even managed to set up vhosts (dev.local) and phpmyadmin.
Now i got an issue i don't even know how to approach - i'm trying to browse to dev.local (the server set on my macbook) from my older PC or from my Android device and i can't...
- when i try to browse to dev.local i get "error: not found"
- when i try to browse to the mac lan ip address at 192.168.1.x i do get served but from the wrong place - i'm getting the document from /Library/Webserver/Documents/ instead of the folder i'm wanting to get (/Users/Username/Sites/)
i'm guessing it's something to do with the apache or vhost configuration
To access your local apache server through another computer on your network you'll need to either setup a DNS server or add the domain name and ip to the hosts file of the client accessing your server.
The document you are being served is the default docroot in apache, since the server can't decide what vhost to load due to the lack of a domain name (you surfed to the ip directly) you'll get served the default docroot and not the ones in your vhosts. Check the apache configuration, the /Library/Webserver/Documents path should be in there somewhere (not in the vhosts config)
Hope this helps