2013-03-01 111 views
0

我試圖讓OSX 10.8.2上的Apache代理請求到特定的URL,以便按照本指南在端口8080上運行Node.js服務器:http://garrows.com/?p=455
In爲了做到這一點,我將以下內容添加的Apache2 /用戶/ george.conf:在Mountain Lion上代理Node.js配置Apache

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

但與此補充說,阿帕奇無法啓動。實際上,只要我添加了'ProxyRequests Off'指令,apache就不會再啓動了。 這是該指令的理想之選嗎?

+0

apache日誌中的任何東西?可能是在/ private/var/log/apache2 – 2013-03-01 03:04:11

+0

沒有跡象顯示文件private/var/log/apache2/error_log中出了什麼問題 – Black 2013-03-01 03:21:54

回答

0

這對我的作品(我使用端口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 

但如果你把它裏面<Directory>不起作用。

要進行調試,可以運行:

sudo apachectl configtest 

這會告訴你那裏是在你的配置錯誤。

+0

typo sudo apachectl configtest – 2013-07-17 17:03:13

+0

錯字修正,謝謝! – 2013-07-17 20:59:19