PDA

View Full Version : Multiple Virtual Hosts with Apache


masterbp
03-16-2010, 09:27 AM
Hi

I am trying to use Apache Httpd as a dispatcher fronting multiple Resin instances. Each Resin instance should host multiple applications using virtual hosting. Setting up Resin with virtual hosting works (by testing directly on its http port), but when I use Apache as a dispatcher, I can't get it working. I can get Apache to dispatch to Resins ROOT application, but not to virtual hosts. The Caucho-status page does not show the virtual hosts defined on the Resin servers - only the default virtual host.

Any suggestions?

httpd.conf (Apache 2.2)
LoadModule caucho_module "D:/Resin/resin-3.1.9/win32/apache-2.2/mod_caucho.dll"

NameVirtualHost *:80

<VirtualHost *:80>
ServerName dokuwiki.jysk.com
ResinConfigServer 127.0.0.1 6800
</VirtualHost>

resin.conf (Resin 3.1.9):

<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="http://caucho.com/ns/resin/core">

<log name="" level="info" path="stdout:"/>

<cluster id="">
<server id="" port="6800">
<watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
<watchdog-port>6600</watchdog-port>
<http port="8080"/>
</server>

<resin:import path="${resin.home}/conf/app-default.xml"/>

<host id="dokuwiki.jysk.com" root-directory="vhosts/dokuwiki">
<web-app id="/" root-directory="webapps/ROOT"/>
</host>
</cluster>
</resin>

masterbp
03-18-2010, 01:23 PM
I still can't get it to work using mod_caucho, but mod_proxy fits my needs though.

Problem solved by using this configuration:

<VirtualHost *:80>
ServerName dokuwiki.jysk.com
ProxyPreserveHost On
ProxyPass / http://localhost:8002/
ProxyPassReverse / http://localhost:8002/
</VirtualHost>