Help:Setting up this wiki

From BioDivBorneo2010

Jump to: navigation, search

Contents

Set up new Laptop

  • Install Fedora 13 from USB
# yum install mysql-server hhtpd php-cli system-config-services policycoreutils-gui emacs php-mysql ImageMagick
  • Kill SE Linux
  • Edit /etc/httpd/conf/httpd.conf and restart
...
<Directory "/var/www/html">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride All
</Directory>
  • Unpack (rsync) old wiki (if using starter) into bb10
  • Set permissions (maybe needed by by suexec)
# chown -R apache bb10
# chgrp -R apache bb10
# chmod -R go-w bb10  
  • Set up MySql database
# mysqladmin create bb10
# mysql bb10
...
mysql> create user 'bb10'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on bb10.* to 'bb09'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'bb10'@'localhost' = password('########');
Query OK, 0 rows affected (0.00 sec)

mysql> \q
  • Load the data
# mysql -u foo -pfoo bb10 < 20100528.sql
  • Fiddle with LocalSettings.php
$wgSitename         = "BioDivBorneo2010";
$wgScriptPath       = "/bb10";
$wgDBtype           = "mysql";
$wgDBserver         = "localhost";
$wgDBname           = "bb10";
$wgDBuser           = "bb10";
$wgDBpassword       = "######";
$wgRightsIcon = "/bb10/images/1/15/Cc.png";
$wgArticlePath = "/bb10/$1"; # disable (see below)
$wgUsePathInfo = true;       # disable (see below)
  • In .htaccess (however, had to disable this `nice URLs' because of redirect loops with Semantic forms)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /bb10/index.php?title=$1 [L,QSA]

(from... Installing Semantic Mediawiki)

  • Unzip the new mediawiki distrib
$ tar xvzf mediawiki-1.15.1.tar.gz
$ mv mediawiki-1.15.1 icbi
  • Set some permissions
$ chmod a+w icbi/config
$ chmod a+w icbi/images
  • Point your browser at the local directory, and proceed with the install as directed
  • Copy LocalSettings.php from config/ up one directory
  • Edit a few things in LocalSettings.php
$wgEnableUploads       = true;
$wgLogo = "/~cam/icbi/images/c/c9/Logo.png" ;
$wgGroupPermissions['*']['edit'] = false;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'pdf', 'txt' );
  • untar extensions in extensions directory
$ tar xvzf semediawiki-1.4.3.tar.gz
$ tar xvzf semantic_forms_1.8.4.tar.gz
  • In LocalSettings.php:
include_once("$IP/extensions/SemanticMediaWiki/includes/SMW_Settings.php");
enableSemantics('phylodiversity.net');
include_once('extensions/SemanticForms/includes/SF_Settings.php');
  • As Admin, go to 'Admin functions for Semantic MediaWiki' and 1) initialize database, 2) update tables. Click around a bit and then return to the page. The database update should be complete.
  • For the right logo to display offline, save to Desktop and upload. Then:
$wgRightsIcon = "/~cam/icbi/images/1/15/Cc.png";

Upgrading SMW

  • Just drop in new SMW and SF and go to the admin page to `update' and `update data'

Import namespaces

  • Edit MediaWiki:Smw_import_xmal, adding a line:
http://phylodiversity.net/xmalesia/schema/xmal.rdf#|[http://phylodiversity.net/xmalesia/ Xmalesia]
  • On each property page (using HasLocn as example):
This is a property of type [[Has type::Page]]. 
This property uses the form [[Has default form::Form:Locn]]. 
Imported from [[Imported from::xmal:hasLocn]].
  • On each category page:
Imported from [[Imported from::xmal:Indiv]]. 
This category uses the form [[Has default form::Indiv]].

Note that the guide says to define the Type: on the import page, and to delete the type statement on the property page, but this does not seem to work. So I will define on the property page. Also imports on the Category pages appear not to have founds the import, but when a page is exported, the rdf:type is fine. There is a strange time lag acting on the effects of namespace definitions, making things hard to debug. If something is not working, just wait a bit and it probably will.

Create structure

  • Create properties
  • Create a template
  • Create a form
    • Delete the standard info:
'''Free text:'''
{{{standard input|free text}}}
{{{standard input|summary}}}
{{{standard input|minor edit}}}

Sidebar

Edit MediaWiki:Sidebar, e.g.:

* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** Special:Properties|List properties
** Special:Categories|List categories
** Special:Templates|List templates
** Special:Forms|List forms
** Special:CreateProperty|Create property
** Special:CreateTemplate|Create template
** Special:CreateForm|Create form
** Special:ExportRDF/{{FULLPAGENAME}}|Export as RDF
** helppage|help
* SEARCH
* TOOLBOX
* LANGUAGES

Fix bug

For version 1.8.4 downloaded as tgz, SemanticForms/includes/SF_FormUtils.inc

173c173
<                       if (field.value.match(/^[\d\.,]+$/)) {
---
> 			if (field.value.match(/^\-?[\d\.,]+$/)) {

Sidebar

Go to MediaWiki:Sidebar as an administrator and edit the lines [1].

Maths

As for bb09 but a bug. Need to do:

cp /root/.texlive2007/texmf-var/web2c/pdftex/latex.fmt images/tmp/

See here

  • Include LaTeX maths expressions. <math>\int\limits_a^x f(\frac{\alpha}{2}\,)\,dx</math> is created by:
<math>\int\limits_a^x f(\frac{\alpha}{2}\,)\,dx</math>

See this guide to LaTeX maths markup.