【问题标题】:configuring Apache on Mountain Lion proxying to Node.js在 Mountain Lion 上配置 Apache 代理到 Node.js
【发布时间】:2013-02-15 10:46:20
【问题描述】:

我正在尝试让 OSX 10.8.2 上的 Apache 将请求代理到在端口 8080 上运行的 Node.js 服务器的特定 URL,遵循本指南:http://garrows.com/?p=455
为此,我将以下内容添加到 apache2/users/george.conf:

ProxyRequests Off
ProxyPass /foo http://localhost:8080
ProxyPassReverse /foo http://localhost:8080

但是添加了这个,apache 不会启动。 事实上,只要我添加了“ProxyRequests Off”指令,apache 将不再启动。 这是该指令的正确位置吗?

【问题讨论】:

  • apache 日志中有什么内容吗?可能在 /private/var/log/apache2 下
  • 文件 private/var/log/apache2/error_log 中没有迹象表明出了什么问题

标签: apache node.js osx-mountain-lion mod-proxy


【解决方案1】:

这对我有用(我在这里使用端口 3000 连接到我自己的服务器):

<Directory "/Users/psq/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all

</Directory>

ProxyRequests Off
ProxyPass /foo http://localhost:3000
ProxyPassReverse /foo http://localhost:3000

但是放在&lt;Directory&gt;里面就不行了。

要调试,你可以运行:

sudo apachectl configtest

这会告诉你配置中哪里有错误。

【讨论】:

  • 错字 sudo apachectl configtest
猜你喜欢
  • 2012-09-09
  • 2013-08-19
  • 1970-01-01
  • 2013-07-05
  • 1970-01-01
  • 2012-09-14
  • 1970-01-01
  • 2013-01-18
  • 2012-10-11
相关资源
最近更新 更多