PDA

View Full Version : Multiple Virtual Host Configuration


zenmedia
03-31-2010, 03:46 PM
Hey guys,

I am in the process of trying to setup resin with a view to have multiple virtual hosts under a single jvm but for some reason its not working.

The code that i am currently using is ..


<host id="<domain>" host-name="www.<domain>" root-directory="/home/<domain-user>/" >
<web-app id="/" root-directory="public_html" />
</host>

And...


<host id="<domain>">
<host-alias>www.<domain></host-alias>
<root-directory>/home/<user></root-directory>
<web-app id="/" root-directory="public_html" />
</host>

Unfortunately it see's the first virtual host block, but not the second regardless of what format code block i choose to use.

If anyone can point me in the direction of where i am going wrong, what would the correct code block be so i could actually get this working i would be very greatful.

Many Thanks
zenmedia

emil
03-31-2010, 05:18 PM
zenmedia,

What's the setup you're trying to achieve? I.e. which applications are you intending for which hosts?

Thanks,
Emil

zenmedia
03-31-2010, 05:47 PM
Hi,

I currently have the following setup.

apache 2.2 with resin 3.1.10

I have added a single <host entry into the resin.conf which works and allows me to run .jsp files correctly, the host also shows up in the caucho-status page.

If i add another <host entry the second host entry doesnt actually work.

resin allows you to still run the .jsp files from the first virtual host, but doesnt do anything on the second other then to report file not found.

emil
03-31-2010, 06:41 PM
Hi zenmedia,

Just to verify, the host id's and host-names and aliases are different in the two blocks, correct? In the example you've given, it looks like the hosts are the same. If that were true, then Resin would ignore the second one because it's trying to redefine the host.

Thanks,
Emil

zenmedia
03-31-2010, 06:55 PM
Hi,

The paths and the hosts are both different.

emil
04-01-2010, 06:56 PM
zenmedia,

Can you post the full config or send it to me in a private message? The snippet you posted looks fine, so the problem might be elsewhere.

Thanks,
Emil

zenmedia
04-02-2010, 04:27 AM
Hi,

As i currently have railo installed aswell i thought i would check out them settings, removing any comments ive made in app-default.xml etc.

This appears to have fixed it only to give me a new problem.

The sever appears to be generating each web app within its own server context and not as multiple contexts under a single server.

If you still need the config posted i would gladly do this.

Regards
zen