Description

In a wiki farm configuration files for the storage of sessions are not stored in a per wiki directory.

Steps to reproduce

  1. Have a wiki farm running as described in the details.
  2. Empty the session_dir
    rm /srv/www/wiki1/data/cache/__session__/*
  3. Restart the web server.
  4. Access one wiki (http://test/wiki1)

  5. Login to this wiki.
  6. Look into the session_dir and find your session
    ll /srv/www/wiki1/data/cache/__session__
  7. Optional: Verify your cookie with the file name.
  8. Access another wiki (http://test/wiki2)

  9. Login to this wiki.
  10. Look into the session_dir of wiki1 and find your session on wiki2
    ll /srv/www/wiki1/data/cache/__session__
    • ...
  11. Look into the session_dir of wiki2 and find out it is empty.

When another process starts serving it will use another session_dir and the users will have to login again.

/!\ The above always leads to the situation that the first wiki used within a process will contain the session files.

Example

Component selection

Details

MoinMoin Version

1.9.0

OS and Version

SunOS sun 5.10 Generic_142901-01 i86pc i386 i86pc

Python Version

Python 2.6.1

Server Setup

Apache 2.2.11 with mod_wsgi/3.1

Server Details

mpm_prefork

Language you are using the wiki in (set in the browser/UserPreferences)

de

global:
<IfModule wsgi_module>
    # configure a daemon process group
    WSGIDaemonProcess moin-wsgi user=webservd group=webservd home=/srv/www/empty display-name=moin-wsgi processes=1 threads=1 umask=0007
    # PROBLEM: processes/threads set to 1 to get a static session_dir in moin

    # disable embedded mode
    WSGIRestrictEmbedded On

    # enable some restrictions for wsgi compliant applications
    WSGIRestrictStdin On
    WSGIRestrictStdout On
    WSGIRestrictSignal On
</IfModule>

VirtualHost
# define default wsgi execution environment
WSGIProcessGroup moin-wsgi
WSGIApplicationGroup moin-wsgi

# preload our script
WSGIImportScript "/srv/www/wiki/cgi-bin/moin.wsgi" process-group=moin-wsgi application-group=moin-wsgi

#
# Wikis
#

# /wiki1
WSGIScriptAlias /wiki1 "/srv/www/wiki/cgi-bin/moin.wsgi"
...

import sys, os
sys.path.insert(0, '/opt/moin/lib/python2.6/site-packages')
sys.path.insert(0, '/opt/webstack/python/lib/python2.6/site-packages')
sys.path.insert(0, '/srv/www/wiki/')
from MoinMoin import log
log.load_config('/srv/www/wiki/logfile')
from MoinMoin.web.serving import make_application
application = make_application(shared=False)

wikis = [
    ("wiki1", r"^https?://test/wiki1.*"),
    ("wiki2", r"^https?://test/wiki2.*"),
]

from MoinMoin.config import multiconfig, url_prefix_static
class FarmConfig(multiconfig.DefaultConfig):
    data_underlay_dir = '/srv/www/wiki1/underlay/'
    superuser = [u"root", ]
    acl_rights_before = u"root:read,write,delete,revert,admin"
    surge_action_limits = { # allow max. <count> <action> requests per <dt> secs
        # action: (count, dt)
        'show': (20, 5),
        'raw': (20, 5),  # some people use this for css
        'AttachFile': (100, 5),
        'diff': (30, 60),
        'fullsearch': (10, 60),
        'edit': (20, 60),
        'rss_rc': (5, 60),
        'default': (30, 30),
    }
    surge_lockout_time = 60 # secs you get locked out when you ignore warnings
    edit_locking = 'lock 5'
    from MoinMoin.security.autoadmin import SecurityPolicy
    mail_smarthost = "localhost"
    mail_from = u"root"
    navi_bar = [
        # If you want to show your page_front_page here:
        #u'%(page_front_page)s',
        u'RecentChanges',
        u'FindPage',
        u'HelpContents',
    ]
    theme_default = 'modernized'
    language_default = 'de'
    show_hosts = False
    logo_string = u'<img src="' + url_prefix_static + u'/common/moinmoin.png" alt="MoinMoin Logo">'
    page_front_page = u"MeineStartSeite"
    shared_intermap = '/opt/moin/share/moin/data/intermap.txt'
    log_reverse_dns_lookups = False
    log_remote_addr = False
    xapian_search = True
    xapian_index_history = True
    xapian_stemming = True

from farmconfig import FarmConfig
class Config(FarmConfig):
    data_dir = '/srv/www/wiki1/data/'
...

Workaround

Discussion

Initialisation of FilesystemSessionStore instance is done wrong.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.9WikiFarmSessionDirHandlingBroken (last edited 2009-12-14 05:57:13 by p5B174269)