Windows環境下Apache的reverse proxy報OS 10048的原因和解決辦法

來源:互聯網
上載者:User
apache伺服器設定了反向 Proxy後,運行一段時間就會莫名其妙的報後台伺服器暫時無法串連的錯誤,過幾秒鐘後又能自動回復,查看後發現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,而使用了反向 Proxy則很可能很快耗盡了連接埠資源,一旦耗盡連接埠資源則產生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

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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.