tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rjgallac <>
Subject one webapp - two security constraints
Date Tue, 02 Feb 2010 10:30:33 GMT


I was hoping someone could help. I have searched the forums, tomcat docs and
various other sites and cant see anyone else looking to try this.

I'm looking to deploy one webapp with two urls. depending on the url one
will be asked to enter username and password and the other will not.

I was hoping this was going to be as easy as in the server.xml

<Host name="host1" appBase="webapps/files" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
			<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs"  prefix="owl_log." suffix=".txt" pattern="common"
			<Context path="" docBase="${catalina.home}/webapps/files">
				<Resources className="org.apache.naming.resources.FileDirContext"/>
		<Host name="host2" appBase="webapps/files" unpackWARs="true"
autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
			<Context path="" docBase="${catalina.home}/webapps/files">
				<Resources className="org.apache.naming.resources.FileDirContext"/>

and the web.xml

		<display-name>login to OWL</display-name>

So the question is two hosts. One web app.  One protected the other not.  I
imagine I need two web.xml files to be able to achieve such a thing.

This did seem to work for a second but I think that was luck or caching or
something.  Its probably not possible to do such a thing.  My other option
is to put this in a build script to create two war files with two different
web.xml files.

Again, any help appreciated.
View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message