Wiki hints

From Klaus' wiki
Revision as of 14:24, 14 June 2016 by Klaus (Talk | contribs)

Jump to: navigation, search

Editing the sidebar

After adding administrator rights to the logged in user (using Wikisysop login) use <wikiURL>/index.php/MediaWiki:Sidebar to get to edit the left menu.

Moving a wiki

Here a re some instructions on how to move one or more wikies from one server to another.

In the instructions below I use as an example. Substitute with your server name and it should work beautifully.

I also use <the local server name> as a placeholder for the for the particular server, e.g. myhost.myinstitute.myuniversity.mycountry

Basic installation

Install MediaWiki, MariaDb and other stuff and configure as described over here.

It is a long term stable version of MediaWiki that is installed. It will be kept updated with security patches but no new functionality.

Install ImageMagick.

Create the necessary databases for your wiki and grant usage to the username that you want to use from the wiki.

Get httpd up running

Create a directory in /var/www/html for the wiki, e.g

Configure the httpd server to accept the requests to I use include files to the httpd.conf. Add this to the end of the httpd.conf

NameVirtualHost *:80
Include /etc/httpd/conf/domains/* contains this:

<VirtualHost *:80>
  DirectoryIndex        index.html index.htm index.php index.asp default.asp
  DocumentRoot          /var/www/html/
  ServerAlias  <the local server name>
  ErrorLog              /var/log/httpd/domains/
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
  Customlog               /var/log/httpd/domains/ combined

Start the http server and watch for errors - keep working with the configuration until no errors are shown.

 $] systemctl start httpd

Setting up the MediaWiki

Over at this place are some hints to get it up running if you want to run several wiki's on one installation of the MediaWiki (which should keep maintenance down when upgrading to a new MediaWiki).

Create a symbolic link MediaWiki to the MediaWiki<version> directory in /var/www - it makes it easier to upgrade later by simple moving the symbolic link.

cd into the newly created directory, e.g. /var/www/html/

[.../] $] ln -s /var/www/mediawiki/* .

Provided that you have the DNS set correct you can now start your browser and point it to the web server address. HINT: you can modify your /etc/hosts locally on your Linux desktop to point to the server using an IP address.

If you enter

IP-Address<the local server name>

in your /etc/hosts you can access the full address while moving the wiki content from one server to another and finally swing your DNS around, when everything is working as expected. Note: <the local server name> can be almost anything valid URL, but your local servername may be a good thing to use to keep confusion down.

If you're lucky you browser should now show you the initial configuration page for the wiki. Configure as required for your setup.

Moving the actual pages

Next task after you've configured the wiki is to actually move the content. It is not a straight forward process unfortunately.

Over at Yury's page there are some instructions on how to get stuff out of your wiki.

Create a list of files to export by going to the Special Pages on the source wiki. Select the All Pages and select the name space File and click on Go.

Mark all the files and drop them into a vi editor.

Apply the vi magic that Yury prescribe to fix-up the file and save it as filelist on the source server (in the directory).

Now execute this command on the source server:

$] php maintenance/dumpBackup.php --full --pagelist=filelist --uploads > ~/
$] scp -r images/ <the local server name>:/var/www/html/

On the destination server in the /var/www/html/ directory issue this to change ownership of the newly copied files:

.../ $] chown -R apache:apache *

Now it is time to copy the previously made dump of the pages to the new server and load it into the wiki.

$] scp ~/ <the local server name>:~

Import the dump issuing (in the /var/www/html/ directory)

$] php maintenance/importDump.php ~/  --uploads --conf=./LocalSettings.php
$] php maintenance/rebuildrecentchanges.php --conf=./LocalSettings.php

A lot of noice is comming from php but ignore that.

On the source server you now want to export all the pages.

$] php maintenance/dumpBackup.php --full > ~/
$] scp ~/ <the local server name>:~/

On the destination server import the newly dumped pages:

$] php maintenance/importDump.php ~/ --conf=./LocalSettings.php
$] php maintenance/rebuildrecentchanges.php --conf=./LocalSettings.php