0

I have this weird problem with apache. First, a little bit of background:

I'm using XAMPP - but i tested wamp and vanilla apache, various versions - to do local (php) development on a Win7 Pro x64 machine. I also have a public IP, which is accessible from the outside. This works just great, speedy and peachy.

However, if I'm trying to access the apache from another PC/iPhone/whatever in the network, it takes a lot. a lot! to connect. However, after the connection is made, files are downloaded pretty fast (8mb/sec).

Also, i noticed that Vagrant is very slow (is what made me to think on this as an issue; first i was thinking that is only my apache configuration)

So, long story short:

  • user from outside the network can access my PC with no problem
  • local users must wait ~10-20 seconds for a simple page load (php, html, doesn't matter)
  • xampp installed on another pc on network works ok
  • lan sharing works just fine
  • firewall is off, antivirus (avast free) was off for tests

I'm on win 7 pro, updated.

Things to consider:

  • apache run on port 80 or 81 or 8081 or whatever, same result every time
  • changing OS (e.g.: use mac) it's not an option :)

So, what the hell should i look for? Any ideas?

Thanks!

Ionut Staicu
  • 101
  • 1
  • 3
  • How are you trying to access apache? By IP or hostname? http or https? Network works fine (ping, traceroute, ...)? – Jure1873 Oct 04 '12 at 21:23
  • @Jure1873: I'm trying to access it by IP, http. Everything else that is network related works just fine, the look up takes forever. – Ionut Staicu Oct 05 '12 at 03:43
  • Long initial time-outs usually indicate an issue with name-resolution, so you should check your DNS configuration - make sure it's resolving properly, and that the IP it's resolving to is the right one. – HopelessN00b Oct 08 '12 at 00:46

1 Answers1

0

most likely have something to do with DNS

* UPDATE *

run ipconfig /all look up at your DNS server, and try to resolve hosts that is hitting your apache, run it against every DNS server that you see in the list, at least one of them will take long to look up record and that's the one which is causing slowness

alexus
  • 12,342
  • 27
  • 115
  • 173
  • thanks. can you give me more details? I really have no idea what to look for... – Ionut Staicu Oct 04 '12 at 18:16
  • It's likely that Apache is attempting reverse DNS lookups on your LAN when the request happens. If this is the case, the lookup has to complete, or timeout (in your case), before the HTTP GET is processed and response sent. Check out the `HostnameLookups` configuration directive in `httpd.conf`. – Sean C. Oct 04 '12 at 18:28
  • Sean, `HostnameLookups` was `off`. Switched to `On` with no luck. – Ionut Staicu Oct 04 '12 at 18:36
  • HostnameLookups is off by default and it should be kept that way – alexus Oct 04 '12 at 19:27
  • Alexus, thanks for the updated. Here is what i have on the main LAN card: https://gist.github.com/2fd4eb5be640c4e08def I realized that things are slow even if I'm trying to connect from a virtual machine. – Ionut Staicu Oct 05 '12 at 03:47
  • ok, your 192.168.1.1 in that environment isn't doing resolving (or at least not doing it correctly), try changing it to OpenDNS nameservers – alexus Oct 05 '12 at 14:07