Clean up

rm -rf /etc/httpd /var/moin
yum remove httpd

Install required RPM packages

yum -y install httpd system-config-httpd mod_python mod_ssl

Build and install moin

cd /tmp
tar xvfz moin-1.5.7.tar.gz
cd moin-1.5.7
python --quiet install --prefix=/var/moin --record=/tmp/moin.inst.log

Create the farm directory

cd /var/moin/share/moin
mkdir farm
cp -a data underlay farm
cp config/wikifarm/ farm
cp config/wikifarm/ farm/
cd farm

The underlay will be the common to all wikis, whi will be a copy of data. Since we want to share user information and plugins (so they have to be installed only once), we create a master directory for those:

mkdir master
mv data/plugin master/
mv data/user master/
ln -s ../master/plugin data
ln -s ../master/user data

Now edit

   1 wikis = [
   2     ("wiki1",    r"^[^/]+/wiki1(/.*)?$"),
   3     ("wiki2",    r"^[^/]+/wiki2(/.*)?$"),
   4     ("wiki3",    r"^[^/]+/wiki3(/.*)?$"),
   5     ("xwiki",    r"^[^/]+/xwiki(/.*)?$"),
   6 ]
   8 class FarmConfig(DefaultConfig):
   9 ...
  10     data_underlay_dir = '/var/moin/share/moin/farm/underlay/'
  11 ...
  12     interwiki_preferred = ['no',]

No need to deal with data_dir, it will be overridden in the per-wiki config.

   1     sitename = u'wiki1' # [Unicode]
   2 ...
   3     interwikiname = 'wiki1'
   4 ...
   5     data_dir = '/var/moin/share/moin/farm/wiki1'

Create configuration files for all wikis:

cp -a
cp -a
cp -a
sed -i 's/wiki1/wiki2/'
sed -i 's/wiki1/wiki3/'
sed -i 's/wiki1/xwiki/'

Create data directories for all wikis:

cp -a data wiki1
cp -a data wiki2
cp -a data wiki3
cp -a data xwiki

Fix permissions and security labels

chown -R apache:apache /var/moin/share/moin/farm
chmod -R ug+rwX /var/moin/share/moin/farm
chmod -R o-rwx /var/moin/share/moin/farm
chcon -hR system_u:object_r:httpd_sys_content_t /var/moin

Apache configuration

All we need is a file /etc/httpd/conf.d/moin.conf

<VirtualHost *:80>
  RewriteEngine on
  RewriteRule ^.*$  https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

Alias /wiki/ "/var/moin/share/moin/htdocs/"
<Directory "/var/moin/share/moin/htdocs/">
   Order deny,allow
   Allow from all

# Everything should be handled by mod_python.
# We need to exclude /wiki/ though.
<LocationMatch "^/(?!wiki/)">
    SetHandler python-program
    # Add the path of your wiki directory
    PythonPath "['/var/moin/share/moin/farm', '/var/moin/lib/python2.3/site-packages'] + sys.path"
    PythonInterpreter wiki

We could just as well have one <Location> per wiki, all with the same content.

Start Apache

service httpd start

Wikis are now accessible under https://<server>/wiki1 etc.

Adding a Wiki

  1. Create the directory:
    cd /var/moin/share/moin/farm
    cp -a data newwiki
  2. Create

    • <!> check ownership, permissions, security context

  3. Modify accordingly

Installing the sinorca4moin Theme

cd /var/moin/share/moin/htdocs
unzip /tmp/
mv sinorca4moin-0.4.5 sinorca4moin
chmod -R go-w sinorca4moin
cp sinorca4moin/ /var/moin/share/moin/farm/master/plugin/theme
chown apache.apache /var/moin/share/moin/farm/master/plugin/theme/
chmod 660 /var/moin/share/moin/farm/master/plugin/theme/
chcon system_u:object_r:httpd_sys_content_t /var/moin/share/moin/farm/master/plugin/theme/
service httpd restart

To make it the default, ore even force it, edit

   1     # The default theme anonymous or new users get
   2     theme_default = 'sinorca4moin'
   3     theme_force = True

Then reload httpd.


Place the file in /var/moin/share/moin/htdocs/common and edit

   1 logo_string = u'<img src="/wiki/common/dblue-white.gif">'

Moin1.5_WikiFarm_Setup_farmconfig (last edited 2008-10-30 11:40:13 by localhost)