Back to moin

See Also moin_configuration

Multiple Instance Configuration

1. Refer Pages

2. from single to multiple

2.1. uWsgi Config on Nginx

     # config for moin farm instance
     location /book {               
            include uwsgi_params;   
            uwsgi_param SCRIPT_NAME /book;
            uwsgi_modifier1 30;     
            uwsgi_pass unix:///srv/www/moin/var/moin.sock;
            index  Index;           
     } 

refer to http://uwsgi-docs.readthedocs.org/en/latest/Nginx.html

The WSGI standard dictates that SCRIPT_NAME is the variable used to select a specific application.

The uwsgi_modifier1 30 option sets the uWSGI modifier UWSGI_MODIFIER_MANAGE_PATH_INFO. This per-request modifier instructs the uWSGI server to rewrite the PATH_INFO value removing the SCRIPT_NAME from it.

2.2. farmconfig.py Basic

2.2.1. add route define

wikis = [
        # Regular Expressions Ref: http://docs.python.org/2/library/re.html
        #("wiki-main", r"^http://[km\.com|wiki\.li3huo\.com]/.*$"),
        ("wiki-book", r"^http://.+com/book.*$"),
        ("wiki-main", r"http://.+com/.*"),
        
        ("wiki-main", r"http://.+com/.*"),      # default for mismaching
]

2.2.2. update Security settings

        # Security ----------------------------------------------------------

        # This is checked by some rather critical and potentially harmful actions,
        # like despam or PackageInstaller action:
        superuser = [u"YourName", ]
        actions_excluded = multiconfig.DefaultConfig.actions_excluded + ['newaccount', 'raw', 'LocalSiteMap']

        # IMPORTANT: grant yourself admin rights! replace YourName with
        # your user name. See HelpOnAccessControlLists for more help.
        # All acl_rights_xxx options must use unicode [Unicode]
        acl_rights_before = u"YourName:read,write,delete,revert,admin"
        acl_rights_default = u'Known:read,write All:read'

        # Link spam protection for public wikis (uncomment to enable).
        # Needs a reliable internet connection.
        from MoinMoin.security.antispam import SecurityPolicy

2.2.3. update User interface

        navi_bar = [
                # If you want to show your page_front_page here:
                #u'%(page_front_page)s',
                u"[[http://wiki.li3huo.com|Index]]",
                u"[[http://li3huo.com|li3huo.com]]",
                u'[[HelpContents|Moin Guide]]',
        ]
]

2.3. wiki-main.py First instance

from farmconfig import FarmConfig

# now we subclass that config (inherit from it) and change what's different:
class Config(FarmConfig):

        # basic options (you normally need to change these)
        sitename = u"Li3huo' Technical Wiki" # [Unicode]
        interwikiname = u'MainWiki' # [Unicode]

        # name of entry page / front page [Unicode], choose one of those:

        # a) if most wiki content is in a single language
        #page_front_page = u"MyStartingPage"

        # b) if wiki content is maintained in many languages
        page_front_page = u"Index"

        data_dir = '/srv/www/moin/wiki/datas/main'

2.4. wiki-book.py Another instance

from farmconfig import FarmConfig

# now we subclass that config (inherit from it) and change what's different:
class Config(FarmConfig):

        # basic options (you normally need to change these)
        sitename = u"Book" # [Unicode]
        interwikiname = u'BookWiki' # [Unicode]

        # name of entry page / front page [Unicode], choose one of those:

        # a) if most wiki content is in a single language
        #page_front_page = u"MyStartingPage"

        # b) if wiki content is maintained in many languages
        page_front_page = u"Index"

        data_dir = '/srv/www/moin/wiki/datas/book'

3. more common Configuration in farmconfig.py

3.1. Sharing users accross the wikifarm

http://master.moinmo.in/HelpOnUserHandling

user_dir = '/srv/www/moin/wiki/datas/main/user' # common user directory for all farm wikis

3.2. Sharing plugins across the wikifarm

http://moinmo.in/FarmPlugins

# In farmconfig.py
plugin_dirs = ['/srv/www/moin/wiki/datas/main/plugin',]

3.3. Sharing underlay&cache across the wikifarm

data_underlay_dir = os.path.join(wikiDir,'underlay')
    

cache_dir=os.path.join(wikiDir,'var', 'cache')

3.4. Anti Spam Configuration

Refer to HelpOnConfiguration/SecurityPolicy

If you enable the "antispam" utility your wiki will fetch the page BadContent from BadContent and keep it automatically in sync. Do not edit it, because your edits will be overwritten.

# add this within Config class, be careful with indentation:
from MoinMoin.security.antispam import SecurityPolicy

4. Research

4.1. SearchWikiFarm

4.2. OverlayPages

MainWiki: moin_farmConfiguration (last edited 2013-02-27 21:35:20 by twotwo)