A couple days ago, I documented my recent experience with my wireless network and how I got hacked. I briefly mentioned that I'm installing Windows 7 this time around.
Yesterday, I ran into an issue with 32-bit Apache 2.2.15 running on Windows 7 Ultimate 64-bit. This issue appears to only affect 64-bit Windows 7 and 64-bit Windows Vista web developers attempting to run 32-bit Apache on the system.
NOTE: I didn't test 64-bit Apache because that is experimental and 64-bit PHP is even more experimental. However, I doubt the results would be too different.
The issue is slow response times (anywhere from 1 to 3 seconds per request) when connecting to 'http://localhost/'. Connecting to 'http://127.0.0.1/' and 'http://[NetBIOScomputernamegoeshere]/' have fast response times. I've seen various fixes around that seem to boil down to these three:
- Disable the Windows Firewall.
- Disable IPv6 support.
- Edit the 'hosts' file.
It looks like there is a bug in IPv6 DNS mapping for localhost under Windows that causes the slowdown when used in conjunction with the Windows Firewall. If Microsoft employees are reading this - THIS IS A BUG...FIX IT! Apache doesn't seem to be the issue but it could be that 'localhost' via the firewall first tries an IPv6 address first, fails after a second or two, and then falls back to IPv4 at which point a connection to 32-bit Apache is established. Apache isn't the issue here - the Windows Firewall combined with IPv6 is. Anything 'localhost' only listening on IPv4 will have slow responses.
What worked for me was to use the IPv4 version of 'localhost' in my hosts file. The 'hosts' file is usually located in the 'C:\Windows\System32\drivers\etc' directory on most systems. Editing the 'hosts' file was a pain in the neck. You can't simply right click or double-click to open the file (BUG! ALSO NEEDS TO BE FIXED!). You first have to fire up Notepad or your favorite editor using "Run As Administrator" (right-click) and then hunt for the file using the "File -> Open" dialog. Windows prevents editing that file normally (a good thing) but then get in the way of actually editing it (a bad thing).
Anyway, under Windows 7, the following two lines are commented out:
# 127.0.0.1 localhost
# ::1 localhost
Uncomment the first line but leave the second commented:
127.0.0.1 localhost
# ::1 localhost
Save the file. Try loading pages in Apache again. Should be back to normal speed.
Why this works?
The 'hosts' file supersedes all DNS mappings. So this "fix" merely forces the IPv4 mapping to occur when 'localhost' is requested. Uncomment the second line and Apache will slow down again.
Disabling the Windows Firewall supposedly fixes the issue but I'm pretty sure no one wants to run without a firewall. Disabling IPv6 also apparently fixes the issue but IPv6 is supposedly the future - IPv4 is what the OS falls back on without IPv6. The 'hosts' file fix is really the most desirable until Microsoft can figure out why the Windows Firewall is broken.
Hopefully this helps someone else and helps provide insight into the actual problem.
Side note: If you want to simplify future installations of Apache and you also use MySQL and PHP, you might want to try my portable version of Apache + MySQL + PHP for Windows.
http://cubicspot.blogspot.sg/2010/07/fixing-slow-apache-on-localhost-under.html
相关推荐
Part VI: Windows 7 Online 787 Chapter 20: Browsing the Web 789 Chapter 21: Managing E‐mail and Contacts 837 Chapter 22: Managing Your Schedule 865 Chapter 23: Your Life in Sync—Windows 7 and Live ...
Part VI: Windows 7 Online 787 Chapter 20: Browsing the Web 789 Chapter 21: Managing E‐mail and Contacts 837 Chapter 22: Managing Your Schedule 865 Chapter 23: Your Life in Sync—Windows 7 and Live ...
DLL Suite helps repair Windows PC problems By Fixing error in DLL files. include with Cracked
"r-suresh-genuine-error-fixing-in-windows-xp_in_error_gaveybm_"这个标题暗示了一个教程或指南,旨在帮助用户识别并解决Windows XP中的错误问题。"HOW TO FIND AND FIX ERROR IN WINDOW 19"的描述可能是个笔误,...
The book emphasizes the importance of projects as well as identifying and fixing potential conflicts before they become issues. The later sections of the book introduce you to the methods that you ...
* Windows化 您是突然发现自己被迫进入Windows环境Linux垃圾用户吗? 可能是您的公司正在使您使用Windows,或者是不太技术的朋友正在遇到计算机故障。 无论哪种方式,您都发现自己被Microsoft压迫性外壳cmd.exe压倒...
朱日清、方萍、来桂晓、李亚娟和高松林等人在他们发表的《Effect of Soil Properties on growth and Nitrogenase Activity of Exotic Associative N-fixing Bacteria》一文中,详细探讨了土壤特性如何影响外源固氮菌...
writing running and fixing codes.one
An Analysis of the Automatic Bug Fixing Performance of ChatGPT.pdf
Finding_Fixing_VoIP_Call_Quality_Issues.pdf
比较这两个版本后发现,位于%PROGRAMFILES%\MicrosoftSDKs\Windows\v7.0A\bin目录下的guidgen.exe版本实际上是为了Visual Studio 2008设计的,而%PROGRAMFILES%\MicrosoftSDKs\Windows\v7.0A\bin\NETFX4.0Tools目录...
UnREaL RCE / Fixing Armadillo 5.xx Hardware FingerPrint (with Copy-MemII) <br>This tut is about Fixing Armadillo 5.xx Hardware Fingerprint and defeating Copy-MemII Because something changed in ...
20090120_Finding_and_Fixing_VoIP_Call_Quality_Issues.ppt
windows management framework3.0 Git Command Line Package failed please correct the following problems to ensure full product functionality to learn more ,you can review the list of common issues...
标题中的"eu m30 d50 p6M macd_ma ea (for fixing) 2 mod2_ea_mt4_"似乎是一种自动交易策略或者Expert Advisor(EA)的名称,用于MetaTrader 4(MT4)平台。让我们逐一解析这个名称中的关键元素: - "eu":通常在...
【标题】:“论文翻译:基于协议的程序自动化修复” 【描述】:该论文翻译探讨了“AutoFix”这一自动修复程序错误的技术,该技术利用协议形式的规范元素进行高质量修复建议,并实现调试过程的自动化。...
- Fixed invalid API bug in user32.dll on Windows 98 (jstorme) - Modified code to improve support for discardable/unreadable sections (jstorme) - Fixed ImageBase problem with DLL's when "Use PE ...
「NGFW」AppSecEU2016-Christian-Mainka-Breaking-And-Fixing - 区块链 WAF 网站安全 日志审计 安全测试 安全实践
此外,由于使用了更大的、对齐更好的FastMM桶,这种方法还能够提高临界区代码的性能约7%。当然,这种做法会消耗更多的内存,但对于大多数应用程序来说,关键节的数量通常不会太多,因此内存开销是可以接受的。 ####...
### 知识点一:Windows系统磁盘检查机制 #### 1.1 CHKDSK命令简介 - **CHKDSK** 是一个用于检测并修复文件系统错误的强大工具,尤其是在Windows操作系统中。它能够扫描指定的磁盘分区或卷,并报告发现的任何文件...