How To Protect Directories with Apache Tomcat Realms

How To Protect Directories with Apache Tomcat Realm

This document explains how to protect directories in Tomcat similar to .htaccess with Apache.

Since Tomcat does not use Apache to render its pages it does not use Apache httpd, therefore you won't be able to use .htaccess or the features in your control panel. Instead, you can use Apache Tomcat realm will do this for you and its built into your Tomcat web hosting container. Realm is more complicated and requires tinkering with the server.xml file. There are some examples of Realm in the server.xml however here is a blog article with Tomcat Realm examples.

  • 291 Users Found This Useful
Was this answer helpful?

Related Articles

Spring Framework

Need to develop Plain Old JAVA Objects? Want to have fun developing your application? Then we...

Subdomain Handling Tutorial

This tutorial explains how you can host subdomains with JavaPipe's Tomcat hosting. This is...

Pointer Domain Handling Tutorial

This tutorial explains how you can host pointer domains with a Java web hosting package from...

Choosing between JBoss7's Standalone or Domain features.

JBoss 7 introduced new feature called managed domains. Basically this is a multi-server...

How do I restart my tomcat?

However, if you have a private Tomcat instance with a Java host like us, then you have the...