|| <> || ##Notes about installing a moin 1.5 wiki farm with a single interpreter under apache/m od_python. == 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 setup.py --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/farmconfig.py farm cp config/wikifarm/mywiki.py farm/wiki1.py 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 '''farmconfig.py''': {{{#!python wikis = [ ("wiki1", r"^[^/]+/wiki1(/.*)?$"), ("wiki2", r"^[^/]+/wiki2(/.*)?$"), ("wiki3", r"^[^/]+/wiki3(/.*)?$"), ("xwiki", r"^[^/]+/xwiki(/.*)?$"), ] class FarmConfig(DefaultConfig): ... data_underlay_dir = '/var/moin/share/moin/farm/underlay/' ... interwiki_preferred = ['no',] }}} No need to deal with ''data_dir'', it will be overridden in the per-wiki config. '''wiki1.py''': {{{#!python sitename = u'wiki1' # [Unicode] ... interwikiname = 'wiki1' ... data_dir = '/var/moin/share/moin/farm/wiki1' }}} Create '''configuration files for all wikis''': {{{ cp -a wiki1.py wiki2.py cp -a wiki1.py wiki3.py cp -a wiki1.py xwiki.py sed -i 's/wiki1/wiki2/' wiki2.py sed -i 's/wiki1/wiki3/' wiki3.py sed -i 's/wiki1/xwiki/' xwiki.py }}} 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''' {{{ RewriteEngine on RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] Alias /wiki/ "/var/moin/share/moin/htdocs/" Order deny,allow Allow from all # Everything should be handled by mod_python. # We need to exclude /wiki/ though. 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" PythonHandler MoinMoin.request::RequestModPy.run PythonInterpreter wiki }}} We could just as well have one per wiki, all with the same content. == Start Apache == {{{ service httpd start }}} Wikis are now accessible under `https:///wiki1` etc. == Adding a Wiki == 1. Create the directory: {{{ cd /var/moin/share/moin/farm cp -a data newwiki }}} 2.#2 Create '''newwiki.py''' * check ownership, permissions, security context 3.#3 Modify '''farmconfig.py''' accordingly == Installing the sinorca4moin Theme == {{{ cd /var/moin/share/moin/htdocs unzip /tmp/sinorca4moin-0.4.5.zip mv sinorca4moin-0.4.5 sinorca4moin chmod -R go-w sinorca4moin cp sinorca4moin/sinorca4moin.py /var/moin/share/moin/farm/master/plugin/theme chown apache.apache /var/moin/share/moin/farm/master/plugin/theme/sinorca4moin.py chmod 660 /var/moin/share/moin/farm/master/plugin/theme/sinorca4moin.py chcon system_u:object_r:httpd_sys_content_t /var/moin/share/moin/farm/master/plugin/theme/sinorca4moin.py service httpd restart }}} To make it the default, ore even force it, edit '''farmconfig.py''': {{{#!python # The default theme anonymous or new users get theme_default = 'sinorca4moin' theme_force = True }}} Then reload httpd. == Icon == Place the file in /var/moin/share/moin/htdocs/common and edit '''farmconfig.py''': {{{#!python logo_string = u'' }}}