How to protect a directory with Private JVM? Print

  • 0

IMPORTANT NOTE: Please do not modify system files without a backup copy of them.

In order to use protected directory with Private JVM enabled, you should edit the files below:

1) your application web.xml

2) tomcat-users.xml, which is located in your Private JVM configuration directory.

Your application web.xml should contains:

<security-constraint>
<web-resource-collection>
<web-resource-name>Wildcard means whole app requires authentication</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>tomcat</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>

Your tomcat-users.xml should contains:

<role rolename="tomcat"/>
<user username="your_username" password="your_password" roles="tomcat"/>


Was this answer helpful?

« Back