geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.2 > Configuring session manager of Tomcat
Date Fri, 12 Nov 2010 02:29:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=GMOxDOC22&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/GMOxDOC22/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/~chirunhua@gmail.com">Runhua
Chi</a>
    </h4>
        <br/>
                         <h4>Changes (1)</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-added-lines" style="background-color: #dfd;">DoS(Denial
of Services) is one of the most common attacking method, which issues lots of request and
exhaust free memory of the application server. The server will crash down due to 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
console. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h1. Configuring session manager <br>
<br></td></tr>
            <tr><td class="diff-snipped" >...<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/GMOxDOC22/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/GMOxDOC22/Adding+new+listeners">Adding
new listeners</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC22/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/GMOxDOC22/Configuring+the+Web+Container">Configuring the Web
Container</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;<a
href="/confluence/display/GMOxDOC22/Configuring+virtual+host">Configuring virtual host</a></td><td
class='ScrollbarNextIcon'><a href="/confluence/display/GMOxDOC22/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 request and exhaust free memory of the application server. The server will crash down
due to 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 console.</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>Refer to <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 behavior per web app context in your deployment
plan as followed:</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. Refer to <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/GMOxDOC22/Configuring+session+manager+of+Tomcat">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=24186109&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC22/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