GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing www.mediawiki.org — Manual:LocalSettings.php - MediaWiki
The Location on the serverThe (If you are using Vagrant, see also MediaWiki-Vagrant#MediaWiki_settings.) Security
Additionally, you can create a MySQL user, who is restricted to only the database used by the wiki and provide this user's credentials in See also Manual:Securing database passwords for a method to move the sensitive parts of File contentsWhen you edit
The default values of configuration settings are set in Within the file, there can also be several lines such as Like most PHP files in MediaWiki, If you have a wiki on a MediaWiki wiki farm you may not have write-access (perhaps not even read-access) to the file This file is not written to your webserver automatically for security reasons. Instead, it is offered as a download, which you must then upload to your server for your wiki to begin working. For a more complete explanation, see this explanation.
Overview of available settingsSee the configuration settings index and the comments included in the settings files for help on what all the variables do. A short listing of the most important variables, as well as the most requested features, is listed below. Standard settingsInstall pathThe $IP (install path) variable holds the local file path to the base installation of your wiki.
Since MediaWiki 1.18, the system sets $IP automatically.
Setting Site name$wgSitename holds the name of your wiki setup. This name gets included many times throughout the system, such as via MediaWiki:Pagetitle. For instance, the Wikipedia tagline "From Wikipedia, the free encyclopedia" makes use of this setting. Declensions of site nameSome translations of interface are ready for inflection of site name. You can set proper forms of word in variables $wgGrammarForms (for example please refer to the $wgSitename documentation page). Script path$wgScriptPath is the URL path prefix to access the main MediaWiki script that is the central acting piece of code of MediaWiki. This setting should correspond to the Apache settings, especially if you are using Apache's rewrite rules. Server name$wgServer contains the base URL of the server, including protocol but without the trailing slash and without the subdirectory if any. When the wiki is accessed from either the localhost where it runs, from an intranet or from the internet, email notifications and a few other computed messages would be usually delivered with the different URLs. From MediaWiki 1.34 If www.example.com is the server address of your wiki as seen from the internet, add a line such as $wgServer = 'http://www.example.com'; The magic word variable You can also use a protocol relative URL as shown below.
When using a protocol relative URL, be sure to set $wgServer = '//www.example.com'; $wgCanonicalServer = 'https://www.example.com'; Script name$wgScript is the name of the main (index) MediaWiki PHP script, named Article path$wgArticlePath is the path to use when accessing a page in MediaWiki.
The path should contain the path to the main script (usually making use of If you are using Apache rewrite rules to create pretty and short URLs, you probably need to adjust Typical values are:
Stylesheet locationUse $wgStylePath to set the URL path to the place where the stylesheets (CSS) for the MediaWiki installation are located. $wgStyleDirectory should point the same place, but note that this is a local file system path for use in internal scripts accessing the file system. Upload locationThe upload directory is the place where files uploaded by the users are stored. $wgUploadPath specifies the URL path, $wgUploadDirectory points to the local file system path. Logo$wgLogos specifies which graphical logos are displayed in the top left corner of the page in most MediaWiki installations. See Manual:FAQ for how to change the logo. Contact info$wgEmergencyContact is the email address of the user to contact if something goes wrong. This email address is used to send internal bug reports to. As an administrator, you want to include your email address here. $wgPasswordSender is the email address where email gets sent from, when passwords are sent out to users who have forgotten their passwords. Choose an address people can reply to in case of trouble or confusion. Database settingsMediaWiki needs access to the database (currently either MySQL or PostgreSQL) to store pages, modifications, user information, and a lot more things. $wgDBserver contains the hostname where the database is hosted on. In most cases this will be just "localhost" as the database is run on the same system, but for distributed installations, you need to fill in the fully qualified domain name of the computer running the database. $wgDBname is the database name of the database to be used by MediaWiki. A single MySQL or PostgreSQL installation can store more than one database and you can even run many MediaWiki installations on a single server. Make sure you have stated the correct database name here and use different database names for different wiki installations on the same database server. $wgDBuser and $wgDBpassword contain the login name and password to be used by MediaWiki to access the database. Make sure the specified user has the proper access rights to be able to manipulate the wiki's table on the database server. Also see Manual:Securing database passwords for a method to move the sensitive parts of User rights$wgGroupPermissions is an associative array, controlling permissions for creating and editing pages for your different user groups. In this array, custom permission levels can be created, and permission levels for the different user groups can be set. See Help:User rights for more information about the different permissions and user groups available. Force capital linksBy default, no page name can start with a lowercase Roman letter: in an attempt to do so the first letter is converted to uppercase; if a link target, included page, image or category is specified with a name starting with a lowercase letter, the actual target etc. is the page starting with the corresponding capital. Alternatively page names can start with a lowercase letter, in addition to the possibilities of starting with a capital, a digit, etc. For that you must adjust $wgCapitalLinks . Setting it to false allows lowercase characters, true chooses the default behavior. Enabling subpagesIn $wgNamespacesWithSubpages[NS_MAIN] = 1; Image uploadsBefore users are allowed to upload files to the MediaWiki system, you have to enable that feature. Make sure the Upload Directory is properly configured and writeable by the Apache web server process. Then set $wgEnableUploads to true to allow uploading in the web user interface. i.e. Here's some example code from $wgUploadPath = "$wgScriptPath/uploads"; ## Wiki 1.5 defaults to /images, but allows more than just images $wgUploadDirectory = "$IP/uploads"; ## Wiki 1.5 defaults to /images, but allows more than just images ## To enable image uploads, make sure the above '$wgUploadPath' directory is writable by Apache User or group. ## ''(i.e. chmod og+w uploads images)'' then the following should be true: $wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert"; ## If you want to use image uploads under safe mode, create the directories ## images/archive, images/thumb and images/temp, then configure them all writable. Afterwards, uncomment this, if it's not already done: $wgHashedUploadDirectory = false; If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working ImageMagick installation.
Set $wgUseImageMagick to true once you have installed and tested ImageMagick on your system.
Make sure $wgImageMagickConvertCommand points to the proper location of the Also, you may want to modify the list of accepted extensions, which is stored within $wgFileExtensions : $wgFileExtensions = [ 'png', 'jpg', 'jpeg', 'ogg', 'doc', 'xls', 'ppt', 'mp3', 'sxc', 'pdf' ]; In case ImageMagick outputs an error message similar to the following:
then try adding the following line to
Interwiki supportInterWiki support is built into MediaWiki but you need to configure the prefix to be used for your internal links.
This prefix is usually the same as Language of user interfaceMediaWiki allows for a variety of localised user interfaces languages instead of the English default. If you want to run your wiki in a non-English language, set the You may use any of the languages with a file in the directory languages/i18n.
E.g. if you find After changing the language code, you will need to run a PHP script to make it work. In a terminal window, change to your wiki directory, change to the
maintenance folder, and enter php rebuildMessages.php --rebuild. On Windows, the PHP folder might not be in your PATH environment variable and you'll have to prefix php with the path to the program.Not all languages are supported. See the translation statistics on TranslateWiki for an up-to-date list of which languages are supported and to what extent. That list reflects the current state of MediaWiki core, so depending on what version you are using there may be a discrepancy. Setting copyright for the site
If
$wgRightsPage is non-empty, the link in the copyright/license notice will link to that page on your site. If $wgRightsPage is empty then the copyright/license notice will link to $wgRightsUrl instead.To modify the copyright statements of the site, add something like this to $wgRightsPage = "YourWiki:Copyright"; $wgRightsText = "copyright YourWiki"; Afterwards, edit MediaWiki:Copyright-footer to provide an appropriate message, using Example: setting a Creative Commons license To set a Creative Commons license do the following:
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> <img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights30.png" /> </a> This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License</a>.
Custom namespacesBy declaring $wgExtraNamespaces , and modifying $wgNamespacesWithSubpages , and $wgNamespacesToBeSearchedDefault , extra namespaces can be added to a MediaWiki installation; and by declaring the $wgNamespaceAliases array namespace aliases can be added. Take heed not to have any pages already titled in that namespace, for instance if you had a page called "Technical:Support" and you created the Technical: namespace, then that page would not only be lost, but you cannot remove it from Special:Allpages. To fix this delete the namespace, move "Technical:Support" to "Support" in mainspace, delete the redirect, reinsert the namespace, and move it back to "Technical:Support". See Custom namespaces for more information as to how to do so. SkinsThe default skin of the site can be modified via $wgDefaultSkin . See also
| ||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | ||||||||||||||||