Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to enable basic HTTP auth on my tomcat application. Also I want to keep it outside the application. I added a new user to tomcat-users.xml and set its role to 'app-user'. Then I added a file $CATALINA_HOME/conf/Catalina/localhost/myapp.xml with the following content. But, tomcat is completely ignoring it. What am I doing wrong?

<Context path="/myapp">

                  Wildcard means whole app requires authentication

            <!-- transport-guarantee can be CONFIDENTIAL, INTEGRAL, or NONE -->

share|improve this question
up vote 0 down vote accepted

The <security-constraint> tag belong to the web.xml of the application (typically in WEB-INF/web.xml in your war).

If you really want to keep it outside of your application, then you could add it to the file conf/web.xml, but keep in mind, it will then be applied to any other webapps in your tomcat.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.