HP 5991-5565 manual Html Head

Models: 5991-5565

1 57
Download 57 pages 47.29 Kb
Page 47
Image 47

1.Create a web application named myweb in your Tomcat Web server by adding the following code to the file $CATALINA_HOME/conf/server.xml:

TIP: To apply the following <Realm/> configuration to all of your virtual machines, insert it between the <Engine/> tags. You can also apply it to the scope of a virtual host by inserting it between the <Host/> tags because this relies on the content being protected.

<Realm className="org.apache.catalina.realm.JNDIRealm" connectionURL="ldap://YOUR_CDS_SERVER_IP:389" connectionName="cn=Manager,dc=example,dc=com" connectionPassword="secret" userPattern="uid={0},ou=people,dc=osm,dc=example,dc=com" roleBase="ou=groups,dc=osm,dc=example,dc=com" roleName="cn"

roleSearch="(uniqueMember={0})"

/>

2.Next, avoid a conflict by commenting out the Tomcat default authentication setting lines as follows:

<!--

<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>

-->

3.Edit the $CATALINA_HOME/webapps/myweb/WEB-INF/web.xml application file and add the following lines:

<?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee / http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

<security-constraint>

<display-name>Example Security Constraint</display-name> <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <url-pattern>/*</url-pattern> <http-method>GET</http-method> <http-method>PUT</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>

<realm-name>Single Sign-on Example</realm-name> </login-config>

<security-role> <role-name>tomcat</role-name> </security-role> </web-app>

4.Create a file named, $CATALINA_HOME/webapps/myweb/index.html, and add the following lines:

<HTML>

<HEAD>

<TITLE>Test Tomcat & CDS integration</TITLE>

<meta http-equiv=Content-Type content="text/html; charset=gb2312"> </HEAD>

<BODY>

Installing, Configuring, and Managing Web Server Middleware Stack Components 47

Page 47
Image 47
HP 5991-5565 manual Html Head