Managing a private wiki/LocalSettings.php

From Wikiversity
Jump to navigation Jump to search

This is the file that holds all the configuration settings for your wiki. When making changes, make them here and never in DefaultSettings.php, which is for default settings. LocalSettings.php overrides the defaults, so that's where config settings for your wiki go.

Settings[edit | edit source]

Example[edit | edit source]

Here's a sampling of some common settings (not a complete file):

$wgFavicon = ""; //this sets the favicon
$wgLogo = "";    //this sets the logo

require_once("$IP/extensions/Nuke/SpecialNuke.php");       //installs
	$wgGroupPermissions['sysop']['nuke'] = true;       //gives sysops the 'nuke' permission, which is specific to that extension
require_once("$IP/extensions/SpamBlacklist/SpamBlacklist.php");      //installs
	$wgSpamBlacklistFiles = array(                               //sets the location of blacklists
		"", // Wikimedia's list
		"DB: wiki MediaWiki:Spam_blacklist",                                              // a page in the database

require_once("$IP/extensions/AntiSpoof/AntiSpoof.php");  //this extension prevents confusing usernames

require_once("$IP/extensions/ParserFunctions/ParserFunctions.php"); //this extension is all the parserfunctions we know and love (you really want to install this extension)

require_once( "$IP/extensions/TitleBlacklist/TitleBlacklist.php");  //installs
	$wgTitleBlacklistSources = array(
         'type' => TBLSRC_URL,
         'src'  => '', //Wikimedia's list

//set some extra namespaces
$wgExtraNamespaces[102] = "Cookbook";
$wgExtraNamespaces[103] = "Cookbook_talk";
$wgExtraNamespaces[108] = "Transwiki";
$wgExtraNamespaces[109] = "Transwiki_talk";

//override some default user rights for a private wiki
//* is the implicit group for all visitors
$wgGroupPermissions['*'    ]['createaccount']   = false; // no account creation
$wgGroupPermissions['*'    ]['read']            = false; // don't let people read the wiki
$wgGroupPermissions['*'    ]['edit']            = false; // don't let people edit the wiki
$wgGroupPermissions['*'    ]['createpage']      = false; // don't let them create new content pages
$wgGroupPermissions['*'    ]['createtalk']      = false; // don't let them create new discussion pages

See also[edit | edit source]