Difference between revisions of "MediaWiki"

From YobiWiki
Jump to navigation Jump to search
m
Line 70: Line 70:
   
 
==References==
 
==References==
 
* [http://www.mediawiki.org/wiki/Help:Configuration_settings Configuration settings list]
  +
* [http://www.mediawiki.org/wiki/Help:FAQ MediaWiki FAQ]
 
Useful pages:
 
Useful pages:
 
* http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki
 
* http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki
* http://www.mediawiki.org/wiki/Help:Configuration_settings
 
 
* http://www.mediawiki.org/wiki/Manual:AdminSettings.php
 
* http://www.mediawiki.org/wiki/Manual:AdminSettings.php
 
* http://www.mediawiki.org/wiki/Manual:Upgrading_to_1.11
 
* http://www.mediawiki.org/wiki/Manual:Upgrading_to_1.11

Revision as of 21:52, 8 March 2008

Install

Version 1.5 was not yet on amd64 feeds but v1.4.x reclaimed php4 so I took mediawiki v1.5 from the i386 feeds as anyway mediawiki is all arch.

  • Raise the PHP memory limit: create /var/lib/mediawiki1.5/.htaccess with%%%php_value memory_limit 32M

Preventing access to pages

Better solution seems to use this patch:

Or as refered on http://meta.wikimedia.org/wiki/Hidden_pages this one:

Disable anonymous reading

Easy to get:

Customisation

Logo

  • I created a symlink from /var/lib/mediawiki1.5/local to /etc/mediawiki1.5/localdata
  • In LocalSettings.php: $wgLogo = "$wgScriptPath/local/mylogo.png";

Import/Export

HTML-WikiConverter

apt-get install libhtml-wikiconverter-perl

Dialogs are not yet packaged, cf bugreports 419918 and 448912, so for now:

perl -MCPAN -e 'install HTML::WikiConverter::MediaWiki'

Here is the script I used to import my phpwiki pages:

#!/bin//bash


for i in lists/*; do
    mkdir -p $(basename $i)
    cd $(basename $i)
    for p in $(cat ../$i); do
	echo $p
	if [ ! -e "$p.html" ]; then
	    wget -q -O - "http://wiki.teuwen.org/$p" > "$p.html"
	fi
	cat > "$p.txt" <<EOF
''Converted with [[MediaWiki#HTML-WikiConverter|HTML::WikiConverter::MediaWiki]] from my old phpwiki site''
----
EOF
	cat "$p.html"|\
	   awk '
		/class=.wikitext/ {b=1};
		/Begin browse-footer/ {b=0};
		b==1' \
	 | sed 's/<div class="wikitext">//g' \
	 | sed 's/<span style="white-space: nowrap">//g' \
	 | sed 's/<span class="wikipage">//g' \
	 | sed 's/<img src="\/phpwikidata\/themes\/[a-zA-Z0-9]\+\/images\/[a-zA-Z0-9]\+.png" alt="" class="linkicon" border="0" \/>//g' \
	 | sed 's/\x92/\x27/g' \
	 |html2wiki --encoding iso-8859-1 --dialect MediaWiki >> "$p.txt"
#	  >> "$p.txt"
    done
    cd ..
done

Upgrade to 1.11

A big jump from 1.5...
Now the package is simply called mediawiki instead of mediawiki1.x
Strangely apt-get wanted to install mysql-server even if the package just recommends it.
So I downloaded the package and used dpkg -i

References

Useful pages: