[Moin-user] testwiki.py in http://moinmo.in/DimitriJanczak

Mark Scheufele mark.scheufele at diasemi.com
Fri Jan 14 04:53:50 EST 2011


Hi Gang,

you have to make sure that the instance_dir and url_prefix within your wikiconfig.py matches the virtual directory set in the wsgi loader script.

#wikiconfig.py

class Config(multiconfig.DefaultConfig):

        url_prefix_static = '/wiki' + url_prefix_static

        # Directory containing THIS wikiconfig:
        wikiconfig_dir = os.path.abspath(os.path.dirname(__file__))

        #instance_dir = '/where/ever/your/instance/is'
        instance_dir = os.path.join(wikiconfig_dir, 'wiki')

        # Where your own wiki pages are (make regular backups of this directory):
        data_dir = os.path.join(instance_dir, 'data', '') # path with trailing /
        #data_dir = os.path.join(r'\\filer2\moinmoin\data', '')
        # Where system and help pages are (you may exclude this from backup):
        data_underlay_dir = os.path.join(instance_dir, 'underlay', '') # path with trailing /

        surge_action_limits = None # no surge protection
        sitename = u'wiki'

#virtual directory settings in wsgi loader script.

# Create a Virtual Directory per wiki
        params.VirtualDirs = [  VirtualDirParameters(
                Name="wiki",
                Description = "ISAPI-WSGI gateway for the Dialog wiki" ,
                ScriptMaps = sm,
                ScriptMapUpdate = "replace" )


As the isap_wsgi is only 32bit you have to enable 32bit compatibility flag within IIS on w2008r2.

Appended you'll find the documentation I have created while setting up our wiki on w2008r2

BR,

mark

************************
IT/BI/MoinMoin/IISBased
************************
Contents


1. MoinMoin under the command of IIS

     1. List of used software packages

     2. Setting Up IIS

         1. Installation

         2. IIS Configuration

             1. Registering the wiki as ISAPI extension within IIS

MoinMoin under the command of IIS
=================================

On this page a *moinmoin* setup based on the *IIS (Version 7.5)* web server
running on *Windows Server 2008 R2* is covered.

List of used software packages
------------------------------

* python v2.66 [http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi]
* pywin32 python 2.6
   [http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pywin32-214.win32-py2.6.exe/download]
* isapi_wsgi module
   [http://code.google.com/p/isapi-wsgi/downloads/detail?name=isapi_wsgi-0.4.2.win32.exe&can=2&q=]

Setting Up IIS
--------------

Installation
------------

* install *IIS* over the dialog /*Turn Windows features on or off*/
* install the following additional Roles for *IIS*:
    * ISAP Filters
    * Windows Authentication
    * IIS 6 Management Compatibility

IIS Configuration
-----------------

* As all the python software is 32 bit a separate Application pool
   *32-bit-Apps* has been created. Within that pool the property *Enable
   32-Bit-Applications* has been set to true.
* the wiki application itself runs as a python WSGI application using the IIS
   ISAPI extensions.
* after the wiki has been registered within the *IIS* web server (see below)
   it has to be assigned to the *32-bit-Apps* application pool /(Right Click =>
   Advanced Settings => Select Application Pool)/
* to prevent the standard error page for the /*http 404 page not found/* error
   showing up when a user tries to create a new page (problem only appeared
   within *IE*) an empty page for the /*http 404 page not found*/ error has
   been configured.
    * create and empty file called /C:\Moin\wwwroot\custom404.htm/
    * /wiki => Error Pages => 404 => Right Click => Edit Feature Settings =>
      Custom Error Pages/
    * /wiki => Error Pages => Double Click on 404 => Select / /*Insert content
      from static file*/ /and browse for the previously created file
      custom404.htm/
* to prevent the standard error page for the /*403 Forbidden*/ error when a
   user tries to access or edit a page where he does not have permissions an
   empty error page has been created within the IIS configuration (same
   procedure as for the 404 error page).

Registering the wiki as ISAPI extension within IIS
--------------------------------------------------

* create a isapi wsgi loader script which does the following (see sample
   below):
    * creates a *_moinmoinloader193.dll*
    * installs the python isapi_wsgi application within *IIS*

*isapi_wsgi loader script*

---CodeArea-------------------------------------------------------------------
import sys
#add path to moinmoin libraries
sys.path.append("c:/Moin/moin-1.9.3/Lib/site-packages")
from MoinMoin.web.serving import make_application
from MoinMoin import log
## import the ISAPI WSGI glue
import isapi_wsgi


# The entry points for the ISAPI extension.
def __ExtensionFactory__():
        #add path to sys.path where wikiconfig.py can be found
        sys.path.insert(0, 'c:/moin')
        ## new way to instantiate in 1.9
        moinmoinApp = make_application(shared=True)
        return isapi_wsgi.ISAPIThreadPoolHandler(moinmoinApp)

## Installation code
if __name__=='__main__':
        from isapi.install import *

        # If run from the command-line, install ourselves.
        params = ISAPIParameters()

        sm = [ScriptMapParams(Extension="*", Flags=0)]

        # Create a Virtual Directory per wiki
        params.VirtualDirs = [  VirtualDirParameters(
                Name="wiki",
                Description = "ISAPI-WSGI gateway for the Dialog wiki" ,
                ScriptMaps = sm,
                ScriptMapUpdate = "replace" )
        ]

        HandleCommandLine(params)
---CodeArea-------------------------------------------------------------------

* A more detailed description of what the script is doing can be found *here
   [http://code.google.com/docreader/#p=isapi-wsgi&s=isapi-wsgi&t=UnderstandingISAPIWSGI]*.

* run the script 'python <name of the loader script> install'


From: Gang Xu [mailto:jmgxu at hotmail.com]
Sent: Donnerstag, 13. Januar 2011 18:04
To: Moin User List
Subject: [Moin-user] testwiki.py in http://moinmo.in/DimitriJanczak

I'm following the procedure document here, http://moinmo.in/DimitriJanczak, to install MoinMoin 1.9.3 on W2k8.

I followed it step-by-step, until I reach the section to 'create one file per wiki you want to host'. Here the example, testwiki.py is missing.

I finished the steps below to create

  *   C:/wikis/testwiki/data/cache
  *   C:/wikis/testwiki/data/dict
  *   C:/wikis/testwiki/data/pages
  *   and copy plugins to C:/wikis/testwiki/data/plugins

I'm not sure about the SiteName in the next step. I guess it is in the missing testwiki.py.

Now I'm at the step to try 'http://localhost/<somewikiname><http://localhost/%3Csomewikiname%3E> to check you have at least a python page'. I tried http://localhost/wiki1 and got the 'ConfigurationError'.

Any help would be highly appreciated!

I have been having a lot of problems when move my server to W2k8. My Moin 1.8.2 works great on W2k3. When I move to w2k8, I start to hit all kinds of problems. I can't find anything about W2k8 and Moin 1.8. Have been dead in the water for awhile. Luckily, I found the article here. I'm hoping to use it to upgrade to 1.9, with WSGI support.

Thanks,
Gang


_______________________________________________________________________________________

Dialog Semiconductor GmbH
Neue Str. 95
D-73230 Kirchheim
Managing Director: Dr. Jalal Bagherli
Chairman of the Supervisory Board: Gregorio Reyes
Commercial register: Amtsgericht Stuttgart: HRB 231181
UST-ID-Nr. DE 811121668


Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and 
contains proprietary information, some or all of which may be legally privileged. It is 
intended solely for the use of the individual or entity to which it is addressed. Access 
to this email by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken in reliance
on it, is prohibited and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20110114/724ba21e/attachment.html>


More information about the Moin-user mailing list