tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Schönhaber <tomcat-us...@list-post.mks-mail.de>
Subject Re: How to prevent direct ip address
Date Fri, 23 Jan 2009 12:36:24 GMT
Jaakko Taipale:

> I have specified domain eg. www.myapp.com and I have tomcat running my
> machine that have IP address 123.123.123.123. Now I can access to my app
> with two address:
>  
> http://www.myapp.com/myapp or
> http://123.123.123.123/myapp
>  
> How can I prevent tomcat to response when somebody is trying to access with
> direct ip?

If your Tomcat listens on 123.123.123.123 then you can't prevent it from
responding.
What you can do is create an additional <Host> with it's name attribute
set to 123.123.123.123 and make sure that myapp isn't deployed to this
<Host>'s appBase. Then someone accessing
http://123.123.123.123/myapp
would only get an error message. Or you could deploy a webapp there
which does nothing else than redirect the client to
http://www.myapp.com/myapp

Alternatively, configuring a RemoteHostValve might work too.

Regards
  mks

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


Mime
View raw message