如何讓基本的 ProxyPass 在 Apache 2.2.17 上運作?

如何讓基本的 ProxyPass 在 Apache 2.2.17 上運作?

我試圖透過讓 Apache 反向代理電腦上的其他 HTTP 伺服器來繞過 Chrome 中的 ERR_UNSAFE_PORT 限制。

  1. 我載入 mod_proxysudo e2enmod proxy
  2. 我添加ProxyPass /znc/ http://localhost:6667/到我的httpd.conf
  3. 我重新啟動 Apachesudo /etc/init.d/apache2 restart

當我打開時/znc/,我收到 500 內部伺服器錯誤。我添加了LogLevel debug,重新啟動apache,再次嘗試,沒有發現任何可疑的地方:

[Fri Oct 19 18:55:17 2012] [debug] proxy_util.c(1818): proxy: grabbed scoreboard slot 0 in child 21528 for worker http://localhost:6667/
[Fri Oct 19 18:55:17 2012] [debug] proxy_util.c(1934): proxy: initialized single connection worker 0 in child 21528 for (localhost)
[Fri Oct 19 18:55:17 2012] [debug] proxy_util.c(1818): proxy: grabbed scoreboard slot 1 in child 21528 for worker proxy:reverse
[Fri Oct 19 18:55:17 2012] [debug] proxy_util.c(1934): proxy: initialized single connection worker 1 in child 21528 for (*)
[Fri Oct 19 18:55:17 2012] [notice] Apache/2.2.17 (Ubuntu) PHP/5.3.8 configured -- resuming normal operations
[Fri Oct 19 18:55:17 2012] [info] Server built: Feb 14 2012 17:59:20
[Fri Oct 19 18:55:17 2012] [debug] prefork.c(1018): AcceptMutex: sysvsem (default: sysvsem)
[Fri Oct 19 18:55:22 2012] [debug] proxy_util.c(1818): proxy: grabbed scoreboard slot 0 in child 21532 for worker http://localhost:6667/
[Fri Oct 19 18:55:22 2012] [debug] proxy_util.c(1837): proxy: worker http://localhost:6667/ already initialized
[Fri Oct 19 18:55:22 2012] [debug] proxy_util.c(1934): proxy: initialized single connection worker 0 in child 21532 for (localhost)
[Fri Oct 19 18:55:22 2012] [debug] proxy_util.c(1818): proxy: grabbed scoreboard slot 1 in child 21532 for worker proxy:reverse
[Fri Oct 19 18:55:22 2012] [debug] proxy_util.c(1837): proxy: worker proxy:reverse already initialized
[Fri Oct 19 18:55:22 2012] [debug] proxy_util.c(1934): proxy: initialized single connection worker 1 in child 21532 for (*)

所以我現在很困惑。怎麼辦?

我正在運行 Ubuntu 伺服器 11.10。當直接從本機電腦和 Internet 查詢時,ZNC 會以正確的 200 OK 和 HTML 進行回應。

答案1

也必須啟用 mod_proxy_http 與sudo a2enmod proxy_http.

相關內容