Personal tools


From MohidWiki

Jump to: navigation, search

This wiki was installed based on MediaWiki, an opensource project from the WikiMedia foundation, responsible for the WikiPedia wiki-engine.


Here's a short video explaining all about wikis: <youtube>-dnL00TdmLY</youtube>


Here's the list of available extensions, exclusively developed for Mohid wiki.

List of

RSS feeds

This wiki allows rss feeds for new articles and recent changes!

Wiki installation & management

Wiki installation guide

Follow the instructions manual for installing the MediaWiki wiki-engine.


Basically you require:

  1. A web-server daemon running such as apache or IIS.
  2. A PHP server installed (requires configuration of the web-server).
  3. The MySQL server installed (requires configuration of the PHP server).

Latex extension


To enable latex mathematical formula encapsulation you basically need to install

  1. Latex (Miktex for windows)
  2. GhostScript
  3. ImageMagick
  4. Texvc (pre-compiled binary)
  5. Enable the Tex extension of your wiki.

Refer to Wiki#Troubleshootings for solving problems when using IIS as a web-server.

If you want to compile the Texvc, you must install mingw32 (gnu make), OCaml and flexdll. They all must be accessible from the Visual Studio 2008 command prompt (gmake, ocaml, ml and flexlink).


Edit the includes/Math.php file and replace the renderMath function with this one:

#Hack found on this page:
function renderMath($latex_formula) {

 return '<img class="tex" src="' . rawurlencode($latex_formula) . '" alt="LaTeX: ' . htmlspecialchars($tex) . '">';

This will use the google charts equations api to render on-the-fly png images of the latex code.

Syntax Highlight extension

Check out this page Syntax_highlighter to install syntax highlighter.

Biblio extension

This extension allows to cite. To install it use this manual.

Re-installation guide

In order to recreate a fresh new database, besides previous other wikis,

  • simply copy your wiki directory.
  • Rename the LocalSettings.php of ./ and of ./config to some other name.
  • Run the ./config/index.php from a web-browser. While configuring the database, remember to define a prefix for your new wiki's dbtables so they don't conflict with older wikis dbtables.
  • wikidb, wikiuser

That's it!


MySQL troubles

If you're using MySQL version 4 or later, chances are you get errors when running the wiki initialize script. Since version 4 of mySQL, passwords are encrypted in 16 bytes strings. Whereas before, they were encrypted in 8 bytes strings. The solution is proposed in the following page. Run the mysql command line and reset the root password with the OLD_PASSWORD command. Then, re-run the wiki initialize script and it should work fine.

LaTex troublesTemplate:Anchor

<math>e^{i \pi}+1=0\,</math>
e^{i \pi}+1=0


Configuring Latex in this version is hell! Only with lots of hacking have we managed to make it work on windows with IIS. Here's the How-to:

  • Grant read/write/execution to the webserver user in the wiki root.
  • Get the texvc binary compiled to render with dvipng here. Rename it to texvc.exe inside the math directory of your wiki.
  • Create the texvc.bat batch file and save it in c:/. Copy the following line inside.
@.\math\texvc %1 %2 %3 %4
  • Change the LocalSettings.php as follows:
## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX	         = true;
$wgMathPath         = "{$wgScriptPath}/math";
$wgMathDirectory    = "{$wgScriptPath}/math";
$wgTmpDirectory     = "{$wgScriptPath}/math/tmp";
$wgTexvc = "c:/texvc.bat"; # Location of the texvc binary
  • Hack accordingly the Math.php file in the includes directory. Here's the file we use. Make sure to create the directory math inside images. What went wrong was that, somehow, the wiki would erase the png. To avoid this, the hacked math.php copies the png before the function returns from call.

That's it. Here's also a sample test php to see if texvc is correctly working on your system:

  /*Basic Hello world test*/
  echo "Hello World!";

  /*Creates a .png */
  $texvcd = "c:/texvc.bat";
  $tmpdir = "./math/tmp";
  $equation = "\int \frac{1}{2}y=x+1";
  $cmde = "$texvcd \"$tmpdir\" \"$tmpdir\" \"$equation\" iso-8859-1";
  echo "$cmde";
  $result = `$cmde`;
  echo "$result";

  /*Displaying the .png*/
  $tough = substr ($result, 1, 32);
  $urls = htmlspecialchars( "$tmpdir/{$tough}.png" );
  $alts = trim($equation);
  if( file_exists( "$urls" ) ) {
       echo "<img class='tex' src=\"$urls\" alt=\"$alts\" />";
  } else {
  	echo "   It doesnt't finds it!  ";


Dumping database

To create a Mysql buckup issue the following comand from a DOS shell:

> mysqldump -h -u user_name -pASSWORD -r wikidb2backup.sql wikidb2

Load database

To load a backup file, from a DOS shell:

> mysql -u user_name -p -e "source backup-file.txt" wikidb


Dumping to an xml file

This is interesting if you're looking for forward and backward compatibility between mediawiki versions. It's also interesting for character encoding that can get mangled between different database servers. Xml is more cross-platform (mysql, posgresql, sqlite).

  • First method: create a list of all files and export them from the special:export page.
  • Second method:
> maintenance/dumpBackup.php --full

Importing from an xml file

Go to the special:import page as wiki sysop and choose and upload the xml dump file. Voilá.


Simply make a backup from the /images folder. To rebuild the images in the new wiki, just move the old /images folder in place of the new one and then launch the following maintenance scripts:

> maintenance/rebuildimages.php --missing

That should do the trick. Remember prior to change the AdminSettings.sample file with your new database access and save it as AdminSettings.php in your wiki root.

Backup scheme

The mysql database is located in \\einstein. The backup system is implemented from the MySql administrator service located in \\kepler. It performs a daily, a weekly and a monthly database dump inside \\kepler\Backup_Servers\einstein\mySQL. Also, a backup of the wiki configuration and images is performed regularly using the script below. The script is scheduled to be launched from \\Davinci\projectos\wikiBup.

Backup script

In dos:

echo off

SET here=%CD%
SET home=D:\projectos\wikiBup
SET src=\\\einstein\www\\wiki1.13
SET arch=wikibackup.tar
SET dbdump=wikidbdavincibackup.sql

cd %home%

echo Dumping wiki database
mysqldump -u root -pASSWORD -r %dbdump% wikidb2

echo Transferring database dump...
copy %dbdump% \\guillaume\temp\wikibackup
copy %dbdump% \\\guillaume\Software\wikimohidbackup
copy %dbdump% \\\guillaume\dbdump

echo Arquiving wiki images...
tar -u -f %arch% %src%

echo Compressing archive...
gzip -f %arch%

echo Transferring images backup...
copy %arch%.gz \\guillaume\temp\wikibackup
copy %arch%.gz \\\guillaume\Software\wikimohidbackup
copy %arch%.gz \\\guillaume\dbdump

echo Done.
cd %here%

echo on