让HAProxy与Apache协同工作

我拥有一个运行几个网站的VPS。 我的一个网站需要使用Mavin for CometD,但是我仍然不得不让Apache运行其他网站。 为此,我正在使用HAProxy。

我把Apache移动到了80端口,并configurationHAProxy在那里运行。 HAProxy将适当的东西路由到Apache是​​一个很好的工作,但Apache给我“默认网站页面”,而不是适当的VirtualHost。 我怎样才能解决这个问题?

从我的Apacheconfiguration一点点:

<VirtualHost 64.64.0.102:80> ServerName example.com ServerAlias www.example.com DocumentRoot /homeexample/public_html/hg ServerAdmin [email protected] <IfModule mod_userdir.c> Userdir disabled Userdir enabled isbwmp </IfModule> <IfModule mod_suphp.c> suPHP_UserGroup isbwmp isbwmp </IfModule> <IfModule !mod_disable_suexec.c> SuexecUserGroup isbwmp isbwmp </IfModule> CustomLog /usr/local/apache/domlogs/example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." CustomLog /usr/local/apache/domlogs/example.com combined ScriptAlias /cgi-bin/ /home/isbwmp/public_html/cgi-bin/ 

还有一点从我的HAProxyconfiguration:(复制,我不明白,真的)

 frontend http_proxy #arbitrary name for the frontend bind *:80 #all interfaces at port 80 mode http option forwardfor option http-server-close option http-pretend-keepalive default_backend twisted #by default forward the requests to apache acl req_cometd_path path_beg /comet/ use_backend cometd if req_cometd_path acl req_cometd_host hdr_dom(host) -i comet.ishouldbewritingmypaper.com use_backend cometd if req_cometd_host 

修正了这个问题:我只需要将IP从vhost更改为127.0.0.1。