geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Configuring session manager of Tomcat
Date Wed, 26 Jan 2011 08:33:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+session+manager+of+Tomcat">Configuring
session manager of Tomcat</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (4)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >{scrollbar} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >DoS(Denial of Services) is one
of the most common attacking method, which issues lots of <span class="diff-changed-words">request<span
class="diff-added-chars"style="background-color: #dfd;">s</span></span> and
<span class="diff-changed-words">exhaust<span class="diff-added-chars"style="background-color:
#dfd;">s</span></span> free memory of the application server. The server will
crash down <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">due
to</span> <span class="diff-added-words"style="background-color: #dfd;">because
of</span> out of memory problem <span class="diff-changed-words">eventually.<span
class="diff-added-chars"style="background-color: #dfd;"> </span>In</span> Geronimo,
{excerpt}you can swap inactive sessions to a file or just forget them. You can keep a certain
number of sessions in main memory configurable via System configuration as <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">followed.{excerpt}</span>
<span class="diff-added-words"style="background-color: #dfd;">follows.{excerpt}</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>h1. Configuring session
manager <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* {{org.apache.catalina.session.PersistentManager}}
<br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Refer
to</span> <span class="diff-added-words"style="background-color: #dfd;">See</span>
[Tomcat document|http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html|Tomcat 6.0 document]
for more information about those two implementations and relevant attributes. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >You can customize the session
management <span class="diff-changed-words">behavio<span class="diff-added-chars"style="background-color:
#dfd;">u</span>r</span> per web <span class="diff-changed-words">app<span
class="diff-added-chars"style="background-color: #dfd;">lication</span></span>
context in your deployment plan as <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">followed:</span>
<span class="diff-added-words"style="background-color: #dfd;">follows:</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:xml|title=Usage of
StandardManger in geornimo-web.xml} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >Note that for PersistentManager,
you can use different strategies for session store by specifying *store.className* to {{org.apache.catalina.session.FileStore}}
for file based store or {{org.apache.catalina.session.JDBCStore}} for JDBC based store. <span
class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">Refer
to</span> <span class="diff-added-words"style="background-color: #dfd;">See</span>
[Persistence Manager implementations|http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html#Nested_Components|Persistence
Manager implementations] for all the attributes you can configure for each store strategy.
<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC30/Adding+new+listeners"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC30/Adding+new+listeners">Adding
new listeners</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC30/Configuring+the+Web+Container"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC30/Configuring+the+Web+Container">Configuring the Web
Container</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a
href="/confluence/display/GMOxDOC30/Configuring+virtual+host">Configuring virtual host</a></td><td
class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC30/Configuring+virtual+host"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<p>DoS(Denial of Services) is one of the most common attacking method, which issues
lots of requests and exhausts free memory of the application server. The server will crash
down because of out of memory problem eventually. In Geronimo, you can swap inactive sessions
to a file or just forget them. You can keep a certain number of sessions in main memory configurable
via System configuration as follows.</p>

<h1><a name="ConfiguringsessionmanagerofTomcat-Configuringsessionmanager"></a>Configuring
session manager</h1>

<p>The <b>Manager</b> element represents the session manager that is used
to create and maintain HTTP sessions in Tomcat. Geronimo supports both implementations of
Manager by providing a <b>ManagerGBean</b> for:</p>
<ul>
	<li><tt>org.apache.catalina.session.StandardManager</tt></li>
	<li><tt>org.apache.catalina.session.PersistentManager</tt></li>
</ul>


<p>See <a href="http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html" title="Tomcat
6.0 document" class="external-link" rel="nofollow">Tomcat document</a> for more information
about those two implementations and relevant attributes.</p>

<p>You can customize the session management behaviour per web application context in
your deployment plan as follows:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>Usage of StandardManger in geornimo-web.xml</b></div><div
class="codeContent panelContent">
<pre class="code-xml">
...
<span class="code-tag">&lt;manager&gt;</span>TomcatManager<span class="code-tag">&lt;/manager&gt;</span>
<span class="code-tag">&lt;gbean name=<span class="code-quote">"TomcatManager"</span>
class=<span class="code-quote">"org.apache.geronimo.tomcat.ManagerGBean"</span>&gt;</span>
<span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.session.StandardManager<span
class="code-tag">&lt;/attribute&gt;</span>
<span class="code-tag">&lt;attribute name=<span class="code-quote">"initParams"</span>&gt;</span>maxActiveSessions=10
<span class="code-tag">&lt;/attribute&gt;</span>
<span class="code-tag">&lt;/gbean&gt;</span>
...
</pre>
</div></div>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>Usage of PersistentManger in geornimo-web.xml</b></div><div
class="codeContent panelContent">
<pre class="code-xml">
...
<span class="code-tag">&lt;manager&gt;</span>TomcatManager<span class="code-tag">&lt;/manager&gt;</span>
<span class="code-tag">&lt;gbean name=<span class="code-quote">"TomcatManager"</span>
class=<span class="code-quote">"org.apache.geronimo.tomcat.ManagerGBean"</span>&gt;</span>
<span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.session.PersistentManager<span
class="code-tag">&lt;/attribute&gt;</span>
<span class="code-tag">&lt;attribute name=<span class="code-quote">"initParams"</span>&gt;</span>maxActiveSessions=10
                             maxIdleBackup=10
                             maxIdleSwap=11
                             minIdleSwap=5
                             store.className=org.apache.catalina.session.FileStore
                             store.checkInterval=10
                             store.directory=d:/testFolder/session
<span class="code-tag">&lt;/attribute&gt;</span>
<span class="code-tag">&lt;/gbean&gt;</span>
...
</pre>
</div></div>

<p>Note that for PersistentManager, you can use different strategies for session store
by specifying <b>store.className</b> to <tt>org.apache.catalina.session.FileStore</tt>
for file based store or <tt>org.apache.catalina.session.JDBCStore</tt> for JDBC
based store. See <a href="http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html#Nested_Components"
title="Persistence Manager implementations" class="external-link" rel="nofollow">Persistence
Manager implementations</a> for all the attributes you can configure for each store
strategy.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+session+manager+of+Tomcat">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=24186115&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+session+manager+of+Tomcat?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message