Semantic MediaWiki under Debian: Difference between revisions

From SaruWiki
Jump to navigation Jump to search
(link to defaults)
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
1) Use Aptitude to install package ''mediawiki-semediawiki'' (under Lenny that's version 1.2-1)
1) Use Aptitude to install package ''mediawiki-semediawiki'' (under Lenny that's version 1.2-1)


2) Edit the file ''/etc/mediawiki-extensions/extensions-available/SemanticMediaWiki.php''. All you need to do is change the string for ''enableSemantics'' from ''localhost'' to the hostname of your server:
2) Adjust your namespaces - since we haven't modified the MediaWiki namespaces relative to the original Debian installation, we don't need that.
 
3) Edit the file ''/etc/mediawiki-extensions/extensions-available/SemanticMediaWiki.php''. All you need to do is change the string for ''enableSemantics'' from ''localhost'' to the hostname of your server:
  <?php
  <?php
  include_once('extensions/SemanticMediaWiki/includes/SMW_Settings.php');
  include_once('extensions/SemanticMediaWiki/includes/SMW_Settings.php');
Line 11: Line 13:
Actually, the string for ''enableSemantics'' is an identifier, needed to identify any exported data. The [http://semantic-mediawiki.org/wiki/Help:Installation Semantic MediaWiki website] suggests using the server's host name for this purpose (if you have multiple hostnames, just pick any one of them).
Actually, the string for ''enableSemantics'' is an identifier, needed to identify any exported data. The [http://semantic-mediawiki.org/wiki/Help:Installation Semantic MediaWiki website] suggests using the server's host name for this purpose (if you have multiple hostnames, just pick any one of them).


3) We now run the maintenance script that sets up the MySQL database. This is a two-step affair:
4) Enable the SMW extension, by creating a link to it under ''/etc/mediawiki-extensions/extensions-enabled'':
- first set the MW_INSTALL_PATH environment variable to the root of the MediaWiki installation. This path is where ''LocalSettings.php'' and ''index.php'' are located; most likely it's ''/usr/share/mediawiki''.
cd /etc/mediawiki-extensions/extensions-enabled/
ln -s ../extensions-available/SemanticMediaWiki.php
By the way, this should also work with the MediaWiki extension enabler command:
  mwenext SemanticMediaWiki.php


5) We now run the maintenance script that creates the necessary tables in your MySQL MediaWiki database. This is a two-step affair:<br>
- first set the MW_INSTALL_PATH environment variable to the root of the MediaWiki installation. This path is where ''LocalSettings.php'' and ''index.php'' are located; most likely it's ''/usr/share/mediawiki''.<br>
- then go to the directory where the SMW maintenance scripts are located, and execute ''SMW_setup.php''.<br>
The sequence will thus look something like this:
  MW_INSTALL_PATH=/usr/share/mediawiki
  MW_INSTALL_PATH=/usr/share/mediawiki
  export $MW_INSTALL_PATH
  export MW_INSTALL_PATH
  cd /usr/share/mediawiki-semediawiki/maintenance
  cd /usr/share/mediawiki-semediawiki/maintenance
   
  php SMW_setup.php
The php-script should report setting up some nine tables, named ''smw_ids'', ''smw_redi2'' et cetera. These are the extra MySQL tables that SMW needs.
 
6) Next, log into your MediaWiki with an account with administrative rights. If you now visit your ''Special pages'', you'll find taht under the section ''Restricted special pages'' there is now an entry titled ''Admin functions for Semantic MediaWiki''. Open it, and find two sections:
* '''Preparing database for Semantic MediaWiki'''<br>Here you'll have to press the button labeled ''Initialise or upgrade tables''; this will initialise the newly created tables. A dull page should appear, reporting actions for each of the nine new tables, and ending with the status message ''The storage engine was set up successfully.''
* '''Announce your wiki'''<br>Clicking this button is optional; what it will do is post the URL of your wiki on the [http://semantic-mediawiki.org/wiki/Special:SMWRegistry SMW Registry page] over on the SMW site.


4) Adjust your namespaces - since we haven't modified the MediaWiki namespaces relative to the original Debian installation, we don't need that.
Note, that you might want to change some [[Semantic MediaWiki default settings]].


4) Setup the SMW tables in the MySQL database. To this end, we simply go to
That's it! You can now start [http://semantic-mediawiki.org/wiki/Help:User_manual using SMW].

Latest revision as of 08:04, 21 June 2010

Installing Semantic MediaWiki (SMW) under Debian

Installation consists of these simple steps:

1) Use Aptitude to install package mediawiki-semediawiki (under Lenny that's version 1.2-1)

2) Adjust your namespaces - since we haven't modified the MediaWiki namespaces relative to the original Debian installation, we don't need that.

3) Edit the file /etc/mediawiki-extensions/extensions-available/SemanticMediaWiki.php. All you need to do is change the string for enableSemantics from localhost to the hostname of your server:

<?php
include_once('extensions/SemanticMediaWiki/includes/SMW_Settings.php');
enableSemantics('dworkin.saruman.biz');
?>

Actually, the string for enableSemantics is an identifier, needed to identify any exported data. The Semantic MediaWiki website suggests using the server's host name for this purpose (if you have multiple hostnames, just pick any one of them).

4) Enable the SMW extension, by creating a link to it under /etc/mediawiki-extensions/extensions-enabled:

cd /etc/mediawiki-extensions/extensions-enabled/
ln -s ../extensions-available/SemanticMediaWiki.php

By the way, this should also work with the MediaWiki extension enabler command:

 mwenext SemanticMediaWiki.php

5) We now run the maintenance script that creates the necessary tables in your MySQL MediaWiki database. This is a two-step affair:
- first set the MW_INSTALL_PATH environment variable to the root of the MediaWiki installation. This path is where LocalSettings.php and index.php are located; most likely it's /usr/share/mediawiki.
- then go to the directory where the SMW maintenance scripts are located, and execute SMW_setup.php.
The sequence will thus look something like this:

MW_INSTALL_PATH=/usr/share/mediawiki
export MW_INSTALL_PATH
cd /usr/share/mediawiki-semediawiki/maintenance
php SMW_setup.php

The php-script should report setting up some nine tables, named smw_ids, smw_redi2 et cetera. These are the extra MySQL tables that SMW needs.

6) Next, log into your MediaWiki with an account with administrative rights. If you now visit your Special pages, you'll find taht under the section Restricted special pages there is now an entry titled Admin functions for Semantic MediaWiki. Open it, and find two sections:

  • Preparing database for Semantic MediaWiki
    Here you'll have to press the button labeled Initialise or upgrade tables; this will initialise the newly created tables. A dull page should appear, reporting actions for each of the nine new tables, and ending with the status message The storage engine was set up successfully.
  • Announce your wiki
    Clicking this button is optional; what it will do is post the URL of your wiki on the SMW Registry page over on the SMW site.

Note, that you might want to change some Semantic MediaWiki default settings.

That's it! You can now start using SMW.