You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christian Decker <de...@gmail.com> on 2009/02/06 16:39:34 UTC

Tomcat Domain for redirects

Hi all,

I'm not that good at configuring Tomcat so I thought I'd ask here. My
problem is that I have a server that is running Tomcat 5.5 and an
Apache server that runs on port 80 and uses mod_jk to redirect all
incoming requests to the tomcat server.

So far, so good. The problem is that I want to access the server from
outside my local network, so instead of accessing http://server1/app/
I now have http://server1.example.com/app/ which automatically
redirects to an index page, but on the wrong address (http://server1/
app/welcome instead of http://server1.example.com/app/welcome) which
is kind of annoying.

As this happens in many different places I assume that the tomcat
server somehow believes that he is server1 instead of
server1.example.com.

Any directions on where to look?

Regards,
Chris
-- 
http://blog.snyke.net 

-----
Christian Decker
http://blog.snyke.net
-- 
View this message in context: http://www.nabble.com/Tomcat-Domain-for-redirects-tp21874907p21874907.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Tomcat Domain for redirects

Posted by Christian Decker <de...@gmail.com>.
Problem is that I also host some PHP and RubyOnRails apps on the same server
and I'd like to keep them running ^^

Caldarale, Charles R wrote:
> 
>> From: Christian Decker [mailto:decker.christian@gmail.com]
>> Subject: Tomcat Domain for redirects
>>
>> I have a server that is running Tomcat 5.5 and an
>> Apache server that runs on port 80 and uses mod_jk
>> to redirect all incoming requests to the tomcat server.
> 
> So let's start at the beginning.  Why do you have httpd in the picture at
> all, if everything's being sent to Tomcat?  Simplify your life.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 


-----
Christian Decker
http://blog.snyke.net
-- 
View this message in context: http://www.nabble.com/Tomcat-Domain-for-redirects-tp21874907p21889861.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Tomcat Domain for redirects

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christian Decker [mailto:decker.christian@gmail.com]
> Subject: Tomcat Domain for redirects
>
> I have a server that is running Tomcat 5.5 and an
> Apache server that runs on port 80 and uses mod_jk
> to redirect all incoming requests to the tomcat server.

So let's start at the beginning.  Why do you have httpd in the picture at all, if everything's being sent to Tomcat?  Simplify your life.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

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


Re: Tomcat Domain for redirects

Posted by Christian Decker <de...@gmail.com>.
This seems to have done the trick, the redirects now finally work properly ^^
It would be nice for it to autodiscover the domain a request came from, but
that's fine by me because it's just a test machine, and I'll have my
sysadmin bothering with the deployment later ^^

Konstantin Kolinko wrote:
> 
> 2009/2/6 Christian Decker <de...@gmail.com>:
>>
>> Hi all,
>>
>> I'm not that good at configuring Tomcat so I thought I'd ask here. My
>> problem is that I have a server that is running Tomcat 5.5 and an
>> Apache server that runs on port 80 and uses mod_jk to redirect all
>> incoming requests to the tomcat server.
>>
>> So far, so good. The problem is that I want to access the server from
>> outside my local network, so instead of accessing http://server1/app/
>> I now have http://server1.example.com/app/ which automatically
>> redirects to an index page, but on the wrong address (http://server1/
>> app/welcome instead of http://server1.example.com/app/welcome) which
>> is kind of annoying.
>>
>> As this happens in many different places I assume that the tomcat
>> server somehow believes that he is server1 instead of
>> server1.example.com.
>>
>> Any directions on where to look?
>>
>> Regards,
>> Chris
> 
> Read Apache HTTPD docs on how it determines its server name. I guess
> it should have been the ServerName directive,
> http://httpd.apache.org/docs/2.2/mod/core.html#servername
> 
> If I remember correctly, mod_jk passes that information to Tomcat, but if
> that
> does not work, it can be overwritten in <Connector> element by setting
> proxyName and proxyPort attributes,
> http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html
> 
> Best regards,
> Konstantin Kolinko
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 


-----
Christian Decker
http://blog.snyke.net
-- 
View this message in context: http://www.nabble.com/Tomcat-Domain-for-redirects-tp21874907p21889858.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Tomcat Domain for redirects

Posted by Konstantin Kolinko <kn...@gmail.com>.
2009/2/6 Christian Decker <de...@gmail.com>:
>
> Hi all,
>
> I'm not that good at configuring Tomcat so I thought I'd ask here. My
> problem is that I have a server that is running Tomcat 5.5 and an
> Apache server that runs on port 80 and uses mod_jk to redirect all
> incoming requests to the tomcat server.
>
> So far, so good. The problem is that I want to access the server from
> outside my local network, so instead of accessing http://server1/app/
> I now have http://server1.example.com/app/ which automatically
> redirects to an index page, but on the wrong address (http://server1/
> app/welcome instead of http://server1.example.com/app/welcome) which
> is kind of annoying.
>
> As this happens in many different places I assume that the tomcat
> server somehow believes that he is server1 instead of
> server1.example.com.
>
> Any directions on where to look?
>
> Regards,
> Chris

Read Apache HTTPD docs on how it determines its server name. I guess
it should have been the ServerName directive,
http://httpd.apache.org/docs/2.2/mod/core.html#servername

If I remember correctly, mod_jk passes that information to Tomcat, but if that
does not work, it can be overwritten in <Connector> element by setting
proxyName and proxyPort attributes,
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html

Best regards,
Konstantin Kolinko

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


Re: Tomcat Domain for redirects

Posted by André Warnier <aw...@ice-sa.com>.
Christian Decker wrote:
[...]

> 
> As this happens in many different places I assume that the tomcat
> server somehow believes that he is server1 instead of
> server1.example.com.
> 
I'm also going to start at the beginning, but in a different way.
So why don't you force Tomcat to believe he /is/ server1.example.com ?
Such as putting that name in your hosts file and in the <Host> tag, I guess.



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