How to install SemanticMediaWiki

This is quick guide on how to setup a (Semantic) MediaWiki.

Installation steps
This guide assumes that you have a running web server (e.g. Apache) with PHP support and a mySQL database running. You will also need the mySQL db root account or a user account with privileges to create tables in a database. If you do not have all this, XAMMP provides you all this out of the box without much installation overhead!

Core MediaWiki

 * Download the latest MediaWiki release
 * Extract the files to your web browser directory
 * Make the  subdirectory writable
 * Hop into your browser, surf into the wiki directory and fill out the configuration form
 * After saving, move the file  into the parent directory
 * Call the wiki URL in your browser to test if it worked

SemanticMediaWiki extension (optional)

 * Download the latest release of SemanticMediaWiki
 * Probably check if it is compatible with your MediaWiki version (normally the recent versions should be ok)
 * Extract the directory  to
 * Insert at the end of the file :   and   (you may replace example.org with something more meaningful)
 * In your wiki, log in as a user with admin status and go to the page  to do the final setup steps
 * If the wiki db-user does not have rights, set db root account credentials in  and call   with PHP from the command line

Semantic Forms (optional)

 * tbd.

Common configuration options
These are common MediaWiki configuration options which can be set in.

You will never need all of these settings. Just copy/paste what is suitable for your case. Most options are sort of self-explanatory.

General
error_reporting( E_ALL ); ini_set( 'display_errors', 1 ); $wgShowExceptionDetails = true; $wgShowSQLErrors = true;
 * 1) Error reporting (only useful for debugging)

ini_set( 'memory_limit', '20M' );
 * 1) Memory limit

$wgEnableUploads = true; $wgFileExtensions = array( 'png', 'jpg', 'gif', 'doc','xls','ppt','pdf' );
 * 1) Uploads

$wgAllowExternalImages = true;

$wgUseTrackbacks = true;

$wgNamespacesWithSubpages[NS_MAIN] = true;
 * 1) Enable subpages in the main namespace

$wgLanguageCode = 'de';

User interface
$wgLogo = "$wgScriptPath/images/mylogo.gif"; $wgFavicon = "$wgScriptPath/images/favicon.ico";
 * 1) Logo & Favicon

$wgDefaultSkin = 'monobook';

$wgEnableCreativeCommonsRdf = true; $wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = "http://www.gnu.org/copyleft/fdl.html"; $wgRightsText = "GNU Free Documentation License 1.2"; $wgRightsIcon = "${wgStylePath}/common/images/gnu-fdl.png";
 * 1) For attaching licensing metadata to pages, and displaying an
 * 2) appropriate copyright notice / icon. GNU Free Documentation
 * 3) License and Creative Commons licenses are supported so far.
 * 1) $wgRightsCode = "gfdl"; # Not yet used

User rights
$wgWhitelistRead = array( "Special:Userlogin", "-", "MediaWiki:Monobook.css" ); $wgGroupPermissions['*'   ]['createaccount']   = false; $wgGroupPermissions['*'   ]['edit']            = false; $wgGroupPermissions['*'   ]['read']            = false; $wgGroupPermissions['user' ]['createaccount']  = true; $wgGroupPermissions['user' ]['edit']           = true; $wgGroupPermissions['user' ]['read']           = true; This will close your wiki for anonymous users. Only users can create accounts (for other users).

Extension settings
require_once("$IP/extensions/ParserFunctions/ParserFunctions.php"); include("$IP/extensions/SearchLog/SearchLog.php");
 * 1) ParserFunctions (http://www.mediawiki.org/wiki/Extension:ParserFunctions)
 * 1) Search Log (http://www.mediawiki.org/wiki/Extension:SearchLog)

require_once($IP.'/extensions/InputBox/inputbox.php');
 * 1) InputBox (http://www.mediawiki.org/wiki/Extension:Inputbox)

require_once( "extensions/DynamicArticleList/DynamicArticleList.php" );
 * 1) DynamicArticleList (http://www.mediawiki.org/wiki/Extension:Dynamic_Article_List)

include_once("$IP/extensions/ArticleComments/ArticleComments.php");
 * 1) http://www.mediawiki.org/wiki/Extension:ArticleComments

require_once('extensions/scuttlebookmarks/scuttlebookmarks.php');
 * 1) http://www.mediawiki.org/wiki/Extension:ScuttleBookmarks

include_once("$IP/extensions/SemanticMediaWiki/includes/SMW_Settings.php"); enableSemantics('localhost.org'); $smwgQComparators = '<|>|!|~'; // + pattern search comparator ~ for strings $smwgLinksInValues = true; $smwgShowFactbox = SMW_FACTBOX_NONEMPTY;
 * 1) SemanticMediaWiki (http://semantic-mediawiki.org/wiki/Semantic_MediaWiki)

include_once('extensions/SemanticForms/includes/SF_Settings.php'); $sfg24HourTime = true;
 * 1) SemanticForms (http://www.mediawiki.org/wiki/Extension:Semantic_Forms)

require_once("$IP/extensions/SemanticResultFormats/SRF_Settings.php"); srfInit('all');
 * 1) Semantic Result Formats (http://semantic-mediawiki.org/wiki/Semantic_Result_Formats)
 * 1) srfInit( array('graph', 'timeline', 'calendar', 'eventline') );

LDAP/Actice Directory
require_once( "$IP/extensions/LDAPAuth/LdapAuthentication.php" ); $wgAuth = new LdapAuthenticationPlugin;
 * 1) LDAP/AD (http://www.mediawiki.org/wiki/Extension:LDAP_Authentication)


 * 1) Uncomment this line to see debug messages:
 * 2) $wgLDAPDebug = 10;
 * 3) $wgShowExceptionDetails = true;

//The names of one or more domains you wish to use //These names will be used for the other options, it is freely choosable and not dependent //on your system. These names will show in the Login-Screen, so it is important that the user //understands the meaning. $wgLDAPDomainNames = array("mydomain.com");

//The fully qualified name of one or more servers per domain you wish to use. If you are //going to use SSL or StartTLS, it is important that the server names provided here exactly //match the name provided by the SSL certificate returned by the server; otherwise, you may //have problems. $wgLDAPServerNames = array( "mydomain.com"=>"ad.mydomain.com"); //Allow the use of the local database as well as the LDAP database. //Good for transitional purposes. //Default: false $wgLDAPUseLocal = true; //The type of encryption you would like to use when connecting to the LDAP server. //Available options are "tls", "ssl", and "clear" //Default: tls $wgLDAPEncryptionType = array("mydomain.com"=>"clear"); // ssl $wgLDAPUseSSL = true; $wgLDAPBaseDNs = array('mydomain.com' => 'dc=fzi,dc=de');
 * 1) $wgLDAPBaseDNs = array('mydomain.com' => 'OU=Users,OU=IPE,dc=fzi,dc=de');

$wgLDAPSearchAttributes = array( 'mydomain.com' => 'sAMAccountName');

$wgLDAPUpdateLDAP = array("mydomain.com"=>false); $wgLDAPAddLDAPUsers = array("mydomain.com"=>false);
 * 1) $wgLDAPSearchAttributes = array('DOMAINNAME' => 'sAMAccountName');
 * 2) $wgLDAPProxyAgent = array("DOMAINNAME"=>"PROXYUSERDN");
 * 3) $wgLDAPProxyAgentPassword = array("DOMAINNAME"=>"PROXYUSERPASS");

//The search string to be used for straight binds to the directory; USER-NAME will be //replaced by the username of the user logging in. //This option is not required (and shouldn't be provided) if you are using a proxyagent //and proxyagent password. //If you are using AD style binding (TDOMAIN\\USER-NAME or USER-NAME@TDOMAIN) and //want to be able to use group syncing, preference pulling, etc., you'll need to set //$wgLDAPBaseDNs and $wgLDAPSearchAttributes for the domain. $wgLDAPSearchStrings = array( "mydomain.com"=>"USER-NAME@mydomain.com");
 * 1) $wgLDAPSearchStrings = array("xxx"=>"xxx\\USER-NAME" );

$wgWhitelistRead = array("Special:Userlogout", "Special:Userlogin", "-", "MediaWiki:Monobook.css" ); $wgGroupPermissions['*'   ]['createaccount']   = false; $wgGroupPermissions['user']['createaccount'] = false; $wgGroupPermissions['sysop']['createaccount'] = false; $wgGroupPermissions['*'   ]['edit']            = false; $wgGroupPermissions['*'   ]['read']            = false; $wgGroupPermissions['user' ]['edit']           = true; $wgGroupPermissions['user' ]['read']           = true;
 * 1) restrict to logged in users only

//Option for pulling specific preferences. Available options //are "email", "realname", "nickname", "language" //Default: none; disabled //Available in 1.2a $wgLDAPPreferences = array( "mydomain.com"=>array( "email"=>"mail","realname"=>"cn")  );