[Moin-user] howto config for two wikis?

George Dinwiddie lists at iDIAcomputing.com
Sun Dec 17 12:13:16 EST 2006


Marcus Goldfish wrote:
> On 12/16/06, *George Dinwiddie* <lists at idiacomputing.com 
> <mailto:lists at idiacomputing.com>> wrote:
> 
>     Marcus Goldfish wrote:
>      >     You don't necessarily need to use virtual hosts.  Setting up two
>      >     different ScriptAlias directives will be sufficient.
>      >
>      >     The farmconfig.py sets all the settings that are in common
>     between the
>      >     wikis.  Then the specific configs set the things that are not
>     in common.
>      >       There are examples included in the distribution.
>      >
>      >
>      > Ok, I have two ScriptAlias directives.
>      >
>      > I don't see the relevant farmconfig.py examples you are referring
>     to--
>      > can you please point me to these, or post a snippet of relevant code?
> 
>     Look at /share/moin/config/wikifarm/farmconfig.py (if you took the
>     default install).  You'll want to copy that for a starting point.  Then
>     for each wiki, add a line under "wikis - [" in farmconfig.py.  Each of
>     these will have the name of the wiki, and the url pattern used for that
>     wiki.  For each of these, you'll need another config file named for that
>     wiki.
> 
> 
> Thanks George.  I think I that I may have twiddled it into working 
> (start pages seem to be ok).
> 
> The problem seemed to lie in my regexes in farmconfig.py.  Of course 
> this might be expected since it's not clearly documented on the moinmoin 
> pages (nor in farmconfig.py) that these *do not* need to be for virtual 
> hosts.
> 
> Three quick questions:
> 
> 1.  Does this apache config excerpt look ok?
> 
>    ### moinmoin config
>    ScriptAlias /wiki1 "/usr/share/moin/wiki1/moin.cgi"
>    ScriptAlias /wiki2 "/usr/share/moin/wiki2/moin.cgi"

You don't need two copies of moin.cgi.  MoinMoin will differentiate them 
based on the URL, using the regex in farmconfig.py.

>    alias /wiki "/usr/share/moin/htdocs"
>    <Directory /usr/share/moin/htdocs>
>       Order allow,deny
>       allow from all
>    </Directory>
>    ### end moinmoin
> 
> 2. Should wiki1.py, wiki2.py, and my modified farmconfig.py all be 
> located in /usr/share/moin/config/wikifarm ?

If you look inside moin.cgi, you'll see the suggestion to add the 
location of farmconfig.py to the python path, using sys.path.insert(). 
You can use whatever location you want, but yes, put your farmconfig.py 
and your wiki*.py files together there.

> 
> 3. Does this excerpt look ok for farmconfig.py?
> 
>    ("wiki1", r".{3,30}/wiki1.*$"),
>    ("wiki2", r".{3,30}/wiki2.*$"),

That looks a little strange, to me.  It seems to say that the wikis can 
move around.  Both "mydomain.com/xyz/wiki1" and "mydomain.com/wiki1" 
would match the same way.  It would match 
"mydomain.com/wiki12345/FrontPage", too.

I would suggest
      ("wiki1", r"^([A-Za-z0-9-]*\.)*mydomain.com/wiki1(/.*)?$"),

This would allow things like:
      http://mydomain.com/wiki1/FrontPage
      http://www.mydomain.com/wiki1/FrontPage
      http://mydomain.com/wiki1/
      http://mydomain.com/wiki1

Hope that helps,
   George

-- 
  ----------------------------------------------------------------------
   * George Dinwiddie *                      http://blog.gdinwiddie.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------





More information about the Moin-user mailing list