Windows环境下Apache的reverse proxy报OS 10048的原因和解决办法

apache服务器设置了反向代理后,运行一段时间就会莫名其妙的报后台服务器暂时无法连接的错误,过几秒钟后又能自动恢复,查看后发现apache的错误日志中有如下字样:
[error] (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted.  : proxy: HTTP: attempt to connect to localhost:8080 (localhost) failed
[error] ap_proxy_connect_backend disabling worker for (host name)
 
此问题是由于windows环境下缺省的tcp的maxuserport为5000,而使用了反向代理则很可能很快耗尽了端口资源,一旦耗尽端口资源则产生os 10048错误,接着ap_proxy_connect_backend就自动重启所有的线程。
解决办法是到注册表中建立一个maxuserport键以修改此参数的缺省值。以下是msdn上对于此参数的解释:
MaxUserPort

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Data type

Range

Default value

REG_DWORD

5,000–65,534 ( port number )

5000

Description

Determines the highest port number TCP can assign when an application requests an available user port from the system. Typically, ephemeral ports (those used briefly) are allocated to port numbers 1024 through 5000.

Note Image Note

Windows 2000 does not add this entry to the registry. You can add it by editing the registry or by using a program that edits the registry.

转载于:https://www.cnblogs.com/relax/archive/2011/10/17/2214573.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值