Re: Password-protecting Anthill
"Andy Levy" <[email protected]>
| Newsgroups | gmane.comp.java.anthill |
|---|---|
| Message-ID | <[email protected]> |
On 2/28/06, Varban <[email protected]> wrote: > Here is what works for me: > > in the web.xml file at the end I only have this: > > <security-constraint> > <web-resource-collection> > <web-resource-name>anthill</web-resource-name> > <url-pattern>/*</url-pattern> > </web-resource-collection> > <auth-constraint> > <role-name>anthill</role-name> > </auth-constraint> > </security-constraint> > <login-config> > <auth-method>BASIC</auth-method> > <realm-name>anthill</realm-name> > </login-config> OK, I've updated my version to match. Just commented out the <security-role> node, everything else was the same.. > and my anthill.xml looks like this: > > <Context path="/anthill" docBase="/code/idea/AnthillOS/dist/anthill.war" > debug="0" privileged="true" swallowOutput="true"> > <Manager className="org.apache.catalina.session.PersistentManager" > saveOnRestart="false"/> > <ResourceLink name="users" global="UserDatabase" > type="org.apache.catalina.UserDatabase"/> > </Context> I had previously deleted anthill.xml entirely. I created it fresh using this exact text, but removed docBase as mine is different (can I leave it out, or should I put it back with my path?) > Now the resource link in there is the same the manager app uses to get to the > tomcat-users.xml file and if you do not have this, there is this piece in the > server.xml file for tomcat under the server settings: > > <GlobalNamingResources> > > <!-- Editable user database that can also be used by > UserDatabaseRealm to authenticate users --> > <Resource name="UserDatabase" auth="Container" > type="org.apache.catalina.UserDatabase" > description="User database that can be updated and saved" > factory="org.apache.catalina.users.MemoryUserDatabaseFactory" > pathname="conf/tomcat-users.xml" /> > > </GlobalNamingResources> > > > and this goes under the engine settings, but I am not sure if it is needed: > > <Realm className="org.apache.catalina.realm.UserDatabaseRealm" > resourceName="UserDatabase"/> > > I guess that the server.xml parts should be in there already (this came with > the tomcat installation). Once you have all that all you need is a user and > the anthill role in the tomcat-users.xml file and tomcat restart. Correct, all those parts were already there. I thought their existence in server.xml would remove the need to have an anthill.xml, but I'm ready to try anything and everything at this point. tomcat-users.xml is set up as noted earlier...but still no luck. Going to try turning up logging levels and see if any debug info is getting generated.