3
votes

Two weeks ago, i started up an AWS EC2 instance with Windows Server 2012 on it. I then installed the latest version of wamp (I have to use apache because i'm doing wildcard domains, and IIS doesn't support them). I migrated my sites (files, database records, and DNS entries) over to the new server from the old one.

WAMP runs the sites correctly for anywhere between 5 to 10 minutes and then takes about 30 seconds to load a page.

After doing some search, I found that it's because Windows Server 2012 is set to use IPv6 by default while apache is set to use IPv4. The website I've visited have given me several things to do to fix this issue - which includes:

1) commenting out ::1 from the hosts file 2) Disabling IIS (which is on by default in Windows Server 2012 3) Changing my apache.conf file to "Listen 0.0.0.0:80" instead of "Listen 80" 4) Changing my apache.conf file to "ServerName localhost" instead of "ServerName 127.0.0.1"

I can restart all the wamp services and the pages will start to load immediately again, but then after another 5 to 10 minutes, the same issue occurs where the pages take forever to load.

I've made all of these changes mentioned above, but the problem still persists. Other than starting up a new server that's not running Windows Server 2012, I'm out of ideas.

Has anybody run into this issue before and know of a fix?

1

1 Answers

3
votes

I believe this is a bit of a bug in Apache running on windows. Its to do with releasing connection, or rather not doing so

Adding these to the httpd.conf has been know to help

AcceptFilter http none AcceptFilter https none EnableSendfile off EnableMMAP off

This directive enables operating system specific optimizations for a listening socket by the Protocol type. On Windows, none uses accept() rather than AcceptEx() and will not recycle sockets between connections. This is useful for network adapters with broken driver support, as well as some virtual network providers such as vpn drivers, or spam, virus or spyware filters.

Backup your httpd.conf before making changes. Check for these parameters already existing somewherein httpd.conf before just plonking these in httpd.conf! !!!!!