4041
Comment:
|
4444
|
Deletions are marked like this. | Additions are marked like this. |
Line 165: | Line 165: |
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'<img src="/wiki/common/dblue-white.gif">' }}} |
Notes about installing a moin 1.5 wiki farm with a single interpreter under apache/mod_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:
1 wikis = [
2 ("wiki1", r"^[^/]+/wiki1(/.*)?$"),
3 ("wiki2", r"^[^/]+/wiki2(/.*)?$"),
4 ("wiki3", r"^[^/]+/wiki3(/.*)?$"),
5 ("xwiki", r"^[^/]+/xwiki(/.*)?$"),
6 ]
7
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.
wiki1.py:
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
<VirtualHost *:80> RewriteEngine on RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] </VirtualHost> Alias /wiki/ "/var/moin/share/moin/htdocs/" <Directory "/var/moin/share/moin/htdocs/"> Order deny,allow Allow from all </Directory> # 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" PythonHandler MoinMoin.request::RequestModPy.run PythonInterpreter wiki </LocationMatch>
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
- Create the directory:
cd /var/moin/share/moin/farm cp -a data newwiki
Create newwiki.py
check ownership, permissions, security context
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:
Then reload httpd.
Icon
Place the file in /var/moin/share/moin/htdocs/common and edit farmconfig.py:
1 logo_string = u'<img src="/wiki/common/dblue-white.gif">'