You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Shevett <sh...@homeport.org> on 2012/03/14 22:00:27 UTC

Help with ROOT.xml and vhosting please?

Hi folks, I'm setting up a tomcat server that will be running a few 
dozen vhosts all being served from the same war file.  I've set up AJP 
connectors for wildcard hosts on apache, and I'm able to see the tomcat 
server from the outside world.

However, secondary vhosts I create don't seem to be working.

An example.  The apache front end has:

<VirtualHost *:80>
	ServerName m.REDACTED.com
	ServerAlias *.REDACTED.com

	ProxyPreserveHost On
	ProxyPass / ajp://10.211.42.48:8009/
	ProxyPassReverse / ajp://10.211.42.48:8009/

	<Proxy ajp://10.211.42.48:8009/*>
	      Order allow,deny
	      Allow from all
	</Proxy>
</VirtualHost>

The target IP is 10.211.42.48 is running Tomcat6, and has things like this:

/etc/tomcat6/Catalina/vhost.REDACTED.com/ROOT.xml

containing:

<Context path="/" docBase="/var/wars/application.war" />

I'm assuming when I hit vhost.REDACTED.com, I should see a deployed 
version of the application.war, right?  Or am I doing something 
blatantly stupidly wrong here?

Thanks!

	-d

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Help with ROOT.xml and vhosting please?

Posted by Pid <pi...@pidster.com>.
On 14/03/2012 21:00, Dave Shevett wrote:
> Hi folks, I'm setting up a tomcat server that will be running a few
> dozen vhosts all being served from the same war file.  I've set up AJP
> connectors for wildcard hosts on apache, and I'm able to see the tomcat
> server from the outside world.

Exactly which OS, Java & Tomcat versions are you using?


> However, secondary vhosts I create don't seem to be working.
> 
> An example.  The apache front end has:
> 
> <VirtualHost *:80>
>     ServerName m.REDACTED.com
>     ServerAlias *.REDACTED.com
> 
>     ProxyPreserveHost On
>     ProxyPass / ajp://10.211.42.48:8009/
>     ProxyPassReverse / ajp://10.211.42.48:8009/
> 
>     <Proxy ajp://10.211.42.48:8009/*>
>           Order allow,deny
>           Allow from all
>     </Proxy>

The above doesn't serve any purpose does it, unless you have 'deny from
all' rules applied elsewhere?


> </VirtualHost>


> The target IP is 10.211.42.48 is running Tomcat6, and has things like this:
> 
> /etc/tomcat6/Catalina/vhost.REDACTED.com/ROOT.xml
> 
> containing:
> 
> <Context path="/" docBase="/var/wars/application.war" />

path="" would be correct if it was valid here, which it is not - it is
redundant because the path is derived from the Context definition file
name 'ROOT.xml'.

> I'm assuming when I hit vhost.REDACTED.com, I should see a deployed
> version of the application.war, right?  Or am I doing something
> blatantly stupidly wrong here?

What _do_ you see?

Are there any relevant messages in the Tomcat logs?

How have you defined the Hosts in server.xml?

What is the appBase setting for each Host you define in server.xml?


p

> Thanks!
> 
>     -d
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


-- 

[key:62590808]


Re: Help with ROOT.xml and vhosting please?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave,

On 3/14/12 5:00 PM, Dave Shevett wrote:
> Hi folks, I'm setting up a tomcat server that will be running a
> few dozen vhosts all being served from the same war file.  I've set
> up AJP connectors for wildcard hosts on apache, and I'm able to see
> the tomcat server from the outside world.
> 
> However, secondary vhosts I create don't seem to be working.

So, a request to http://m.REDACTED.com/whatever works but not
http://vhost.REDACTED.com/whatever?

What response do you get from the web server?

Have you configured an access log on the Tomcat side? If not, do so.
Include the "Host" header that comes in from httpd... I wouldn't be
surprised if the hostname not what you expected.

If the host goes over correctly, the virtual hosts *should* work. What
does your server.xml look like?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9hE28ACgkQ9CaO5/Lv0PAbRACgxAaxZRWPQ0qTQIGQ2+5q3kWF
7e8An36QZJba5plQiFrypdPITU21GXvg
=d+s5
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org