Wiki Envionment - Sandbox

Wiki Envionment - Sandbox

<p> United Nations – World Food Programme OMIA - Development and Business Relations Branch</p><p>WIKI ENVIRONMENT SANDBOX & WIKIS Technical documentation – Installation & setup guide</p><p>REFERENCE AUTHOR FILE VERSION DATE Djibril Diallo, 0cccdda2dec01f4bee0d9ace31d5dba A 14 April 2009 Alessandro Bianchi 7.doc</p><p>CONTACTS NAME JOB TITLE / POSITION PHONE E-MAIL Djibril Diallo, IT Software Engineer +221 77.644.01.88 [email protected] Alessandro Bianchi [email protected] D O C U M E N T H I S T O R Y</p><p>VER. DATE AUTHOR REVIEWER DESCRIPTION 1 14 April 2009 Djibril Diallo n/a Document Creation 2 21 April 2009 Alessandro Bianchi How To: Copy a Wiki on a local computer 3 23 April 2009 Alessandro Bianchi How To: Create Wikis environment on Production Server</p><p>A P P R O V A L S</p><p>Author Approver Project Manager Djibril Diallo n/a Stefania Corsi</p><p>Alessandro Bianchi</p><p>OMIA – Development and Business Relation Branch 2 Wfp Wiki – Sandbox environment – Wikis Infrastructure TABLE OF CONTENTS</p><p>Introduction...... 4 1. Sandbox environment...... 5 1.1. Operating system and installed software...... 5 1.2. WfpWiki core code...... 6 1.3. Apache: virtual directory...... 7 1.4. MySql databases...... 8 2. Setting up new wiki...... 9 2.1. MySql database creation...... 9 2.2. Apache configuration...... 10 2.3. MediaWiki settings...... 10 3. How To: Copy a Media Wiki from the SandBox to Another Server...... 14 4. How To: Create the Wikis Environment on the Production Server...... 16 5. How To: Add a New Wiki to the Production Wikis Environment (the travel manual).....23 6. How To: Move the M & E Wiki to the new Wikis Infrastructure...... 26 7. How To: Move the Glossary Wiki to the new Wikis Infrastructure...... 28 8. How To: Backup a Wiki Database...... 31 9. How To: Create a dynamic backup procedure – TO DO...... 33</p><p>This document contains 38 pages.</p><p>OMIA – Development and Business Relation Branch 3 Wfp Wiki – Sandbox environment – Wikis Infrastructure Introduction</p><p>The purpose of the present document is to make a technical presentation of the WfpWiki’s Platform on the sandbox, and also the give clear guidelines and step-by-step on how to configure a new WfpWiki using already defined standards.</p><p>As decided during requirements and business analysis process, all future WfpWikis will use: </p><p> Same core code: php scripts  Differents base configuration file (settings file): LocalSettings.php  Different MySql databases on the same server  Virtual directory configuration: prefixed on http://wiki.wfp.org/ web server</p><p>This is known as the project to have a consolidated wiki environment platform.</p><p>We currently have 3 WfpWikis deployed:</p><p> PGM Wiki  Glossary Wiki  M&E Wiki</p><p>The PGM is configured as a virtual server and is not part of that consolidated envrionment.</p><p>The Glossary Wiki and the M&E Wiki are already consolidated on that environment; the same should be for all future WfpWikis.</p><p>The core code of all wikis is configured with one extension: the FCKeditor.</p><p>OMIA – Development and Business Relation Branch 4 Wfp Wiki – Sandbox environment – Wikis Infrastructure 1. Sandbox environment 1.1. Operating system and installed software</p><p>The sandbox is running on a PC with the following hardware configuration:</p><p> Hardware: o CPU: Pentium 4 @ 3.00 GHz o RAM: 1024 Mbits  OS o Windows XP – Professional Edition (32 Bits) o Login info: hquser/test (<user>/<password>)  Network settings o Host Name: M51BuelincVM o IP Address: 10.11.33.246 o Subnet Mask: 255.255.248.0 o Default Gateway: 10.11.32.14 o DNS Servers 1: 10.11.32.7 o DNS Servers 2: 10.11.32.8</p><p>The main software installed on it is the WAMP Server that is a Windows package coming with Apache, MySql and Php.</p><p> WAMP Server o Version: 2.0 o Install directory: C:\wamp\  Apache o Version: Apache/2.2.8 (Win32) o Configuration files: C:\wamp\bin\apache\apache2.2.8\conf\httpd.conf ; C:\wamp\alias\*.conf ; C:\wamp\vhosts\*.conf  MySql o Version: 5.0.51b-community-nt o Configuration file: C:\wamp\bin\mysql\mysql5.0.51b\my.ini o Data directory: C:\wamp\bin\mysql\mysql5.0.51b\data  Php o Version: PHP/5.2.6 o Configuration files: C:\wamp\bin\apache\apache2.2.8\bin\php.ini o Extension directory: C:/wamp/bin/php/php5.2.6/ext/ </p><p>OMIA – Development and Business Relation Branch 5 Wfp Wiki – Sandbox environment – Wikis Infrastructure 1.2. WfpWiki core code</p><p>The sandbox is using MediaWiki version 1.13.3 as common code for WfpWikis. It has the extension FCKeditor installed for WYSIWYG editing purpose.</p><p>FCKeditor: Version fckeditor/mw-extension $Rev$ 2008</p><p>The core code reside in the following folder: C:\djib\wikis\ </p><p>Other minor tweaks have been done:</p><p> Disable the default create account ability  Readjust some group access rights for security reason</p><p>Code listing: Default permissions on core code for WfpWikis</p><p>$wgGroupPermissions['*']['read'] = true; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createaccount'] = false;</p><p>The Glossary Wiki and the M&E Wiki are already using that common code, each of them with its own configuration file, located in C:\djib\ :</p><p> Glossary Wiki  LocalSettings_GWiki.php  M&E Wiki  LocalSettings_ME.php</p><p>A MediaWiki Configuration file (LocalSettings.php) is used as a wrapper to know which specifc configuration file to load according to the virtual directory requested.</p><p>The code of that settings file (LocalSettings.php) acting as a wrapper is the following:</p><p>OMIA – Development and Business Relation Branch 6 Wfp Wiki – Sandbox environment – Wikis Infrastructure Code listing: Settings for LocalSettings.php as a wrapper</p><p><?php</p><p>// The requesting url $callingURL = strtolower($_SERVER['REQUEST_URI']); </p><p>/////////////////////////////////////////////////////////////// // // All WfpWiki configurations will go below this block // ///////////////////////////////////////////////////////////////</p><p>// M&E Toolkit Wiki if ( strpos( $callingURL, 'm_and_e') ) { require_once('LocalSettings_ME.php'); }</p><p>// Glossary Wiki else if ( strpos( $callingURL, 'glossarywiki') ) { require_once('LocalSettings_GWiki.php' ); }</p><p>/////////////////////////////////////////////////////////////// // // All WfpWiki configurations will go above this block // ///////////////////////////////////////////////////////////////</p><p>$wgGroupPermissions['*']['read'] = true; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createaccount'] = false;</p><p> else { header( "Location: http://10.11.33.246/wiki/" ); } ?></p><p>NB:</p><p>Make sure that the name defined in specific configuration files (LocalSettings_GWiki.php, LocalSettings_ME.php, etc.), for the $wgSitename variable is the SAME as the one tested in the LocalSettings.php file against the variable $callingURL.</p><p>1.3. Apache: virtual directory</p><p>WfpWikis are configured as virtual directories and are self-explanatory:</p><p>OMIA – Development and Business Relation Branch 7 Wfp Wiki – Sandbox environment – Wikis Infrastructure Code listing: Example of virtual directory configuration for M&E Wiki (M_and_E.conf) </p><p># file C:\wamp\alias\M_and_E.conf</p><p>Alias /M_and_E "C:/djib/wikis/" </p><p><Directory "C:/djib/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory> </p><p>NB:</p><p>Make sure that the name of the virtual directory defined in the alias configuration file, located in C:\wamp\alias\, is the same as the ones defined in:</p><p> o LocalSettings_GWiki.php: Variable name $wgSitename o LocalSettings.php: Variable name $callingURL</p><p>1.4. MySql databases</p><p>Each WfpWiki is using its own database which is accessed with the parameters defined the specific setting files (i.e. LocalSettings_GWiki.php).</p><p>Code listing: Database configuration in specific setting file (LocalSettings_GWiki.php)</p><p># File location: C:\djib\wikis\LocalSettings_GWiki.php </p><p>. . . ## Database settings $wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = "glossarywiki"; $wgDBuser = "glossarywiki"; $wgDBpassword = "glossarywiki"; . . .</p><p>The database is created and initialized while setting up the new wiki. A detailed procedure is covered in the next chapter of this document.</p><p>OMIA – Development and Business Relation Branch 8 Wfp Wiki – Sandbox environment – Wikis Infrastructure 2. Setting up new wiki</p><p>This step-by-step will be done with the following assumption: the WfpWiki to be installed is called OneWiki.</p><p>2.1. MySql database creation</p><p>To create the database for the new WfpWiki named use the script template WfpWiki_DB.sql.</p><p>Put the right values for:</p><p> o the BD name: OneWiki, o the user name: OneWiki, o the password: OneWikiPasswd</p><p>Code listing: Script for creating empty MySql DB (WfpWiki_DB.sql) </p><p>-- File location: C:\djib\setup_OneWiki\OneWiki_DB.sql</p><p>-- DROP DATABASE IF EXISTS `OneWiki` ; CREATE USER 'OneWiki'@'localhost' IDENTIFIED BY 'OneWikiPasswd'; GRANT USAGE ON * . * TO 'OneWiki'@'localhost' IDENTIFIED BY 'OneWikiPasswd' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; CREATE DATABASE IF NOT EXISTS `OneWiki` ; GRANT ALL PRIVILEGES ON `OneWiki` . * TO 'OneWiki'@'localhost';</p><p>To use the script, log on the sandbox server, then:</p><p>1. Launch a command prompt console 2. Run the following command:</p><p>Code listing: Creation of the OneWiki MySql database</p><p>C:\> mysql -u root < OneWiki_DB.sql </p><p>OMIA – Development and Business Relation Branch 9 Wfp Wiki – Sandbox environment – Wikis Infrastructure 2.2. Apache configuration</p><p>A new virtual directory on Apache Web server should be created to “host” the new WfpWiki.</p><p>To do so, create a flat file (plain-text) containing the Apache configuration for the new WfpWiki ‘OneWiki’. See the below code listing.</p><p>Code listing: Apache configuration for OneWiki</p><p># file C:\wamp\alias\OneWiki.conf</p><p>Alias /OneWiki "C:/djib/wikis/" </p><p><Directory "C:/djib/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory></p><p>2.3. MediaWiki settings</p><p>The configuration at the MediaWiki software level is done thru the creation and setup of a new specific settings file: LocalSettings_OneWiki.php.</p><p>To do so, proceed with the following:</p><p>1. Add the WfpWiki ‘OneWiki’ settings in the wrapper settings file: LocalSettings.php. </p><p>Add it after the last configured WfpWiki, i.e.:</p><p>// Glossary Wiki else if ( strpos( $callingURL, 'glossarywiki') ) { require_once('LocalSettings_GWiki.php' ); }</p><p>Add it before:</p><p>OMIA – Development and Business Relation Branch 10 Wfp Wiki – Sandbox environment – Wikis Infrastructure /////////////////////////////////////////////////////////////// // // All WfpWiki configurations will go above this block // ///////////////////////////////////////////////////////////////</p><p>The code listing below shows the lines of code that should be added.</p><p>Code listing: Lines of code to add OneWiki settings in the wrapper configuration file</p><p>// OneWiki Wiki else if ( strpos( $callingURL, 'onewiki') ) { require_once('LocalSettings_OneWiki.php' ); }</p><p>2. Launch the script MoveLS.bat to move all existing specific setting files for WfpWikis and also the wrapper settings file.</p><p>Code listing: Content of MoveLS.bat</p><p>@REM File location: C:\djib\wikis\MoveLS.bat</p><p> move /y LocalSettings*.php LocalSettings\</p><p>3. Restart Apache Web Server by lauching the script ApacheRestart.bat</p><p>Code listing: Content of ApacheRestart.bat </p><p>@REM File location: C:\djib\ApacheRestart.bat @echo off </p><p> net stop wampapache net start wampapache</p><p>4. Launch your favorite web browser and navigate to: http://localhost/OneWiki</p><p>OMIA – Development and Business Relation Branch 11 Wfp Wiki – Sandbox environment – Wikis Infrastructure 5. Click on the link “set up the wiki” and proceed with the OneWiki initialization by filling the form</p><p>OMIA – Development and Business Relation Branch 12 Wfp Wiki – Sandbox environment – Wikis Infrastructure Note:</p><p>The password for the WikiSysop user on OneWiki is: ‘OneWiki’</p><p>6. Once done, you’ll see a message saying:</p><p>Installation successful! Move the config/LocalSettings.php file to the parent directory, then follow this link to your wiki.</p><p>You should change file permissions for LocalSettings.php as required to prevent other users on the server reading passwords and altering configuration data.</p><p>7. Copy the file LocalSettings.php from config folder to the parent folder as LocalSettings_OneWiki.php 8. Launch the Script BringLS.bat </p><p>Code listing: Content of BringLS.bat</p><p>@REM File location: C:\djib\wikis\BringLS.bat</p><p> copy /y LocalSettings\LocalSettings*.php .</p><p>9. You can now test your new WfpWiki by launching your web browser and navigating to http://localhost/OneWiki/ 10. If you can see your new wiki... Congratulations!!! Otherwise, please re-check your configurations files. </p><p>OMIA – Development and Business Relation Branch 13 Wfp Wiki – Sandbox environment – Wikis Infrastructure 3. How To: Copy a Media Wiki from the SandBox to Another Server</p><p>In this How To we will see how to copy (code / data) a Wiki from a server (in this case from the sandbox) to another (in this case on a local machine). We assume that the local machine has WAMP server already installed.</p><p>11. Copy the folder called wikis on the local machine (in this example: c:\MyWampfolder\wikis).</p><p>This folder will contain all the media wiki.</p><p>12. Create a new APACHE alias for the wikis folder. </p><p>File Name: wikis.conf</p><p>Alias /wikis "C:/MyWampfolder/wikis/" </p><p><Directory "C:/MyWampfolder/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory></p><p>13. Restart Apache. </p><p>How To restart Apache</p><p>Manually restart Windows Services related to WAMP</p><p> or</p><p> net stop wampapache net start wampapache</p><p>14. Prepare MySQL with a new DB.</p><p>We are going to create a new database first, then we will import the production one.</p><p>STEP 1: create the following file</p><p>File Name: TwoWiki_DB.sql</p><p>-- File location: C:\djib\setup_TwoWiki\TwoWiki_DB.sql -- DROP DATABASE IF EXISTS `TwoWiki` ; CREATE USER 'TwoWiki'@'localhost' IDENTIFIED BY 'TwoWikiPasswd';</p><p>OMIA – Development and Business Relation Branch 14 Wfp Wiki – Sandbox environment – Wikis Infrastructure GRANT USAGE ON * . * TO 'TwoWiki'@'localhost' IDENTIFIED BY 'TwoWikiPasswd' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; CREATE DATABASE IF NOT EXISTS `TwoWiki` ;</p><p>GRANT ALL PRIVILEGES ON `TwoWiki` . * TO 'TwoWiki'@'localhost';</p><p>STEP 2: Execute it</p><p>Code listing: Creation of the OneWiki MySql database</p><p>C:\> mysql -u root < TwoWiki_DB.sql </p><p>Check if the DB has been properly created.</p><p>COMPLETEEEEEEEEEEEEEE</p><p>OMIA – Development and Business Relation Branch 15 Wfp Wiki – Sandbox environment – Wikis Infrastructure 4. How To: Create the Wikis Environment on the Production Server</p><p>In this How To we will see how to create the Wikis environment on the production server.</p><p>15. Copy the wikis folder from the sandbox to the production (es: c>\wikis) 16. Create the database.</p><p>To do that, create the following file first:</p><p>File Name: WikiTraining_DB.sql </p><p>-- File location: C:\wikis\wikis\utilities\WikiTraining.sql</p><p>-- DROP DATABASE IF EXISTS `wikitraining` ;</p><p>CREATE USER 'wikitraining'@'localhost' IDENTIFIED BY 'wikitrainingPasswd'; GRANT USAGE ON * . * TO 'wikitraining'@'localhost' IDENTIFIED BY 'wikitrainingPasswd' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; CREATE DATABASE IF NOT EXISTS `wikitraining` ; GRANT ALL PRIVILEGES ON `wikitraining` . * TO 'wikitraining'@'localhost';</p><p>Then, launch the following command :</p><p>Code listing: Creation of the OneWiki MySql database</p><p>C:\> mysql -u root < WikiTraining_DB.sql </p><p>Then, check if the database was properly created :</p><p>Command List:</p><p> mysql u -root</p><p>> show databases;</p><p>17. Create the Apache alias.</p><p>To do that, create the following cong file</p><p>OMIA – Development and Business Relation Branch 16 Wfp Wiki – Sandbox environment – Wikis Infrastructure File Name: c:\wamp\alias\WikiTraining.conf </p><p># file C:\wamp\alias\WikiTraining.conf</p><p>Alias /WikiTraining "C:/wikis/" </p><p><Directory "C:/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory></p><p>18. Restart Apache</p><p>To do that, restart the proper services.</p><p>19. Set up the new Wiki.</p><p>Step 1:</p><p>Temporary move all the LocalSettings.php to a temporary folder.</p><p>Step 2:</p><p>Move all the config/LocalSettings.php to a temporary folder</p><p>Step 3:</p><p>Go to: http://10.11.40.174/WikiTraining and fill up the form.</p><p>Forms: </p><p>Super Admin Username: WikiSyssop Password: theguru</p><p>DB Name: wikitraining DB User: wikitraining DB Password: wikitrainingPasswd</p><p> and save. </p><p>Step 4:</p><p>OMIA – Development and Business Relation Branch 17 Wfp Wiki – Sandbox environment – Wikis Infrastructure Copy the file config/LocalSettings.php to the root of wikis</p><p>20. Now, configure the wikis for multiple wikis with multiple database and one code.</p><p>Step 1:</p><p>Change the name of LocalSettings.php to LocalSettings_WikiTraining.php</p><p>Step 2:</p><p>Create a file called LocalSettings.php</p><p><?php</p><p>// the requesting url</p><p>$callingURL = strtolower($_SERVER['REQUEST_URI']); </p><p>// echo "CallingURL: ". $callingURL . ".";</p><p>// exit();</p><p>///////////////////////////////////////////////////////////////</p><p>//</p><p>// All WfpWiki configurations will go below this block</p><p>//</p><p>///////////////////////////////////////////////////////////////</p><p>// M&E Toolkit Wiki if ( strpos( $callingURL, 'm_and_e') ) {</p><p> require_once('LocalSettings_ME.php');</p><p>}</p><p>// Glossary Wiki else if ( strpos( $callingURL, 'glossarywiki') ) {</p><p> require_once('LocalSettings_GWiki.php' );</p><p>}</p><p>OMIA – Development and Business Relation Branch 18 Wfp Wiki – Sandbox environment – Wikis Infrastructure // OneWiki Wiki else if ( strpos( $callingURL, 'onewiki') ) {</p><p> require_once('LocalSettings_OneWiki.php' );</p><p>}</p><p>// TwoWiki Wiki else if ( strpos( $callingURL, 'twowiki') ) {</p><p> require_once('LocalSettings_TwoWiki.php' );</p><p>} else if ( strpos( $callingURL, 'wikitraining') ) {</p><p> require_once('LocalSettings_WikiTraining.php' );</p><p>}</p><p>///////////////////////////////////////////////////////////////</p><p>//</p><p>// All WfpWiki configurations will go above this block</p><p>//</p><p>/////////////////////////////////////////////////////////////// else {</p><p> header( "Location: http://10.11.40.174/wfpwiki/" );</p><p>}</p><p>?></p><p>21. Now you can go to the Wiki http://10.11.40.174/WikiTraining or http://wiki.wfp.org/WikiTraining</p><p>OMIA – Development and Business Relation Branch 19 Wfp Wiki – Sandbox environment – Wikis Infrastructure 22. Now add the proper configurations</p><p>FCK Editor :</p><p>By default, the FCK editor is not installed.</p><p>Open the LocalSettings.php and add the require_one code at the bottom of the if statements.</p><p> else {</p><p> header( "Location: http://10.11.40.174/wfpwiki/" );</p><p>} require_once( 'extensions/FCKeditor/FCKeditor.php' );</p><p>OMIA – Development and Business Relation Branch 20 Wfp Wiki – Sandbox environment – Wikis Infrastructure Add the following code after the FCK configuration :</p><p> require_once( 'extensions/FCKeditor/FCKeditor.php' );</p><p>$wgDisableAnonTalk = true;</p><p>OMIA – Development and Business Relation Branch 21 Wfp Wiki – Sandbox environment – Wikis Infrastructure $wgShowIPinHeader = false;</p><p>$wgWhitelistEdit = true;</p><p>$wgLogo = 'http://wiki.wfp.org/_img/logo.png';</p><p>$wgGroupPermissions['*']['read'] = true;</p><p>$wgGroupPermissions['*']['edit'] = false;</p><p>$wgGroupPermissions['*']['createaccount'] = false;</p><p>23. Last Step – Do the login</p><p>Now, try to go to : http://wiki.wfp.org/WikiTraining</p><p>Do the login using :</p><p>Username : WikiSysop</p><p>Password : theguru</p><p>Done</p><p>You have completed the quest !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p><p>OMIA – Development and Business Relation Branch 22 Wfp Wiki – Sandbox environment – Wikis Infrastructure 5. How To: Add a New Wiki to the Production Wikis Environment (the travel manual)</p><p>In this How To we will see how to add a new MediaWiki called travelmanual.</p><p>24. Create the database.</p><p>To do that, create the following file first:</p><p>File Name: travelmanual_DB.sql </p><p>-- File location: C:\wikis\wikis\utilities\travelmanual.sql</p><p>-- DROP DATABASE IF EXISTS `travelmanual` ;</p><p>CREATE USER 'travelmanual'@'localhost' IDENTIFIED BY 'travelmanualPasswd'; GRANT USAGE ON * . * TO 'travelmanual'@'localhost' IDENTIFIED BY 'travelmanualPasswd' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; CREATE DATABASE IF NOT EXISTS `travelmanual` ; GRANT ALL PRIVILEGES ON `travelmanual` . * TO 'travelmanual'@'localhost';</p><p>Then, launch the following command :</p><p>Code listing: Creation of the OneWiki MySql database</p><p>C:\> mysql -u root < travelmanual.sql </p><p>Then, check if the database was properly created :</p><p>Command List:</p><p> mysql u -root</p><p>> show databases;</p><p>25. Create the Apache alias.</p><p>To do that, create the following cong file</p><p>OMIA – Development and Business Relation Branch 23 Wfp Wiki – Sandbox environment – Wikis Infrastructure File Name: c:\wamp\alias\travelmanual.conf </p><p># file C:\wamp\alias\travelmanual.conf</p><p>Alias /travelmanual "C:/wikis/wikis/" </p><p><Directory "C:/wikis/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory></p><p>26. Restart Apache</p><p>To do that, restart the proper services.</p><p>27. Set up the new Wiki.</p><p>Step 1:</p><p>Temporary move all the LocalSettings.php to a temporary folder.</p><p>Step 2:</p><p>Move all the config/LocalSettings.php to a temporary folder</p><p>Step 3:</p><p>Go to: http://10.11.40.174/travelmanual and fill up the form.</p><p>Forms: </p><p>Super Admin Username: WikiSyssop Password: theguru</p><p>DB Name: travelmanual DB User: travelmanual DB Password: travelmanualPasswd</p><p> and save. </p><p>OMIA – Development and Business Relation Branch 24 Wfp Wiki – Sandbox environment – Wikis Infrastructure 28. Move the localconfig.</p><p>Move the config/LocalSettings.php to the root </p><p>Rename it to LocalSettings_travelmanual.php</p><p>29. Restore the LocalSettings.php and add the new handler</p><p> else if ( strpos( $callingURL, 'travelmanual') ) {</p><p> require_once('LocalSettings_travelmanual.php' );</p><p>}</p><p>30. DONE !!!!!!!!!</p><p>OMIA – Development and Business Relation Branch 25 Wfp Wiki – Sandbox environment – Wikis Infrastructure 6. How To: Move the M & E Wiki to the new Wikis Infrastructure</p><p>31. Get information about M&E Wiki database.</p><p>Command List:</p><p> mysql u -root</p><p>> show databases;</p><p> mysql> show databases; +------+ | Database | +------+ | information_schema | | glossarywiki | | mewiki | | mysql | | pgmwikidb | | travelmanual | | wikitraining | +------+ 7 rows in set (0.02 sec)</p><p>The database name is: mewiki</p><p> mysql -u root -p</p><p> use mewiki;</p><p> show tables;</p><p>+------+ | Tables_in_mewiki | +------+ | archive | | category | | categorylinks | | externallinks | | filearchive | | hitcounter | | image | | |</p><p>OK! The database exists. It contains tables.</p><p>Now we need info about username and password.</p><p>OMIA – Development and Business Relation Branch 26 Wfp Wiki – Sandbox environment – Wikis Infrastructure To do that, open the current LocalSettings.php in the old infrastructure.</p><p>In this file, get the Database configuration:</p><p>## Database settings $wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = "mewiki"; $wgDBuser = "mewiki"; $wgDBpassword = "m3w1KiBl4h";</p><p>32. Create the new Apache alias.</p><p>File Name: c:\wamp\alias\M_and_E.conf </p><p># file C:\wamp\alias\M_and_E.conf</p><p>Alias /M_and_E "C:/wikis/wikis/" </p><p><Directory "C:/wikis/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory></p><p>33. Restart Apache</p><p>To do that, restart the proper services</p><p>34. Create the LocalSettings_ME.php</p><p>Use one already created.</p><p>Replace the database configuration with:</p><p>$wgSitename = "M_and_E";</p><p>## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. ## For more information on customizing the URLs please see: ## http://www.mediawiki.org/wiki/Manual:Short_URL $wgScriptPath = "/M_and_E";</p><p>OMIA – Development and Business Relation Branch 27 Wfp Wiki – Sandbox environment – Wikis Infrastructure ## Database settings $wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = "mewiki"; $wgDBuser = "mewiki"; $wgDBpassword = "m3w1KiBl4h";</p><p>35. Update the LocalSettings.php</p><p> if ( strpos( $callingURL, 'm_and_e') ) { require_once('LocalSettings_ME.php'); }</p><p>7. How To: Move the Glossary Wiki to the new Wikis Infrastructure</p><p>1. Get information about M&E Wiki database.</p><p>Command List:</p><p> mysql u -root</p><p>> show databases;</p><p> mysql> show databases; +------+ | Database | +------+ | information_schema | | glossarywiki | | mewiki | | mysql | | pgmwikidb | | travelmanual | | wikitraining | +------+ 7 rows in set (0.02 sec)</p><p>The database name is: glossarywiki</p><p>OMIA – Development and Business Relation Branch 28 Wfp Wiki – Sandbox environment – Wikis Infrastructure mysql -u root -p</p><p> use glossarywiki;</p><p> show tables;</p><p>+------+ | Tables_in_mewiki | +------+ | archive | | category | | categorylinks | | externallinks | | filearchive | | hitcounter | | image | | |</p><p>OK! The database exists. It contains tables.</p><p>Now we need info about username and password.</p><p>To do that, open the current LocalSettings.php in the old infrastructure.</p><p>In this file, get the Database configuration:</p><p>## Database settings $wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = "glossarywiki"; $wgDBuser = "glossarywiki"; $wgDBpassword = "bl4bl4wiK1";</p><p>36. Create the new Apache alias.</p><p>File Name: c:\wamp\alias\GlossaryWiki.conf </p><p># file C:\wamp\alias\GlossaryWiki.conf</p><p>Alias /GlossaryWiki "C:/wikis/wikis/" </p><p><Directory "C:/wikis/wikis/"> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Allow,Deny Allow from all </Directory></p><p>37. Restart Apache</p><p>To do that, restart the proper services</p><p>OMIA – Development and Business Relation Branch 29 Wfp Wiki – Sandbox environment – Wikis Infrastructure $wgSitename = "GlossaryWiki";</p><p>## The URL base path to the directory containing the wiki; ## defaults for all runtime URL paths are based off of this. ## For more information on customizing the URLs please see: ## http://www.mediawiki.org/wiki/Manual:Short_URL $wgScriptPath = "/GlossaryWiki";</p><p>## Database settings $wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = "glossarywiki"; $wgDBuser = "glossarywiki"; $wgDBpassword = "bl4bl4wiK1";</p><p>38. Update the LocalSettings.php</p><p> if ( strpos( $callingURL, 'm_and_e') ) { require_once('LocalSettings_ME.php'); }</p><p>OMIA – Development and Business Relation Branch 30 Wfp Wiki – Sandbox environment – Wikis Infrastructure 8. How To: Backup a Wiki Database</p><p>Example: Backup the Travel Manual</p><p>STEP 1: Use remote desktop and go to 10.11.40.174</p><p>Username: PGMAdmin Password: PgmW1ki</p><p>STEP 2: Go to the folder C:\wikis\backup\travelmanual</p><p>Use the command line.</p><p>> mysql u –root</p><p>> show databases;</p><p>> use travelmanual; mysqldump -u root -p travelmanual > travelmanual_yyyymmdd_hhmm.sql</p><p>OMIA – Development and Business Relation Branch 31 Wfp Wiki – Sandbox environment – Wikis Infrastructure OMIA – Development and Business Relation Branch 32 Wfp Wiki – Sandbox environment – Wikis Infrastructure 9. How To: Create a dynamic backup procedure – TO DO</p><p>TO DO </p><p>OMIA – Development and Business Relation Branch 33 Wfp Wiki – Sandbox environment – Wikis Infrastructure @echo off</p><p> rem *************************************************************************** *********** set servername=10.11.40.174 set database=travelmanual</p><p> set mysqldir="C:\wamp\bin\mysql\mysql5.0.51b\bin" set utils=C:\Data\utils\bin set workdir=data</p><p>OMIA – Development and Business Relation Branch 34 Wfp Wiki – Sandbox environment – Wikis Infrastructure @REM Mail Configuration</p><p>SET mailsmtp="10.11.40.164"</p><p>SET mail=%utils%\blat.exe rem SET mailto="[email protected], [email protected]"</p><p>SET mailto="[email protected]"</p><p>SET mailfrom="MySQL Backup Service<[email protected]>" rem SET mailsubject="MySQL Backup of %database% on 10.11.40.174"</p><p>SET mailsubject="MySQL Backup of Media Wikis on 10.11.40.174 - Date: %date% - Time: %time%"</p><p> rem *************************************************************************** ***********</p><p>@REM Date Configuration for /f "tokens=1-4 delims=/ " %%a in ('date/t') do (</p><p> set dw=%%a</p><p> set mm=%%b</p><p> set dd=%%c</p><p> set yyyy=%%d</p><p>)</p><p> for /f "tokens=1-4 delims=/ " %%a in ("%date%") do set currentdate=%%d_%%c_%%b</p><p>OMIA – Development and Business Relation Branch 35 Wfp Wiki – Sandbox environment – Wikis Infrastructure for /f "tokens=1-4 delims=:." %%d in ("%time%") do set currenttime=%%d_%%e_%%f_%%g</p><p> rem *************************************************************************** **********</p><p> echo Backup: %database% echo Current Date: %yyyy%/%mm%/%dd% echo Current Time: %currenttime% </p><p> set filename=%servername%.%database%.%currentdate%_%currenttime%.sql</p><p> echo %filename%</p><p> mysqldump -u root travelmanual > %workdir%/%filename%</p><p> rem *************************************************************************** ********** rem *** Zip the file rem *************************************************************************** **********</p><p>OMIA – Development and Business Relation Branch 36 Wfp Wiki – Sandbox environment – Wikis Infrastructure @REM Zip up database</p><p>%utils%\gzip.exe -f %workdir%\%filename%</p><p>ECHO .. Backup compression ...... OK!</p><p> rem *************************************************************************** ***********</p><p>SET message=%date% - %time%: Backup of [%database%] has been completed succesfully!!!</p><p>%mail% -q -server %mailsmtp% -f %mailfrom% -to %mailto% -subject %mailsubject% -body "%message%"</p><p> rem *************************************************************************** ************************************************* rem Backup a database and send email rem Parameters: rem DatabaseName rem Examples: rem call:myWikisBackup DatabaseName rem *************************************************************************** *************************************************</p><p>OMIA – Development and Business Relation Branch 37 Wfp Wiki – Sandbox environment – Wikis Infrastructure :myWikisBackup </p><p>SET DBname =%~1 </p><p> echo %DBname%</p><p> rem set bk_filename=%servername%.%~1.%currentdate%_%currenttime%.sql</p><p> rem echo. here the myDosFunc function is executing a group of commands</p><p> rem echo. it could do %~1 of things %~2. goto:eof</p><p>OMIA – Development and Business Relation Branch 38 Wfp Wiki – Sandbox environment – Wikis Infrastructure</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    38 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us