Special:Badtitle/NS90:User talk:Gishzida/Notes on HowTo Build a MediaWiki Appliance to Run All The Tropes (2)

Note: The following was done on a system running Windows 7 Pro as the Host system with lots of Hard drive space(2 Tb drive with nearly 1 Tb free) and 48 GB of memory and Dual Quad core Xeon processors-- With other system configurations YMMV.

I chose a "prebuilt" VM which has all of the components needed for MediaWiki already included -- created by Turnkey Linux. The VM includes Webmin to administer the server, A browser based console terminal, and PHPMyAdmin to administer the MySQL server. These three things eliminate the additional overhead created by using a linux distro with a GUI. Steps to make it happen:

1)Install Virtual Box https://www.virtualbox.org/wiki/Downloads

2) Download the Turnkey Linux MediaWiki ISO http://www.turnkeylinux.org/download?file=turnkey-mediawiki-13.0-wheezy-amd64.iso

3) Burn ISO to CD-Rom [Alternate method would be to mount the ISO as a virtual disk at install time]

4) load CD or mount iso

5) Start Virtual Box and create a new host

Host properties: The minimum Drive space should be a minimum of 2.5 times the ammount of memory allocated to the machine with the minimum disk size being no smaller than 20 Gb -- The reason for the large disk is because Turnkey Linux allocates the size of memory allocated to hard drive swap space. For example if you allocate 8 Gb of memory to the VM 8 Gb of your Drive space will be allocated to the Swap volume. A small virtual drive allocation will mean your disk will run out of space quickly. A decompressed ATT dump file is 1.6 Gb

If you were to use a Turnkey Linux VM for installation of a personal copy of wikipedia you'd probably need a disk 4 * the size of the Wikipedia dump file + the size of memory. enwiki.xml is 11.6 Gb. so that would be 48 Gb plus 8gb of memory so the drive should be at least 56 Gb

For my ATT clone I used a 32 GB disk partition and assigned 8 gb of memory. The net result after the basic system came up was a primary disk volume of about 20 Gb of usable space.

If the drive is not large enough expect MySQL to stop working for lack of drive space.

6) Install Turnkey Linux Mediawiki to the new VM

Notes: Just follow the defaults except skip the backup prompts unless you have a Turnkey hosting account.

You will be prompted for enter passwords for root, MySQL root, and MediaWiki Admin

7) In virtual box set the network interface to bridge to the host network interface [the server needs to be able to download updates and packages from the internet)

8) In the Vitual Box Console screen for the Turnkey VM navigate to the Advanced menu>networking to assign a fixed IP for the server.

6) Login to the shell via web browser. https://:12320

Note you may have to allow a certificate security exception if you don't have a register CA SSL certificate [the default is a self signed certificate which will cause a certificate error in most modern browsers]

7) Install the debian java default jre

at the console prompt type:

apt-get install default-jre

press return

Java is required to import the sql dump file to restore the ATT database using mwdump.jar. The default Turnkey Linux install does not contain java.

8) login to the webmin interface https://:12321

requires the root password

Note you may have to allow a certificate security exception if you don't have a registered CA SSL certificate [the default is a self signed certificate which will cause a certificate error in most modern browsers]

9) Download the latest ATT database dump file from https://static.orain.org/common/dumps/allthetropes/

10) Decompress the zip file-- note that it is 1.6 Gb decompressed.

11) Open the file manager in the webmin interface and upload the dump.xml file from where you decompressed it to the /home folder of the VM

12) Download mwdumper.jar from http://wikitrust.googlecode.com/files/mwdumper.jar Note I use this version of mwdump.jar because it does not use a GUI... mwdumper-1.6.jar will not work with the Turnkey Linux VM

13) upload the mwdumper.jar file to /home

14) login to phpmyadmin https://:12322

Note: requires the MySQL root password

15) Select the mediawiki database in the lefthand pane

16) In the righthand pane click on the the SQL Tab

17) paste the following command into the "run SQL query box": DELETE FROM page; DELETE FROM text; DELETE FROM revision;

18) click the "GO" button

Note step 17 / 18 clears out any information from the mediawiki Database and readies it for the installation of the Dump.XML file

19) Change to the Console session window

20) At the console type:

java -jar /home/mwdumper.jar --format=sql:1.5 /home/dump.xml | mysql -u root -p mediawiki

press the enter key.

You will be prompted for the MySQL root password.

Step 20 is the actual import of the ATT dump into the media wiki

21) Once the dump upload completes [there are approximately 255,359 pages to import] at the console type:

php /usr/share/mediawiki/maintenance/update.php press the enter key.

This will step updates all of the links. This will take a while... 1163022 revisions were made

22) Edit /etc/mediawiki/LocalSettings.php and add the following lines:



require_once "$IP/extensions/Poem/Poem.php";
 * 1) The following are extensions for ATT

require_once "$IP/extensions/WikiEditor/WikiEditor.php";

$wgUseAjax = true; require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );

require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php"; $wgSyntaxHighlightDefaultLang = "c";



Note: maybe edited via the command line via nano [invoked as: nano /etc/mediawiki/LocalSettings.php] or edited via the webmin interface.

Poem is used in ATT for Quotations.

WikiEditor is what it says

CaegoryTree allows File trees

GeSHi is for syntax highlighting.



The following appear to be needed but I have not yet been able to get them working

Variables LUA and Scribunto

23) Download the Variables extension:

http://www.mediawiki.org/wiki/Special:ExtensionDistributor/Variables

24) Upload the .tar.gz file to the /home folder

25) runt the following command from the console

tar -xzf /home/Variables-REL1_23-86f6fa6.tar.gz -C /usr/share/mediawiki-extensions press enter

26) Edit /etc/mediawiki/LocalSettings.php and add the following line:

require_once "$IP/extensions/Variables/Variables.php"; be sure to save the file

27) Install LUA

28) Download the Scribunto extension:

http://www.mediawiki.org/wiki/Special:ExtensionDistributor/Scribunto

24) Upload the .tar.gz file to the /home folder

25) run the following command from the console

tar -xzf /home/Scribunto-REL1_23-18e738d.tar.gz -C /usr/share/mediawiki-extensions press enter

26) Edit /etc/mediawiki/LocalSettings.php and add the following line:

require_once "$IP/extensions/Variables/Variables.php"; be sure to save the file Scribunto-REL1_23-18e738d.tar.gz