File: tomcat.html

package info (click to toggle)
lemonldap-ng 1.9.7-3%2Bdeb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 39,024 kB
  • sloc: perl: 37,552; makefile: 922; sh: 472; sql: 5
file content (177 lines) | stat: -rw-r--r-- 9,641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8" />
  <title>documentation:1.9:applications:tomcat</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="index,follow"/>
<meta name="keywords" content="documentation,1.9,applications,tomcat"/>
<link rel="search" type="application/opensearchdescription+xml" href="../lib/exe/opensearch.html" title="LemonLDAP::NG"/>
<link rel="start" href="tomcat.html"/>
<link rel="contents" href="tomcat.html" title="Sitemap"/>
<link rel="stylesheet" type="text/css" href="../lib/exe/css.php.t.bootstrap3.css"/>
<!-- //if:usedebianlibs
  <link rel="stylesheet" type="text/css" href="/javascript/bootstrap/css/bootstrap.min.css" />
//elsif:useexternallibs
  <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></script>
//elsif:cssminified
  <link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.min.css" />
//else -->
  <link rel="stylesheet" type="text/css" href="/static/bwr/bootstrap/dist/css/bootstrap.css" />
<!-- //endif -->
<script type="text/javascript">/*<![CDATA[*/var NS='documentation:1.9:applications';var JSINFO = {"id":"documentation:1.9:applications:tomcat","namespace":"documentation:1.9:applications"};
/*!]]>*/</script>
<script type="text/javascript" charset="utf-8" src="../lib/exe/js.php.t.bootstrap3.js"></script>
<!-- //if:usedebianlibs
<script type="text/javascript" src="/javascript/jquery/jquery.min.js"></script>
//elsif:useexternallibs
<script type="text/javascript" src="http://code.jquery.com/jquery-2.2.0.min.js"></script>
//elsif:jsminified
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.min.js"></script>
//else -->
<script type="text/javascript" src="/static/bwr/jquery/dist/jquery.js"></script>
<!-- //endif -->
<!-- //if:usedebianlibs
  <script type="text/javascript" src="/javascript/jquery-ui/jquery-ui.min.js"></script>
//elsif:useexternallibs
  <script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
//elsif:jsminified
  <script type="text/javascript" src="/lib/scripts/jquery-ui.min.js"></script>
//else -->
  <script type="text/javascript" src="/lib/scripts/jquery-ui.js"></script>
<!-- //endif -->
</head>
<body>
<div class="dokuwiki export container">
<!-- TOC START -->
<div id="dw__toc">
<h3 class="toggle">Table of Contents</h3>
<div>

<ul class="toc">
<li class="level1"><div class="li"><a href="#presentation">Presentation</a></div></li>
<li class="level1"><div class="li"><a href="#installation">Installation</a></div></li>
<li class="level1"><div class="li"><a href="#configuration">Configuration</a></div></li>
<li class="level1"><div class="li"><a href="#compilation">Compilation</a></div></li>
</ul>
</div>
</div>
<!-- TOC END -->

<h1 class="sectionedit1" id="apache_tomcat">Apache Tomcat</h1>
<div class="level1">

<p>
<a href="tomcat_logo.png_documentation_1.9_applications_tomcat.html" class="media" title="applications:tomcat_logo.png"><img src="tomcat_logo.png" class="mediacenter" alt="" /></a>
</p>
<div class="noteimportant">The Tomcat  Valve is only available for tomcat 5.5 or greater.
</div>
</div>
<!-- EDIT1 SECTION "Apache Tomcat" [1-154] -->
<h2 class="sectionedit2" id="presentation">Presentation</h2>
<div class="level2">

<p>
<a href="http://tomcat.apache.org/" class="urlextern" title="http://tomcat.apache.org/"  rel="nofollow">Apache Tomcat</a> is an open source software implementation of the Java Servlet and JavaServer Pages technologies.
</p>

<p>
As J2EE servlet container, Tomcat provides standard security feature, like authentication: the application deployed in Tomcat can delegate its authentication to Tomcat.
</p>

<p>
By default, Tomcat provides a file called <code>users.xml</code> to manage authentication:
</p>
<pre class="code file xml"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">'1.0'</span> <span class="re0">encoding</span>=<span class="st0">'utf-8'</span><span class="re2">?&gt;</span></span>
<span class="sc3"><span class="re1">&lt;tomcat-users<span class="re2">&gt;</span></span></span>
  <span class="sc3"><span class="re1">&lt;role</span> <span class="re0">rolename</span>=<span class="st0">&quot;tomcat&quot;</span><span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;role</span> <span class="re0">rolename</span>=<span class="st0">&quot;role1&quot;</span><span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;user</span> <span class="re0">username</span>=<span class="st0">&quot;tomcat&quot;</span> <span class="re0">password</span>=<span class="st0">&quot;tomcat&quot;</span> <span class="re0">roles</span>=<span class="st0">&quot;tomcat&quot;</span><span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;user</span> <span class="re0">username</span>=<span class="st0">&quot;role1&quot;</span> <span class="re0">password</span>=<span class="st0">&quot;tomcat&quot;</span> <span class="re0">roles</span>=<span class="st0">&quot;role1&quot;</span><span class="re2">/&gt;</span></span>
  <span class="sc3"><span class="re1">&lt;user</span> <span class="re0">username</span>=<span class="st0">&quot;both&quot;</span> <span class="re0">password</span>=<span class="st0">&quot;tomcat&quot;</span> <span class="re0">roles</span>=<span class="st0">&quot;tomcat,role1&quot;</span><span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;/tomcat-users<span class="re2">&gt;</span></span></span>
&nbsp;</pre>

<p>
<abbr title="LemonLDAP::NG">LL::NG</abbr> provides a valve, available on <a href="../download.html#contributions" class="wikilink1" title="download">download page</a>. This valve will check an HTTP header to set the authenticated user on the J2EE container.
</p>

</div>
<!-- EDIT2 SECTION "Presentation" [155-1077] -->
<h2 class="sectionedit3" id="installation">Installation</h2>
<div class="level2">

<p>
Copy <code>ValveLemonLDAPNG.jar</code> in <code>&lt;TOMCAT_HOME&gt;/server/lib</code>:
</p>
<pre class="code">cp ValveLemonLDAPNG.jar server/lib/</pre>
<div class="notetip">If needed, you can <a href="#compilation" title="documentation:1.9:applications:tomcat ↵" class="wikilink1">recompile the valve from the sources</a>.
</div>
</div>
<!-- EDIT3 SECTION "Installation" [1078-1310] -->
<h2 class="sectionedit4" id="configuration">Configuration</h2>
<div class="level2">

<p>
Add on your <code>server.xml</code> file a new valve entry like this (in host section):
</p>
<pre class="code file xml"><span class="sc3"><span class="re1">&lt;Valve</span> <span class="re0">className</span>=<span class="st0">&quot;org.lemonLDAPNG.SSOValve&quot;</span> <span class="re0">userKey</span>=<span class="st0">&quot;AUTH-USER&quot;</span> <span class="re0">roleKey</span>=<span class="st0">&quot;AUTH-ROLE&quot;</span> <span class="re0">roleSeparator</span>=<span class="st0">&quot;,&quot;</span> <span class="re0">allows</span>=<span class="st0">&quot;127.0.0.1&quot;</span><span class="re2">/&gt;</span></span></pre>

<p>
Configure attributes:
</p>
<ul>
<li class="level1"><div class="li"> <strong>userKey</strong>: key in the HTTP header containing user login.</div>
</li>
<li class="level1"><div class="li"> <strong>roleKey</strong>: key in the HTTP header containing roles. If <abbr title="LemonLDAP::NG">LL::NG</abbr> send some roles split by some commas, configure <strong>roleSeparator</strong>.</div>
</li>
<li class="level1"><div class="li"> <strong>roleSeparator</strong> (optional): role values separator.</div>
</li>
<li class="level1"><div class="li"> <strong>allows</strong> (optional): Define allowed remote <abbr title="Internet Protocol">IP</abbr> (use “,” separator for multiple <abbr title="Internet Protocol">IP</abbr>). Just set the <abbr title="LemonLDAP::NG">LL::NG</abbr> Handler <abbr title="Internet Protocol">IP</abbr> on this attribute in order to add more security. If this attribute is missed all hosts are allowed.</div>
</li>
<li class="level1"><div class="li"> <strong>passThrough</strong> (optional): Allow anonymous access or not. When it takes “false”, HTTP headers have to be sent by <abbr title="LemonLDAP::NG">LL::NG</abbr> to make authentication. So, if the user is not recognized or HTTP headers not present, a 403 error is sent.</div>
</li>
</ul>
<div class="notetip">For debugging, this valve can print some helpful information in debug level. See <a href="http://tomcat.apache.org/tomcat-5.5-doc/logging.html" class="urlextern" title="http://tomcat.apache.org/tomcat-5.5-doc/logging.html"  rel="nofollow">how configure logging in Tomcat</a> . 
</div>
</div>
<!-- EDIT4 SECTION "Configuration" [1311-2481] -->
<h2 class="sectionedit5" id="compilation">Compilation</h2>
<div class="level2">

<p>
The sources are  available on <a href="../download.html#contributions" class="wikilink1" title="download">download page</a>.
</p>

<p>
Required :
</p>
<ul>
<li class="level1"><div class="li"> ant</div>
</li>
<li class="level1"><div class="li"> jre &gt; 1.4</div>
</li>
<li class="level1"><div class="li"> tomcat &gt;= 5.5</div>
</li>
</ul>

<p>
Configure your tomcat home in <code>build.properties</code> files.
</p>
<div class="noteimportant">Be careful for Windows user, path must contains “/”. Example:
<pre class="code">c:/my hardisk/tomcat/</pre>

</div>
<p>
Next run ant command:
</p>
<pre class="code">ant</pre>

<p>
<code>ValveLemonLDAPNG.jar</code> is created under <code>/dist</code> directory. 
</p>

</div>
<!-- EDIT5 SECTION "Compilation" [2482-] --></div>
</body>
</html>