Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to allow access to an html file from the private network only?

Status
Not open for further replies.

nregi

Programmer
Sep 7, 2004
2
CA
Hello,

I have 2 web applications running on Tomcat.
One is accessed via the public ip and the other should be accessible only via the private ip.
Is there a way to tell tomcat to deny access to an html folder or files through the public ip?

Thank you.
 
I can tell you how to do it if you are using Apache as your front end, but purely Tomcat, I don't know.
 
The easiest way would be to configure your firewall so that port 80/8080 or whatever you have tomcat running on is not publically visible.

--------------------------------------------------
Free Database Connection Pooling Software
 
sedj,

But I need one of the html page accessible from anywhere.
I only want one html folder restricted to private network, the others can be accessed from anywhere.

This can be solved only through tomcat config if possible,
I thought of restricting it through a servlet, but someone can access the html pages if the path is known.

Thanks.
 

Not if you write the servlet properly.

I would recommend you use Apache as the front end to Tomcat. There's a reason they chose not to implement a lot of functionality in Tomcat, because it is already done perfectly well in other applications.

With apache you can bind one virtual host to one interface and a different one to another, then the public can't get to the private interface.

I think it would take you far less time to get a simple Apache config working than to try to hack together a pure Tomcat solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top