[pmwiki-users] Growing pains -- prevention thereof
sti at pooq.com
Thu Jun 8 13:12:49 CDT 2006
> I'd like multiple wikis, domain names and server accounts, with clean URLs.
> One copy of the wiki engine, for ease of maintenance. Right now,
> everything is in one wiki, in one folder.
> I haven't looked very hard at CleanURLs and wiki farms yet, other than
> to see there are several ways to do it.
> I'm looking at:
> www.domain1.com/wiki11 (also reachable from www.wiki1.domain1.com)
This is very similar to my own setup and the fact that PmWiki supports
multiple wikis per domain and multiple domains with a single install was
a major reason for my choosing it.
> Can I disguise the fact that domain2 is getting the wiki engine from
> domain1 ? At least disguise it from the casual user. If so, how?
Yes. I do this by using linux soft links. I spent some time reading the
PmWiki docs before coming up with the setup that I use for my
multi-domain farm, because it ended up a bit complex, but I really like
the results. In the end I did something similar to what is described here:
To start with, I created a top-level pmwiki directory to hold my farm
configuration and the PmWiki code. Its world readable on my server, but
outside my document root. In my case its called /var/www/pmwiki. In that
directory I downloaded the latest version of pmwiki and untarred it,
creating a pmwiki-2.1.10 subdirectory.
I also created a subdirectory called farm, and copied the pub, cookbook
and local directories from pmwiki-2.1.10 into farm. This holds all
farm-wide configurations that I don't want to lose when I upgrade to a
Then I made some soft links. I made a /var/www/pmwiki/pmwiki that points
to /var/www/pmwiki/pmwiki-2.1.10, and inside farm I created links from
files named wikilib.d, pmwiki.php and scripts to the corresponding files
in /var/www/pmwiki/pmwiki, so that my directory structure is this:
/pmwiki -> /var/www/pmwiki/pmwiki-2.1.10
pmwiki.php -> /var/www/pmwiki/pmwiki.php
scripts -> /var/www/pmwiki/scripts
wikilib.d -> /var/www/pmwiki/wikilib.d
Now, all I have to do to upgrade (which I've done about a dozen times
now), is untar the new version in /var/www/pmwiki and change the
/var/www/pmwiki/pmwiki link to point to it.
When I set up a field, I create directories in its document area called
cookbook, pub, local, uploads and wiki.d, as well as an index.php file
and a link called farmpub to /var/www/pmwiki/farm/pub. Thus I end up
with a field looking like (in the case of my personal homepage which is
stored at /var/www/sti/sti on the server):
farmpub -> /var/www/pmwiki/farm/pub
The index.php file contains:
For convenience in creating new fields, I actually have a directory tree
at /var/www/pmwiki/default_field which I just copy to a new location to
quickly get set up.
As far as configuration goes, the local/config.php file needs some lines
$ScriptUrl = 'http://www.somedomain.com';
$PubDirUrl = 'http://www.somedomain.com/files/pub';
$FarmPubDirUrl = 'http://www.somedomain.com/files/farmpub';
$EnablePathInfo = 1;
## This next bit is so that PmWiki knows to check the $FarmPubDirUrl
## location as well as the $PubDirUrl one, when looking for css
## customization files. It will probably become redundant at some point
## Each entry is a key,value pair with the key being the local path to a
## resource and the value being the public URL for that
$PageCSSListFmt = array(
'$FarmD/pub/css/local.css' => '$FarmPubDirUrl/css/local.css',
'$FarmD/pub/css/$Group.css' => '$FarmPubDirUrl/css/$Group.css',
'$FarmD/pub/css/$FullName.css' => '$FarmPubDirUrl/css/$FullName.css',
'pub/css/local.css' => '$PubDirUrl/css/local.css',
'pub/css/$Group.css' => '$PubDirUrl/css/$Group.css',
'pub/css/$FullName.css' => '$PubDirUrl/css/$FullName.css');
And for clean-url support, I use a couple of Alias commands in Apache
Alias /files/ /var/www/sti/sti/
Alias / /var/www/sti/sti/index.php/
> Can I still do it if the domains are on two different server accounts?
> How much work will it be to move a wiki from my own account to another?
The answers to these questions strongly depend on the security model
used by the ISP. If different server accounts are just the same as
different user accounts, my setup will work fine. If they are in their
own virtual machines, then you will probably have to have a separate
copy of the PmWiki software running on each machine, although there may
be complex solutions that involve back-end proxying of PHP and Apache
In the worst-case scenario though, it shouldn't take much more than an
hour to move a wiki from one account to another, and that assumes that
you are going from one OS and server to another. If the environments are
the same, then a few minutes should suffice.
> Any advice which cleanURL and wiki farm recipes are most likely to work
> for this setup?
Most of the wiki farm docs are at least partially relevant to the
proposed setup. AFAIK, all of the different clean-url methods should
work. Use whichever you are most comfortable with.
More information about the pmwiki-users