Difference between revisions of "Wiki installation on Mac OS X"

From AardRock Wiki
Jump to navigation Jump to search
m (→‎To duplicate a Wiki instance: http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url)
Line 29: Line 29:
*Different database name.
*Different database name.
*Different database table prefix.
*Different database table prefix.
*Setting database grants correctly.
*Different site name.
*Different site name.
*Different accounts and passwords.
*Different accounts and passwords.
Line 41: Line 42:
#*Any modified skins;
#*Any modified skins;
#*All your uploaded images;
#*All your uploaded images;
  cd ~/Sites/wiki
  % cd ~/Sites/wiki
  cp LocalSettings.php LocalSettings.php-PebbleBeach
  % cp LocalSettings.php LocalSettings.php-PebbleBeach
  scp martien@aardrock.com:~/cheetah_wiki.sql .
  % scp martien@aardrock.com:~/cheetah_wiki.sql .
  scp martien@aardrock.com:/srv/www/htdocs/mediawiki/LocalSettings.php LocalSettings.php-AardRock
  % scp martien@aardrock.com:/srv/www/htdocs/mediawiki/LocalSettings.php LocalSettings.php-AardRock
  scp martien@aardrock.com:/srv/www/htdocs/mediawiki/extensions/'*' .
  % scp martien@aardrock.com:/srv/www/htdocs/mediawiki/extensions/'*' .
  scp martien@aardrock.com:/srv/www/htdocs/mediawiki/skins/Aardrock.php .
  % scp martien@aardrock.com:/srv/www/htdocs/mediawiki/skins/Aardrock.php .
  scp -r martien@aardrock.com:/srv/www/htdocs/mediawiki/skins/aardrock .
  % scp -r martien@aardrock.com:/srv/www/htdocs/mediawiki/skins/aardrock .
  scp -r martien@aardrock.com:/srv/www/htdocs/mediawiki/images .
  % scp -r martien@aardrock.com:/srv/www/htdocs/mediawiki/images .
  cd .. && mv wiki w
  % cd .. && mv wiki w
#In LocalSettings.php-AardRock:
#In LocalSettings.php-AardRock:
{|
{|
Line 81: Line 82:
  require_once("extensions/accesscontrolSettings.php");
  require_once("extensions/accesscontrolSettings.php");
  include("extensions/accesscontrol.php");
  include("extensions/accesscontrol.php");
#Set the database grants for the new database appropriately
% mysql -u root -p
Enter password: ********
mysql> grant SELECT, INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES on aap.* to 'wikiuser'@'localhost';
You can now easily switch between the two!
You can now easily switch between the two!



Revision as of 10:53, 27 December 2006

To install MediaWiki, simply follow the instructions from MediaWiki Installation for:

  • Mac OS X 10.4.8;
  • PHP 5.0.2-3;
  • MySQL 5.0.27;
  • MediaWiki 1.8.2.

To install Apache

Apache is standard installed on Mac OS X (10.0.4 has Apache 1.3.33 installed).

To install PHP

  1. Download PHP from Marc Liyanage and:
  2. Install according to instructions;
    • Installs in /usr/local/php5;
    • Creates appropriate symbolic link:
      • /etc/httpd/users/+entropy-php.conf -> /usr/local/php5/entropy-php.conf.

To install MySQL

  1. Download MySQL from official MySQL site;
  2. Follow instructions on Installing MySQL on Mac OS X;

To install MediaWiki

  1. Download MediaWiki from official site;
  2. Follow installation instructions and comprehensive MediaWiki Installation Guide

To duplicate a Wiki instance

  • Source: server running MediaWiki 1.6.2 on aardrock.com (running some Linux flavour).
  • Target: laptop running a clean install of MediaWiki 1.8.2 on flair.beach.aardrock.com:~Martien/Sites/wiki/ (my PowerBook G4 running Mac OS X 10.4.8).
  • Don't want to interfere with the existing Wiki database, so we'll set up a separate database using the same MySQL instance.
  • Different database name.
  • Different database table prefix.
  • Setting database grants correctly.
  • Different site name.
  • Different accounts and passwords.
  • Eliminating index.php from the URL.
  1. On the source machine , dump the database into an SQL file:
    • mysqldump -u root -p wikidb >~/cheetah_wiki.sql
  2. Switch to the target machine and securely copy all relevant files:
    • SQL dtabase dump;
    • Make a backup copy of your current LocalSettings.php;
    • LocalSettings.php, your MediaWiki identity; avoid overwriting your current version and use a different filename for LocalSettings.php;
    • Any extensions; verify that your extensions will also run on the target version of MediaWiki;
    • Any modified skins;
    • All your uploaded images;
% cd ~/Sites/wiki
% cp LocalSettings.php LocalSettings.php-PebbleBeach
% scp martien@aardrock.com:~/cheetah_wiki.sql .
% scp martien@aardrock.com:/srv/www/htdocs/mediawiki/LocalSettings.php LocalSettings.php-AardRock
% scp martien@aardrock.com:/srv/www/htdocs/mediawiki/extensions/'*' .
% scp martien@aardrock.com:/srv/www/htdocs/mediawiki/skins/Aardrock.php .
% scp -r martien@aardrock.com:/srv/www/htdocs/mediawiki/skins/aardrock .
% scp -r martien@aardrock.com:/srv/www/htdocs/mediawiki/images .
% cd .. && mv wiki w
  1. In LocalSettings.php-AardRock:
Change Variable: From: To:
$wgSitename "AardRock" "PebbleBeach"
$wgScriptPath "" "/w"
$wgArticlePath "$wgScriptPath/$1" "/wiki/$1"
$wgDBname "wikidb" "aap"
$wgDBprefix "cheetah_" "Flair"
$wgDBpassword "DB password on source system" "DB password on target system"
  1. Add the following lines to the end of LocalSettings.php-AardRock NOTA BENE accesscontrolSettings do not work in MediaWiki 1.8.2:
require_once("extensions/accesscontrolSettings.php");
include("extensions/accesscontrol.php");
  1. Set the database grants for the new database appropriately
% mysql -u root -p
Enter password: ********
mysql> grant SELECT, INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES on aap.* to 'wikiuser'@'localhost';

You can now easily switch between the two!

To switch to the Pebble Beach Wiki

cp LocalSettings.php-PebbleBeach LocalSettings.php

Test it and browse to http://flair.beach.aardrock.com/wiki/ to find that Wiki's content.

To switch to the AardRock Wiki

cp LocalSettings.php-AardRock LocalSettings.php

Test it and browse to http://flair.beach.aardrock.com/wiki/ to find that Wiki's content.