我正在尝试通过让 Apache 反向代理计算机上的其他 HTTP 服务器来解决 Chrome 中的 ERR_UNSAFE_PORT 限制。
- 我使用以下方式加载 mod_proxy
sudo e2enmod proxy
- 我添加
ProxyPass /znc/ http://localhost:6667/
到我的httpd.conf
- 我重新启动Apache
sudo /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 Server 11.10。当直接从本地计算机和互联网查询时,ZNC 会以正确的 200 OK 和 HTML 响应。
答案1
还必须使用 启用 mod_proxy_http sudo a2enmod proxy_http
。