Managing a private wiki/LocalSettings.php
Appearance
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]- Default user options (setting user preferences for new accounts)
- Access (who can read, edit, or create accounts)
- Adding extensions
Example
[edit | edit source]Here's a sampling of some common settings (not a complete file):
$wgFavicon = "http://upload.wikimedia.org/wikipedia/commons/c/c8/Nuvola_apps_kblackbox.png"; //this sets the favicon
$wgLogo = "http://upload.wikimedia.org/wikipedia/commons/c/c8/Nuvola_apps_kblackbox.png"; //this sets the logo
require_once("$IP/extensions/Nuke/SpecialNuke.php"); //installs http://www.mediawiki.org/wiki/Extension:Nuke
$wgGroupPermissions['sysop']['nuke'] = true; //gives sysops the 'nuke' permission, which is specific to that extension
require_once("$IP/extensions/SpamBlacklist/SpamBlacklist.php"); //installs http://www.mediawiki.org/wiki/Extension:SpamBlacklist
$wgSpamBlacklistFiles = array( //sets the location of blacklists
"http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1", // 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 http://www.mediawiki.org/wiki/Extension:Title_Blacklist
$wgTitleBlacklistSources = array(
'type' => TBLSRC_URL,
'src' => 'http://meta.wikimedia.org/w/index.php?title=Title_blacklist&action=raw', //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]- Wikimedia's InitialiseSettings.php (large file!)