日期:2014-05-16  浏览次数:20922 次

apache服务正常启动,但打不开网页,提示Try using the Win32DisableAcceptEx directive.

apache服务正常启动,但打不开网页,

apache日志如下:

Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations
[Tue Oct 09 10:38:50 2012] [notice] Server built: Dec  1 2011 21:30:02
[Tue Oct 09 10:38:50 2012] [notice] Parent: Created child process 17580
[Tue Oct 09 10:38:51 2012] [notice] Child 17580: Child process is running
[Tue Oct 09 10:38:51 2012] [notice] Child 17580: Acquired the start mutex.
[Tue Oct 09 10:38:51 2012] [notice] Child 17580: Starting 250 worker threads.
[Tue Oct 09 10:38:51 2012] [notice] Child 17580: Starting thread to listen on port 8080.
[Tue Oct 09 10:38:51 2012] [error] (OS 10038)在一个非套接字上尝试了一个操作。  : Child 17580: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.
[Tue Oct 09 10:38:51 2012] [error] (OS 10038)在一个非套接字上尝试了一个操作。  : Child 17580: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.
[Tue Oct 09 10:38:51 2012] [error] (OS 10038)在一个非套接字上尝试了一个操作。  : Child 17580: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive.

......

原因是Apache 的AcceptEx在window下会出现这种问题,只在APAche2.0.49以上版本会有这中问题。 《Apache 2_2 中文版参考手册》上说:“AcceptEx()是一个微软的WinSock2 API ,通过使用BSD风格的accept() API提供了性能改善。一些流行的Windows产品,比如防病毒软件或虚拟专用网络软件,会干扰AcceptEx()的正确操作。如果你遇到类似于如下的错误:一般的解决办法是关闭 AcceptEx()”。也就是说,可能是 Windows Update 或是防火墙、防毒软件更新了某些网络原件,造成 Microsoft WinSock v2 API 动作不正常,会干扰WinSock2 API,就会影响AcceptEx()的正确操作,就可能出现上面所出现的问题。但是关闭会影响Apache的性能。需要自己权衡利弊。因此如果没有什么错误发生,最好还是不要随便关闭这个功能比较好吧。


在httpd.conf文件中添加Win32DisableAcceptEx 标记,


<IfModule mpm_winnt.c>
     ThreadsPerChild 1000
     MaxRequestsPerChild 10000
     Win32DisableAcceptEx
</IfModule>



另一种解决办法,只要出现了AcceptEx 的问题,就能解决,具体设置为: 1、网上邻居-;本地连接-;属性-;internet协议(TCP/IP)-;属性-;高级-;wins标签-;去掉启用LMhosts查询前的勾. 2、控制面版-;windows防火墙-;高级标签-;本地连接设置-;服务的标签里勾选安全Web服务器(HTTPS)。 3、然后退出Apache,再打开启动就可以了


以上方案都试过,但是还不管用,
后来又查了下,试了下重置winsock就OK了


命令行中执行:netsh winsock reset