tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: VirtualHost configuration working in Tomcat 5.5 does not work in Tomcat 6.0.20
Date Sun, 11 Oct 2009 11:48:53 GMT
On 11/10/2009 11:56, tomcatnip wrote:
>
> Hi.
>
> I have a fairly popular website which runs on a Apache Tomcat 5.5. I just
> upgraded to 6.0.20 and copied the Virtual Host configuration from my older
> server (i.e. Tomcat 5.5) to the new one.
>
> I cannot access my site with the VirtualHost's domain name. I get a 404 not
> found.
>
> I have two Virtual Hosts (i.e.<Host ...>) , one called www.mydomain.net
> (with WWW) and mydomain.net (without WWW). The latter (mydomain.net) simply
> points to a directory which contains an index.jsp page with a 301 redirect
> to the www.mydomain.net domain. This is for SEO purposes.
>
> I get a 404 not found when I try to access my site this way (using a
> browser):
>
> 1. mydomain.net
> 2. www.mydomain.net
> 3. www.mydomain.net/<directory containing site>
> 4.<ip address>
>
> Points 1 and 4 in the list above are simply 301 redirects to
> www.mydomain.net, so a 404 is not surprising. It seems the www makes it not
> work.
>
> I can access it by going to:
>
> 1. mydomain.net/<directory containing site>
> 2.<ip address>/<directory containing site>
>
> I can also access another dummy wepage with:
>
> www.mydomain.net/<path to dummy webpage>  (with the www)
>
> I know this seems inconsistent. But that is the reason for this post.
>
> Note this works perfectly in Tomcat 5.5.
>
> Here is the configuration:
>
> <Engine name="Catalina" defaultHost="mydomain.net">
>
> <Host name="www.mydomain.net" appBase="webapps"
>         unpackWARs="true" autoDeploy="true"
>         xmlValidation="false" xmlNamespaceAware="false">
> <Context path="" docBase="<path_to_website>"/>
>
> </Host>
> <Host name="mydomain.net" appBase="webapps"
>         unpackWARs="true" autoDeploy="true"
>         xmlValidation="false" xmlNamespaceAware="false">
> <Context path="" docBase="<path_to_301_redirect>"
>
>        </Host>

Place your files in the ROOT directory.

/path/to/website/appBase
/path/to/website/appBase/ROOT

/path/to/redirect/appBase
/path/to/redirect/appBase/ROOT


<Host name="mydomain.net" appBase="/path/to/website/appBase"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
       </Host>

<Host name="mydomain.net" appBase="/path/to/redirect/appBase"
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
       </Host>

You don't need the Context definition if that is all you had configured 
on it.

p





> I would be grateful for any help on this topic.
>
> Thanks.


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


Mime
View raw message