0

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.

1

[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.

  • 1
    Thanks for the explanation, Listen 192.168.1.66:80 worked. Ha, I had a feeling VirtualBox/Vagrant had something to do with this. – xIcarus Sep 8 '17 at 15:56
  • Also no, I wasn't running the app in a VM. I had used the VM prior for other apps. – xIcarus Sep 8 '17 at 16:28
  • Your welcome. Glad you got everything working correctly. =) – Anaksunaman Sep 9 '17 at 1:06
0

As you said, http://localhost/app is recognised in the intranet. The problem is related to the IPv4 on which the app is currently running, so try to verify that. I do not know which app you are using, but there should be a config.php file in which you can set the trusted domain that can be accessed.

Furthermore I doubt that such a common IPv4 (192.168.1.66) could be accessed from everywhere: I do not know your whole network configuration, but should have a dynamic IP assigned globally and the address quoted is only local.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.