You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by john-paul delaney <jp...@justatest.com> on 2003/11/24 17:44:25 UTC
directive/Virtual host problem
Hello List...
In order that a virtual host respond correctly to urls:
http://mydomain.com
http://www.mydomain.com
I've had to add two host entries in server.xml (one for mydomain.com, the other for www.mydomain.com).
I thought it would have been enough to add the alias directive for the www.mydomain.com in the mydomain.com host, thereby avoiding duplication within server.xml?
Are there problems with the alias directive - or am I misinterpreting it's function? Is it just that my configuration is probably bad?
Versions: Tomcat 4.1.24 standalone on redhat 9
Thanks for any suggestions,
/j-p.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: directive/Virtual host problem
Posted by john-paul delaney <jp...@justatest.com>.
Bravo...that did it!
Thanks again Patrick,
/j-p.
On Mon, 24 Nov 2003, Patrick Willart wrote:
> You might want to try placing you alias directives as the first thing inside
> the host directive. That's how I have it and if I am right the order of this
> is important (although I would expect you to see an error message in such
> case).
>
> Patrick
>
> -----Original Message-----
> From: john-paul delaney [mailto:jp@justatest.com]
> Sent: Monday, November 24, 2003 9:33 AM
> To: Tomcat Users List
> Subject: RE: <alias> directive/Virtual host problem
>
>
> Thanks Patrick... then as suspected, I must have a misconfiguration:
>
> <Host name="mydomain.com" debug="0" appBase="webapps/mdom"
> unpackWARs="true" autoDeploy="true">
>
> <Context path="" docBase="" debug="0"
> reloadable="true" crossContext="true">
>
> <Alias>www.mydomain.com</Alias>
> ...
>
> Now the index.jsp in mydomain.com (forwards to a servlet) works ok, but when
> I try www.mydomain.com, I get a 404 requested resource (/index.jsp) is not
> available.
>
> Any suggestions why this is occurring are much appreciated,
>
> /j-p.
>
>
>
> On Mon, 24 Nov 2003, Patrick Willart wrote:
>
> > Hi JP,
> >
> > You don't need to do that. The Alias directive is able to do this.
> >
> > <Alias>111.111.111.111</Alias>
> > <Alias>mydomain.com</Alias>
> > <Alias>www.mydomain.com</Alias>
> >
> >
> > In order that a virtual host respond correctly to urls:
> >
> > http://mydomain.com
> >
> > http://www.mydomain.com
> >
> > I've had to add two host entries in server.xml (one for mydomain.com, the
> > other for www.mydomain.com).
> >
> > I thought it would have been enough to add the alias directive for the
> > www.mydomain.com in the mydomain.com host, thereby avoiding duplication
> > within server.xml?
> >
> > Are there problems with the alias directive - or am I misinterpreting it's
> > function? Is it just that my configuration is probably bad?
> >
> > Versions: Tomcat 4.1.24 standalone on redhat 9
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: directive/Virtual host problem
Posted by Patrick Willart <pa...@aptitudexchange.com>.
You might want to try placing you alias directives as the first thing inside
the host directive. That's how I have it and if I am right the order of this
is important (although I would expect you to see an error message in such
case).
Patrick
-----Original Message-----
From: john-paul delaney [mailto:jp@justatest.com]
Sent: Monday, November 24, 2003 9:33 AM
To: Tomcat Users List
Subject: RE: <alias> directive/Virtual host problem
Thanks Patrick... then as suspected, I must have a misconfiguration:
<Host name="mydomain.com" debug="0" appBase="webapps/mdom"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="" debug="0"
reloadable="true" crossContext="true">
<Alias>www.mydomain.com</Alias>
...
Now the index.jsp in mydomain.com (forwards to a servlet) works ok, but when
I try www.mydomain.com, I get a 404 requested resource (/index.jsp) is not
available.
Any suggestions why this is occurring are much appreciated,
/j-p.
On Mon, 24 Nov 2003, Patrick Willart wrote:
> Hi JP,
>
> You don't need to do that. The Alias directive is able to do this.
>
> <Alias>111.111.111.111</Alias>
> <Alias>mydomain.com</Alias>
> <Alias>www.mydomain.com</Alias>
>
>
> In order that a virtual host respond correctly to urls:
>
> http://mydomain.com
>
> http://www.mydomain.com
>
> I've had to add two host entries in server.xml (one for mydomain.com, the
> other for www.mydomain.com).
>
> I thought it would have been enough to add the alias directive for the
> www.mydomain.com in the mydomain.com host, thereby avoiding duplication
> within server.xml?
>
> Are there problems with the alias directive - or am I misinterpreting it's
> function? Is it just that my configuration is probably bad?
>
> Versions: Tomcat 4.1.24 standalone on redhat 9
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: directive/Virtual host problem
Posted by john-paul delaney <jp...@justatest.com>.
Thanks Patrick... then as suspected, I must have a misconfiguration:
<Host name="mydomain.com" debug="0" appBase="webapps/mdom"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="" debug="0"
reloadable="true" crossContext="true">
<Alias>www.mydomain.com</Alias>
...
Now the index.jsp in mydomain.com (forwards to a servlet) works ok, but when I try www.mydomain.com, I get a 404 requested resource (/index.jsp) is not available.
Any suggestions why this is occurring are much appreciated,
/j-p.
On Mon, 24 Nov 2003, Patrick Willart wrote:
> Hi JP,
>
> You don't need to do that. The Alias directive is able to do this.
>
> <Alias>111.111.111.111</Alias>
> <Alias>mydomain.com</Alias>
> <Alias>www.mydomain.com</Alias>
>
>
> In order that a virtual host respond correctly to urls:
>
> http://mydomain.com
>
> http://www.mydomain.com
>
> I've had to add two host entries in server.xml (one for mydomain.com, the
> other for www.mydomain.com).
>
> I thought it would have been enough to add the alias directive for the
> www.mydomain.com in the mydomain.com host, thereby avoiding duplication
> within server.xml?
>
> Are there problems with the alias directive - or am I misinterpreting it's
> function? Is it just that my configuration is probably bad?
>
> Versions: Tomcat 4.1.24 standalone on redhat 9
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: directive/Virtual host problem
Posted by Patrick Willart <pa...@aptitudexchange.com>.
Hi JP,
You don't need to do that. The Alias directive is able to do this.
<Alias>111.111.111.111</Alias>
<Alias>mydomain.com</Alias>
<Alias>www.mydomain.com</Alias>
grts,
Patrick
---------------
From: john-paul delaney [mailto:jp@justatest.com]
Sent: Monday, November 24, 2003 8:44 AM
To: Tomcat Users List
Subject: <alias> directive/Virtual host problem
Hello List...
In order that a virtual host respond correctly to urls:
http://mydomain.com
http://www.mydomain.com
I've had to add two host entries in server.xml (one for mydomain.com, the
other for www.mydomain.com).
I thought it would have been enough to add the alias directive for the
www.mydomain.com in the mydomain.com host, thereby avoiding duplication
within server.xml?
Are there problems with the alias directive - or am I misinterpreting it's
function? Is it just that my configuration is probably bad?
Versions: Tomcat 4.1.24 standalone on redhat 9
Thanks for any suggestions,
/j-p.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org