Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:apache_tomcat_7_-_ldap-authentifizierung_jndirealm

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
tachtler:apache_tomcat_7_-_ldap-authentifizierung_jndirealm [2015/05/07 15:11] – [LDIF: TomcatRolesAccess] klaustachtler:apache_tomcat_7_-_ldap-authentifizierung_jndirealm [2015/05/07 18:20] (aktuell) – [/etc/tomcat/tomcat-users.xml] klaus
Zeile 118: Zeile 118:
 </code> </code>
  
-Zur Überprüfung ob die Anlage der Gruppen und Gruppenmitglieder funktioniert hat, Kann nachfolgender Befehl verwendet werden, welche die nachfolgende Ausgabe erzeugen sollte:  +Zur Überprüfung ob die Anlage der Gruppen und Gruppenmitglieder funktioniert hat, kann nachfolgender Befehl verwendet werden, welche die nachfolgende Ausgabe erzeugen sollte:  
-<code>+<code ini>
 ldapsearch -x -LLL -H ldap://ldap.idmz.tachtler.net -b "ou=TomcatRoles,dc=tachtler,dc=net" -W -D "cn=Ersatzbenutzer,dc=tachtler,dc=net" "(objectclass=*)" ldapsearch -x -LLL -H ldap://ldap.idmz.tachtler.net -b "ou=TomcatRoles,dc=tachtler,dc=net" -W -D "cn=Ersatzbenutzer,dc=tachtler,dc=net" "(objectclass=*)"
 Enter LDAP Password:  Enter LDAP Password: 
Zeile 237: Zeile 237:
 </code> </code>
  
-Um Änderungen an diesen Zugriffsberechtigungen durchzuführen, um so die **Zugriffsrechte zu beschränken**, sind **zwei** wesentliche Schritte notwendig: +Um Änderungen an diesen Zugriffsberechtigungen durchzuführen, um so die **Zugriffsrechte zu beschränken**, ist nachfolgender Schritt notwendig: 
-  **Löschen** der eines Teils der aktuellen ACL-Konfiguration (**Regel {5}**) +  * **Hinzufügen** der neuen ACL an Position (**Regel {5}**) 
-  **Neuanlage** der zukünftigen ACL-Konfiguration **inklusive des vorher gelöschten Teils der alten ACL-Konfiguration** von (**Regel {5}**)+ 
 +:!: **HINWEIS** - **Die aktuelle Regel {5} wird nach dem Hinzufügen zu Regel {6} !!!**
  
 Mit nachfolgendem Befehl soll nun eine LDIF-Datei in nachfolgendem Verzeichnis, mit nachfolgendem Namen und nachfolgendem Inhalt erstellt werden.  Mit nachfolgendem Befehl soll nun eine LDIF-Datei in nachfolgendem Verzeichnis, mit nachfolgendem Namen und nachfolgendem Inhalt erstellt werden. 
Zeile 252: Zeile 253:
 Die LDIF-Datei ''/etc/openldap/ldif/cn=config_TomcatRolesAccess.ldif'' soll nachfolgenden Inhalt bekommen: Die LDIF-Datei ''/etc/openldap/ldif/cn=config_TomcatRolesAccess.ldif'' soll nachfolgenden Inhalt bekommen:
 <code ini> <code ini>
 +dn: olcDatabase={2}hdb,cn=config
 +changetype: modify
 +add: olcAccess
 +olcAccess: {5}to dn.regex="cn=([^,]+),ou=TomcatRoles,dc=tachtler,dc=net" by self write by dn="cn=Manager,dc=tachtler,dc=net" read by dn="cn=Ersatzbenutzer,dc=tachtler,dc=net" read by * none
 +</code>
 +
 +Abschließend wird mit nachfolgenden Befehlen der Inhalt der LDIF-Dateien **im laufendem Betrieb des [[http://www.openldap.org|OpenLDAP]]-Servers** der **Konfiguration des [[http://www.openldap.org|OpenLDAP]]-Servers** hinzugefügt:
 +
 +:!: **HINWEIS** - **Ab __hier__ ist das Passwort von ''dc=Manager,dc=tachtler,dc=net'' einzugeben!**
 +
 +<code>
 +# ldapmodify -Y EXTERNAL -H ldapi:/// -f /etc/openldap/ldif/cn\=config_TomcatRolesAccess.ldif
 +SASL/EXTERNAL authentication started
 +SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
 +SASL SSF: 0
 +modifying entry "olcDatabase={2}hdb,cn=config"
 +
 +</code>
 +
 +Zur Überprüfung ob die Zugriffsbeschränkung auf die Gruppen funktioniert hat, kann nachfolgender Befehl verwendet werden, welche die nachfolgende Ausgabe erzeugen sollte: 
 +<code ini>
 +# ldapsearch -W -x -D cn=config -b olcDatabase={2}hdb,cn=config
 +Enter LDAP Password:
 +# extended LDIF
 +#
 +# LDAPv3
 +# base <olcDatabase={2}hdb,cn=config> with scope subtree
 +# filter: (objectclass=*)
 +# requesting: ALL
 +#
 +
 +# {2}hdb, config
 +dn: olcDatabase={2}hdb,cn=config
 +objectClass: olcDatabaseConfig
 +objectClass: olcHdbConfig
 +olcDatabase: {2}hdb
 +olcDbDirectory: /var/lib/ldap
 +olcDbIndex: objectClass eq,pres
 +olcDbIndex: ou,cn,mail,surname,givenname eq,pres,sub
 +olcDbIndex: uidNumber,gidNumber,loginShell eq,pres
 +olcDbIndex: uid,memberUid eq,pres,sub
 +olcDbIndex: nisMapName,nisMapEntry eq,pres,sub
 +olcDbIndex: uniqueMember eq,pres
 +olcSuffix: dc=tachtler,dc=net
 +olcRootDN: cn=Manager,dc=tachtler,dc=net
 +olcRootPW: {SSHA}moVXokSVz9/pcZpdyJ0EYlzutrnt4iK1
 +olcAccess: {0}to attrs=userPassword,shadowLastChange,shadowMax,shadowWarning b
 + y self write by dn="cn=Manager,dc=tachtler,dc=net" write by dn="cn=Ersatzbenu
 + tzer,dc=tachtler,dc=net" read by anonymous auth by * none
 +olcAccess: {1}to dn="cn=Manager,dc=tachtler,dc=net" by self write by * none
 +olcAccess: {2}to dn="cn=Ersatzbenutzer,dc=tachtler,dc=net" by self write by dn
 + ="cn=Manager,dc=tachtler,dc=net" write by * none
 +olcAccess: {3}to dn.regex="cn=([^,]+),ou=Group,dc=tachtler,dc=net" by self wri
 + te by dn="cn=Manager,dc=tachtler,dc=net" write by dn="cn=Ersatzbenutzer,dc=ta
 + chtler,dc=net" read by dn.exact,expand="uid=$1,ou=People,dc=tachtler,dc=net" 
 + read by * none
 +olcAccess: {4}to dn.regex="uid=([^,]+),ou=People,dc=tachtler,dc=net" by self w
 + rite by dn="cn=Manager,dc=tachtler,dc=net" write by dn="cn=Ersatzbenutzer,dc=
 + tachtler,dc=net" read by dn.exact,expand="uid=$1,ou=People,dc=tachtler,dc=net
 + " read by * none
 +olcAccess: {5}to dn.regex="cn=([^,]+),ou=TomcatRoles,dc=tachtler,dc=net" by se
 + lf write by dn="cn=Manager,dc=tachtler,dc=net" read by dn="cn=Ersatzbenutzer,
 + dc=tachtler,dc=net" read by * none
 +olcAccess: {6}to * by self write by dn.base="cn=Manager,dc=tachtler,dc=net" wr
 + ite by * read
 +
 +# search result
 +search: 2
 +result: 0 Success
 +
 +# numResponses: 2
 +# numEntries: 1
 +</code>
 +
 +Nachfolgende Erklärungen beschreiben die durchgeführten Änderungen:
 +
 +=== Zugriffsrecht: {cn=([^,]+),ou=TomcatRoles,dc=tachtler,dc=net ===
 +
 +<code ini>
 +olcAccess: {5}to dn.regex="cn=([^,]+),ou=TomcatRoles,dc=tachtler,dc=net" by self write by dn="cn=Manager,dc=tachtler,dc=net" read by dn="cn=Ersatzbenutzer,dc=tachtler,dc=net" read by * none
 +</code>
 +
 +Auf den Eintrag
 +  * ''cn=([^,]+),ou=TomctRoles,dc=tachtler,dc=net''
 +können die nachfolgenden **Benutzer** mit nachfolgenden **Rechten** zugreifen:
 +^ Zugriffsformulierung                                              ^ Benutzer          ^ Zugriffsrecht    ^
 +| ''by self write''                                                 | self (selbst)     | schreiben        |
 +| ''by dn="cn=Manager,dc=tachtler,dc=net" write''                   | Manager           | schreiben        |
 +| ''by dn="cn=Ersatzbenutzer,dc=tachtler,dc=net" read''             | Ersatzbenutzer    | lesen            |
 +| ''by * none''                                                     | <ALLE ANDEREN>    | <KEINE RECHTE>   |
 +
 +Der Eintrag steht für den **einzelnen Benutzer** im Teil des //DIT// **D**irectory **I**nformation **T**ree ''ou=TomcatRoles,dc=tachtler,dc=net'' für alle dort enthaltenen Einträge.
 +
 +===== Konfiguration: Apache Tomcat =====
 +
 +Nachfolgende Konfiguration zeigt die notwendigen Ergänzungen und Änderungen an der unter nachfolgendem internen Link gezeigten Installation eines [[http://tomcat.apache.org/|Apache Tomcat]]-Apache Tomcat Applikation-Servers
 +  * Siehe auch den internen Link: [[tachtler:apache_tomcat_7|Apache Tomcat 7]]
 +
 +:!: **WICHTIG** - **Nachfolgende Konfigurationen sind auf dem __Apache Tomcat Applikations-Server__ durchzuführen !!!**
 +
 +Nachfolgende Stellen innerhalb der Konfigurationsdatei des [[http://tomcat.apache.org/|Apache Tomcat]]-Applikation-Servers müssen auskommentiert bzw. ergänzt werden.
 +
 +==== /etc/tomcat/server.xml ====
 +
 +Die Konfigurationsdatei 
 +  * **''/etc/tomcat/server.xml''**
 +ist unter [[http://centos.org|CentOS]] in der **Version 7.x** die **Haupt**-Konfigurationsdatei des [[http://tomcat.apache.org/|Apache Tomcat]]-Applikation-Servers.
 +
 +Nachfolgend sollen einige Änderungen bzw. Ergänzungen an dieser Konfigurationsdatei durchgeführt werden, welchen ein Kommentar, wie nachfolgend dargestellt, voransteht:
 +<code>
 +<!-- Tachtler -->
 +</code>
 +
 +Hier die **komplette Konfigurationsdatei** mit allen Änderungen bzw. Ergänzungen, welche ebenfalls nachfolgend erklärt werden:
 +<code xml>
 +<?xml version='1.0' encoding='utf-8'?>
 +<!--
 +  Licensed to the Apache Software Foundation (ASF) under one or more
 +  contributor license agreements.  See the NOTICE file distributed with
 +  this work for additional information regarding copyright ownership.
 +  The ASF licenses this file to You under the Apache License, Version 2.0
 +  (the "License"); you may not use this file except in compliance with
 +  the License.  You may obtain a copy of the License at
 +
 +      http://www.apache.org/licenses/LICENSE-2.0
 +
 +  Unless required by applicable law or agreed to in writing, software
 +  distributed under the License is distributed on an "AS IS" BASIS,
 +  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +  See the License for the specific language governing permissions and
 +  limitations under the License.
 +-->
 +<!-- Note:  A "Server" is not itself a "Container", so you may not
 +     define subcomponents such as "Valves" at this level.
 +     Documentation at /docs/config/server.html
 + -->
 +<!-- Tachtler -->
 +<!-- default: <Server port="8005" shutdown="SHUTDOWN"> -->
 +<Server port="8089" shutdown="DOWNBABY">
 +  <!-- Security listener. Documentation at /docs/config/listeners.html
 +  <Listener className="org.apache.catalina.security.SecurityListener" />
 +  -->
 +  <!--APR library loader. Documentation at /docs/apr.html -->
 +  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
 +  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
 +  <Listener className="org.apache.catalina.core.JasperListener" />
 +  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
 +  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
 +  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
 +  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
 +
 +  <!-- Global JNDI resources
 +       Documentation at /docs/jndi-resources-howto.html
 +  -->
 +  <GlobalNamingResources>
 +    <!-- Editable user database that can also be used by
 +         UserDatabaseRealm to authenticate users
 +    -->
 +    <!-- Tachtler disabled -->
 +    <!-- disabled: <Resource name="UserDatabase" auth="Container" -->
 +    <!-- disabled:           type="org.apache.catalina.UserDatabase" -->
 +    <!-- disabled:          description="User database that can be updated and saved" -->
 +    <!-- disabled:          factory="org.apache.catalina.users.MemoryUserDatabaseFactory" -->
 +    <!-- disabled:          pathname="conf/tomcat-users.xml" /> -->
 +  </GlobalNamingResources>
 +
 +  <!-- A "Service" is a collection of one or more "Connectors" that share
 +       a single "Container" Note:  A "Service" is not itself a "Container",
 +       so you may not define subcomponents such as "Valves" at this level.
 +       Documentation at /docs/config/service.html
 +   -->
 +  <Service name="Catalina">
 +
 +    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
 +    <!--
 +    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
 +        maxThreads="150" minSpareThreads="4"/>
 +    -->
 +
 +
 +    <!-- A "Connector" represents an endpoint by which requests are received
 +         and responses are returned. Documentation at :
 +         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
 +         Java AJP  Connector: /docs/config/ajp.html
 +         APR (HTTP/AJP) Connector: /docs/apr.html
 +         Define a non-SSL HTTP/1.1 Connector on port 8080
 +    -->
 +    <!-- Tachtler -->
 +    <!-- default: <Connector port="8080" protocol="HTTP/1.1" -->
 +    <!-- default:            connectionTimeout="20000" -->
 +    <!-- default:            redirectPort="8443" /> -->
 +    <Connector port="8088" protocol="HTTP/1.1"
 +               connectionTimeout="20000"
 +               redirectPort="8443"
 +               address="127.0.0.1" />
 +    <!-- A "Connector" using the shared thread pool-->
 +    <!--
 +    <Connector executor="tomcatThreadPool"
 +               port="8080" protocol="HTTP/1.1"
 +               connectionTimeout="20000"
 +               redirectPort="8443" />
 +    -->
 +    <!-- Define a SSL HTTP/1.1 Connector on port 8443
 +         This connector uses the BIO implementation that requires the JSSE
 +         style configuration. When using the APR/native implementation, the
 +         OpenSSL style configuration is required as described in the APR/native
 +         documentation -->
 +    <!--
 +    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
 +               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
 +               clientAuth="false" sslProtocol="TLS" />
 +    -->
 +
 +    <!-- Define an AJP 1.3 Connector on port 8009 -->
 +    <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> -->
 +    <Connector port="8099" protocol="AJP/1.3" redirectPort="8443" address="127.0.0.1" />
 +
 +
 +    <!-- An Engine represents the entry point (within Catalina) that processes
 +         every request.  The Engine implementation for Tomcat stand alone
 +         analyzes the HTTP headers included with the request, and passes them
 +         on to the appropriate Host (virtual host).
 +         Documentation at /docs/config/engine.html -->
 +
 +    <!-- You should set jvmRoute to support load-balancing via AJP ie :
 +    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
 +    -->
 +    <Engine name="Catalina" defaultHost="localhost">
 +
 +      <!--For clustering, please take a look at documentation at:
 +          /docs/cluster-howto.html  (simple how to)
 +          /docs/config/cluster.html (reference documentation) -->
 +      <!--
 +      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
 +      -->
 +
 +      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
 +           via a brute-force attack -->
 +      <Realm className="org.apache.catalina.realm.LockOutRealm">
 +        <!-- This Realm uses the UserDatabase configured in the global JNDI
 +             resources under the key "UserDatabase" Any edits
 +             that are performed against this UserDatabase are immediately
 +             available for use by the Realm.  -->
 +        <!-- Tachtler - disabled -->
 +        <!-- disabled: <Realm className="org.apache.catalina.realm.UserDatabaseRealm" -->
 +        <!-- disabled:        resourceName="UserDatabase"/> -->
 +      </Realm>
 +
 +      <Host name="localhost"  appBase="webapps"
 +            unpackWARs="true" autoDeploy="true">
 +
 +        <!-- SingleSignOn valve, share authentication between web applications
 +             Documentation at: /docs/config/valve.html -->
 +        <!--
 +        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
 +        -->
 +
 +        <!-- Access log processes all example.
 +             Documentation at: /docs/config/valve.html
 +             Note: The pattern used is equivalent to using pattern="common" -->
 +        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
 +               prefix="localhost_access_log." suffix=".txt"
 +               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
 +
 +      </Host>
 +    </Engine>
 +  </Service>
 +</Server>
 +</code>
 +
 +**Nachfolgend die Erklärungen zu den gemachten Änderungen bzw. Ergänzungen:**
 +
 +=== Bereich: Server | GlobalNamingResources ===
 +
 +Nachfolgende Änderungen **deaktivieren** die Nutzung der Konfigurationsdatei
 +  * ''/etc/tomcat/tomcat-users.xml''
 +durch den [[http://tomcat.apache.org/|Apache Tomcat]]-Applikations-Server zur Authentifizierung der nachfolgenden, oder auch anderer Web-Anwendungen:
 +  * **''tomcat-admin-webapps''** - [[http://tomcat.apache.org/|Apache Tomcat]]-Administrative Web-Anwendungen (host-manager, manager)
 +
 +<code xml>
 +  <GlobalNamingResources>
 +    <!-- Editable user database that can also be used by
 +         UserDatabaseRealm to authenticate users
 +    -->
 +    <!-- Tachtler - DISABLED -->
 +    <!-- disabled: <Resource name="UserDatabase" auth="Container" -->
 +    <!-- disabled:           type="org.apache.catalina.UserDatabase" -->
 +    <!-- disabled:          description="User database that can be updated and saved" -->
 +    <!-- disabled:          factory="org.apache.catalina.users.MemoryUserDatabaseFactory" -->
 +    <!-- disabled:          pathname="conf/tomcat-users.xml" /> -->
 +  </GlobalNamingResources>
 +</code>
 +
 +=== Bereich: Server | Service | Engine | Realm ===
 +
 +Nachfolgende Änderungen **deaktivieren** die Nutzung der Konfigurationsdatei
 +  * ''/etc/tomcat/tomcat-users.xml''
 +durch den [[http://tomcat.apache.org/|Apache Tomcat]]-Applikations-Server zur Authentifizierung der nachfolgenden, oder auch anderer Web-Anwendungen:
 +  * **''tomcat-admin-webapps''** - [[http://tomcat.apache.org/|Apache Tomcat]]-Administrative Web-Anwendungen (host-manager, manager)
 +
 +<code xml>
 +      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
 +           via a brute-force attack -->
 +      <Realm className="org.apache.catalina.realm.LockOutRealm">
 +        <!-- This Realm uses the UserDatabase configured in the global JNDI
 +             resources under the key "UserDatabase" Any edits
 +             that are performed against this UserDatabase are immediately
 +             available for use by the Realm.  -->
 +        <!-- Tachtler - DISABLED -->
 +        <!-- disabled: <Realm className="org.apache.catalina.realm.UserDatabaseRealm" -->
 +        <!-- disabled:        resourceName="UserDatabase"/> -->
 +      </Realm>
 +</code>
 +
 +==== /etc/tomcat/context.xml ====
 +
 +Die Konfigurationsdatei 
 +  * **''/etc/tomcat/context.xml''**
 +ist unter [[http://centos.org|CentOS]] in der **Version 7.x** die Konfigurationsdatei des [[http://tomcat.apache.org/|Apache Tomcat]]-Applikation-Servers welche nachfogende Konfiguration für **jede** Web-Applikation zur verfügung stellt.
 +
 +Nachfolgend sollen einige Änderungen bzw. Ergänzungen an dieser Konfigurationsdatei durchgeführt werden, welchen ein Kommentar, wie nachfolgend dargestellt, voransteht:
 +<code>
 +<!-- Tachtler -->
 +</code>
 +
 +Hier die **komplette Konfigurationsdatei** mit allen Änderungen bzw. Ergänzungen, welche ebenfalls nachfolgend erklärt werden:
 +<code xml>
 +<?xml version='1.0' encoding='utf-8'?>
 +<!--
 +  Licensed to the Apache Software Foundation (ASF) under one or more
 +  contributor license agreements.  See the NOTICE file distributed with
 +  this work for additional information regarding copyright ownership.
 +  The ASF licenses this file to You under the Apache License, Version 2.0
 +  (the "License"); you may not use this file except in compliance with
 +  the License.  You may obtain a copy of the License at
 +
 +      http://www.apache.org/licenses/LICENSE-2.0
 +
 +  Unless required by applicable law or agreed to in writing, software
 +  distributed under the License is distributed on an "AS IS" BASIS,
 +  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +  See the License for the specific language governing permissions and
 +  limitations under the License.
 +-->
 +<!-- The contents of this file will be loaded for each web application -->
 +<Context>
 +
 +    <!-- Default set of monitored resources -->
 +    <WatchedResource>WEB-INF/web.xml</WatchedResource>
 +
 +    <!-- Tachtler -->
 +    <!-- Enable LDAP authentication -->
 +    <Realm className="org.apache.catalina.realm.JNDIRealm" 
 +        connectionName="cn=Ersatzbenutzer,dc=tachtler,dc=net"
 +    connectionPassword="geheim"
 +         connectionURL="ldaps://ldap.idmz.tachtler.net:636"
 +           userPattern="uid={0},ou=People,dc=tachtler,dc=net"
 +              roleBase="ou=TomcatRoles,dc=tachtler,dc=net"
 +              roleName="cn"
 +            roleSearch="(uniqueMember={0})"
 +    />
 +
 +    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
 +    <!--
 +    <Manager pathname="" />
 +    -->
 +
 +    <!-- Uncomment this to enable Comet connection tacking (provides events
 +         on session expiration as well as webapp lifecycle) -->
 +    <!--
 +    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
 +    -->
 +
 +</Context>
 +</code>
 +
 +=== Bereich: Context ===
 +
 +Nachfolgende Änderungen **aktivieren** die Nutzung die Nutzung eines LDAP_Servers durch den [[http://tomcat.apache.org/|Apache Tomcat]]-Applikations-Server zur Authentifizierung der nachfolgenden, oder auch anderer Web-Anwendungen, des [[http://tomcat.apache.org/|Apache Tomcat]]-Applikations-Servers dar.
 +  * **''tomcat-admin-webapps''** - [[http://tomcat.apache.org/|Apache Tomcat]]-Administrative Web-Anwendungen (host-manager, manager)
 +
 +<code xml>
 +    <!-- Tachtler -->
 +    <!-- Enable LDAP authentication -->
 +    <Realm className="org.apache.catalina.realm.JNDIRealm" 
 +        connectionName="cn=Ersatzbenutzer,dc=tachtler,dc=net"
 +    connectionPassword="geheim"
 +         connectionURL="ldaps://ldap.idmz.tachtler.net:636"
 +           userPattern="uid={0},ou=People,dc=tachtler,dc=net"
 +              roleBase="ou=TomcatRoles,dc=tachtler,dc=net"
 +              roleName="cn"
 +            roleSearch="(uniqueMember={0})"
 +    />
 +</code>
 +
 +==== /etc/tomcat/tomcat-users.xml ====
 +
 +Die Konfigurationsdatei 
 +  * **''/etc/tomcat/tomcat-users.xml''**
 +stellt eine **Standard**-Konfigurationsdatei zur Authentifizierung der nachfolgenden, oder auch anderer Web-Anwendungen, des [[http://tomcat.apache.org/|Apache Tomcat]]-Applikations-Servers dar.
 +  * **''tomcat-admin-webapps''** - [[http://tomcat.apache.org/|Apache Tomcat]]-Administrative Web-Anwendungen (host-manager, manager)
 +
 +:!: **WICHTIG** - **Änderungen zur __Aktivierung__ von Rollen und Benutzer, wie unter nachfolgendem internen Link**
 +  * Siehe auch den internen Link: [[tachtler:apache_tomcat_7#etc_tomcat_tomcat-usersxml|Apache Tomcat 7 - /etc/tomcat/tomcat-users.xml]]
 +**__sollten__ wieder __rückgängig gemacht werden__**
 +
 +Nachfolgend die **komplette Konfigurationsdatei** (**wie nach der original Installation ausgeliefert**):
 +<code xml>
 +<?xml version='1.0' encoding='utf-8'?>
 +<!--
 +  Licensed to the Apache Software Foundation (ASF) under one or more
 +  contributor license agreements.  See the NOTICE file distributed with
 +  this work for additional information regarding copyright ownership.
 +  The ASF licenses this file to You under the Apache License, Version 2.0
 +  (the "License"); you may not use this file except in compliance with
 +  the License.  You may obtain a copy of the License at
 +
 +      http://www.apache.org/licenses/LICENSE-2.0
 +
 +  Unless required by applicable law or agreed to in writing, software
 +  distributed under the License is distributed on an "AS IS" BASIS,
 +  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +  See the License for the specific language governing permissions and
 +  limitations under the License.
 +-->
 +<tomcat-users>
 +<!--
 +  NOTE:  By default, no user is included in the "manager-gui" role required
 +  to operate the "/manager/html" web application.  If you wish to use this app,
 +  you must define such a user - the username and password are arbitrary.
 +-->
 +<!--
 +  NOTE:  The sample user and role entries below are wrapped in a comment
 +  and thus are ignored when reading this file. Do not forget to remove
 +  <!.. ..> that surrounds them.
 +-->
 +<!--
 +  <role rolename="tomcat"/>
 +  <role rolename="role1"/>
 +  <user username="tomcat" password="tomcat" roles="tomcat"/>
 +  <user username="both" password="tomcat" roles="tomcat,role1"/>
 +  <user username="role1" password="tomcat" roles="role1"/>
 +-->
 +
 +<!-- <role rolename="admin"/> -->
 +<!-- <role rolename="admin-gui"/> -->
 +<!-- <role rolename="admin-script"/> -->
 +<!-- <role rolename="manager"/> -->
 +<!-- <role rolename="manager-gui"/> -->
 +<!-- <role rolename="manager-script"/> -->
 +<!-- <role rolename="manager-jmx"/> -->
 +<!-- <role rolename="manager-status"/> -->
 +<!-- <user name="admin" password="adminadmin" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" /> -->
 +</tomcat-users>
 </code> </code>
  
tachtler/apache_tomcat_7_-_ldap-authentifizierung_jndirealm.txt · Zuletzt geändert: 2015/05/07 18:20 von klaus