solaris 10 - Tomcat Restrict Access to specific domain name only -



solaris 10 - Tomcat Restrict Access to specific domain name only -

the server, on tomcat running, having 2 domain names (like, example1.com , example2.com). want restrict access tomcat, such that, can access example2.com. when seek example1.com or ip address, tomcat should error page not found..

as unable touch dns entries, there anyway can build restriction within tomcat??

you not able block completely: tcp connection done ip of adress , there no way know domain name queryed find ip. short of changing dns, there no absolute solution (and then, won't able block access ip)

one way block request host: different exemple2.org. exemple, custom filter :

class="lang-java prettyprint-override">@override public void dofilter(servletrequest request, servletresponse response, filterchain chain) throws ioexception, servletexception { if (!request.getservername().equals("exemple2.com")) { ((httpservletresponse) response).senderror(403); } else { chain.dofilter(request, response); } }

or define 2/3 hosts within tomcat. 1 host exemple2.com application , default 1 wich sends error page.

as said, far perfect bypassed changing host header.

tomcat solaris-10

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -