apache (xampp) not accessible from intranet
Okay, so I have a web app that I want to test on a bunch of different devices. In order to do this easily I need to expose the application to the extranet so I can access it from anywhere.
My machine's intranet IP is 192.168.1.66, it's assigned manually by me from the router.
A DMZ is set up, so 192.168.1.66 should be completely exposed to the extranet.
However Apache doesn't even respond from the intranet.
Accessing http://localhost/app shows me the XAMPP installation, but http://192.168.1.66/app does not.
The environment is a completely standard XAMPP installation under Windows. I haven't changed a thing, I've only added the web app to the docroot.
Httpd.conf has the default 'Listen 80' so this should not be an issue.
I've tried disabling my Windows firewall completely without any success.
I also have no idea if this is normal, but 'netstat -a' shows me multiple entries for port 80 as such:
TCP [::]:80 DESKTOP-DVN0SQB:0 LISTENING
TCP 192.168.1.66:80 DESKTOP-DVN0SQB:0 LISTENING
TCP 0.0.0.0:80 DESKTOP-DVN0SQB:0 LISTENING
Netstat also shows me an IP address which I do not recognize, 192.168.56.1. What baffles me is that I tried accessing it and weirdly enough, my app can be found on http://192.168.56.1/app. But this seems to be a local address because I cannot access it from any device on the intranet.
What gives? What is this 192.168.56.1 address? I remember seeing a similar address when I was playing with Vagrant a few days ago, could it be related? I no longer have any Vagrant VMs, I've destroyed all of them (in case it could be related).
And most importantly: why can't I access Apache from the intranet? Because it's definitely preventing me from accessing it from the extranet.
[W]hy can't I access Apache from the intranet?
Because Apache is apparently bound to a network adapter that is not part of the intranet you are trying to access.
To be clear, 192.168.1.x
and 192.168.56.x
are separate networks in this case (assuming a standard class C subnet mask of 255.255.255.0
).
The address Apache is using (192.168.56.1
) is most likely a default IP for a virtual network adapter, used for virtual machines. Apache seems to have selected this adapter/IP in response to a generic Listen 80
directive (as you mentioned).
I remember seeing a similar address when I was playing with Vagrant a few days ago, could it be related?
This could be related. If Vagrant installed any virtual network adapters, unless you specifically removed those adapters, they are most likely are still active on your system.
If you are definitely not using that virtual network adapter, you may wish to remove it entirely.
In any case, you can bind Apache (as necessary) to a specified IP in httpd.conf
with a more specific Listen
directive e.g.
Listen 192.168.1.66:80
Please note, since you made comments about Vagrant, I am assuming your server/app isn't running in a VM. If it is (perhaps say you are running VirtualBox instead), you'd need to adjust settings for the VM to make it accessible to the intranet.