Manual:LocalSettings.php/de
| Bearbeiten Sie diese Datei nicht mit dem Editor, TextEdit oder anderen Text-Editoren, welche Bytereihenfolge-Markierungen zu Dateien hinzufügen, sonst werden Sie ihrem Wiki schaden. |
| Diese Seite ist derzeit ein Entwurf. Das Material wurde unter Umständen noch nicht vollständig übersetzt: Informationen können weggelassen worden sein und bestimmte Teile der Inhalte können radikalen, schnellen Veränderungen unterliegen. Weitere Informationen hierzu sind unter Umständen auf der Diskussionsseite vermerkt. This page is currently a draft. Material may not yet be complete, information may presently be omitted, and certain parts of the content may be subject to radical, rapid alteration. More information pertaining to this may be available on the talk page. |
| MediaWiki Datei: LocalSettings.php | |
|---|---|
| Speicherort: | / |
| Quellcode: |
Nicht in Git (erstellt während Installation) |
| Klassen: | keine |
Die Datei LocalSettings.php bietet lokale Konfigurationseinstellungen (basierend auf der DefaultSettings.php Datei) einer MediaWiki-Installation. Sie sollten sich Zeit nehmen, um die Einstellungen in dieser Datei zu überprüfen. Die Datei wird normalerweise durch den webbasierten Installer MediaWiki generiert, aber vielleicht möchten Sie einige der Parameter optimieren, möglicherweise im Zusammenspiel mit Apache-Einstellungen. Für MediaWiki-Installationen die als Wikifarm konfiguriert sind, kann eine Datei mit dem Namen CommonSettings.php verwendet werden.
Ändern einer Einstellung bedeutet in der Regel, den Wert einer PHP-Variable zu ändern. Vielleicht möchten Sie sich erst mit der PHP-Syntax vertraut machen, bevor Sie direkt loslegen. Als Faustregel gilt, dass man im Hinterkopf behält, das auf PHP-Variablen durch einen vorangestellten "$"-Zeichen vor dem Variablennamen zugegriffen wird; viele Variablen sind einfach entweder auf wahr (true) oder falsch (false) eingestellt.
Ihre Änderungen werden sofort nach dem Speichern der Datei wirksam: es gibt keine Notwendigkeit, irgend etwas manuell "neu zu starten". In einigen Fällen müssen Sie möglicherweise den Zwischenspeicher Ihres Browsers löschen, um die Änderungen zu sehen.
Die Standardwerte von vielen weiteren Einstellungen werden in der includes/DefaultSettings.php eingestellt, welche nicht bearbeitet werden sollte; wenn die Variable die Sie ändern möchten, nicht bereits in Ihrer LocalSettings.php erwähnt wird, kopieren Sie die entsprechende Zeile aus DefaultSettings und ändern Sie sie entsprechend. Innerhalb der LocalSettings.php können Sie neue Zeilen am Ende hinzufügen. Alle Zeilen wie diese, sollten auf jeden Fall unterhalb der Zeile erscheinen, die 'require_once( "includes/DefaultSettings.php" );' sagt.
Innerhalb der Datei kann es auch mehrere Zeilen umfassen wie zum Beispiel 'require_once( "extensions/extension.php" );', welche zu anderen Erweiterungen verlinken, die auf dem Wiki aktiviert sind. Diese Erweiterungen können die Festlegung der Werte von mehr Variablen in LocalSettings.php verlangen, überprüfen Sie die Dokumentation der Erweiterung für weitere Anweisungen. Eine Liste der Erweiterungen ist auf der Erweiterungsmatrix verfügbar.
Vorsicht:- In MediaWiki 1.16 und früher ist es wichtig, Erweiterungen nicht vor der Zeile require_once( "includes/DefaultSettings.php" ); zu platzieren; das wird die Erweiterungs-Setup-Funktionen-Arrays löschen, was verursacht das keine Erweiterungen mit installiert werden, und wahrscheinlich machen Sie Ihren Wiki dadurch unzugänglich.
Ihre Version der LocalSettings.php kann nicht mit einem schließenden PHP-Tag ?> beendet werden. Dies geschieht mit Absicht, da es verhindert dass Leute aus Versehen neue Informationen nach diesem Tag hinzufügen. PHP funktioniert ganz gut ohne schließenden Tag.
Sehen Sie sich das Verzeichnis der Konfigurationseinstellungen und die Kommentare welche in den Einstellungsdateien enthalten sind an, um Hilfe zu allem was Variablen tun zu erhalten. Eine kurze Auflistung der wichtigsten Variablen, sowie der am häufigsten nachgefragten Merkmale ist unten aufgeführt.
Wenn Sie einen Wiki auf einer MediaWiki Wikifarm haben, besitzen Sie den Schreibzugriff zu der LocalSettings.php Datei nicht (vielleicht nicht einmal Lesezugriff). Das Wikifarm-Unternehmen kann oder auch nicht bereit sein, Änderungen die Sie wünschen vorzunehmen. Vielleicht will sie die meisten Einstellungen auf allen Wikis der Wikifarm gleich halten.
(engl.)
Standardeinstellungen [edit]
Include-Pfad [edit]
Die $IP (Include-Pfad) Variable enthält den Pfad der lokalen Datei auf der Basis-Installation Ihres Wikis. Vergewissern Sie sich, sich voll auf den geeigneten Pfad zu beziehen. Nehmen Sie keinen Schrägstrich am Ende des Pfades.
Die DefaultSettings.php Datei wird aus dem Verzeichnis geladen, bezeichnet durch die IP-Variable.
Seitenname [edit]
Die $wgSitename Variable enthält den Namen Ihres Wiki-Setup. Dieser Name wird oft durch das System eingefügt, wie zum Beispiel über MediaWiki:Pagetitle. Zum Beispiel macht dass Wikipedia-Motto "'From Wikipedia, the free encyclopedia."' sich diese Einstellung zu Nutzen.
Seitensprache [edit]
Die $wgLanguageCode Variable steuert die Sprache Ihrer Wiki-Schnittstelle. Während die Nutzer die Sprache wechseln können, die sie in ihren Einstellungen sehen, setzt diese Variable die Standardsprache, die alle anonymen und die meisten registrierten Benutzer sehen.
Deklination von Seitenname [edit]
Einige Übersetzungen der Schnittstelle sind bereit für Flexion von Seitennamen. Sie können geeignete Formen des Wortes in Variablen $wgGrammarForms setzen.
Skriptpfad [edit]
$wgScriptPath ist der URL-Pfad-Präfix, um auf die wichtigsten MediaWiki Skripte zuzugreifen, dass ist das zentral wirkende Stück Code von MediaWiki. Diese Einstellung sollte auf die Apache-Einstellungen entsprechen, insbesondere wenn Sie Apache's Umschreibungsregeln verwenden.
Servername [edit]
$wgServer kann optional genutzt werden, um die automatische Erkennung zu überschreiben. Wenn das Wiki entweder aus dem Localhost, wo es läuft, von einem Intranet oder aus dem Internet, E-Mail-Benachrichtigungen zugegriffen wird und ein paar andere berechnete Nachrichten würden in der Regel mit den unterschiedlichen URLs geliefert werden. Die Verwendung von $wgServer überschreibt die Erkennung und der Name des Servers wird konstant sein.
Wenn www.beispiel.de die Server-Adresse Ihres Wikis ist, wie aus dem Internet gesehen, fügen Sie eine Zeile ein wie
$wgServer = 'http://www.beispiel.de';
Die Zauberwort Variable {{SERVER}} kann auf Wiki-Seiten verwendet werden; es ist gleich dem Wert von $wgServer; allerdings in einem Wiki, wie sie in der Wikimedia Familie, wo relative URLs verwendet werden, es wird nicht in vollem Umfang erweitern, zum Beispiel hier zeigt es //www.mediawiki.org, die weder geklickt noch in die Adressleiste kopiert-eingefügt werden kann, wie es ist.
Skriptname [edit]
$wgScript ist der Name des Haupt-MediaWiki-PHP-Skripts. Es heißt standardmäßig index.php. Den Skriptnamen zu ändern ist wahrscheinlich keine gute Idee. Trotzdem kannst du, wenn du es für nötig hältst, hier die entsprechenden Änderungen machen. Vergewissere dich aber, dass du weißt, was du tust.
Umleitungs-Skriptname [edit]
The $wgRedirectScript variable specifies the URL path to the redirect script which handles redirects in MediaWiki. This setting is similar to wgScript as you can configure the exact name of the script. As mentioned above, this is probably not a good idea unless you really know what you are doing.
Artikelpfad [edit]
$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 $wgScript) and use the $1 placeholder for the article name.
If you are using Apache rewrite rules to create pretty and short URLs, you probably need to adjust $wgArticlePath to address the right path. Note that wgArticlePath is used to construct URLs from within MediaWiki. If you make a mistake here, internal links will show up incorrectly while you still may be able to access the main page by specifying the correct URL manually. See Manual:Short URL for more information on URL configuration.
Typical values are:
| "$wgScript/$1" | pass the article name with separator "/" |
| "$wgScript?title=$1" | pass the article name as a parameter (old style) |
| "/mypath/$1" | custom path. Use Apache rewrite rules to convert "mypath" to the proper path accessing the main script |
Stylesheet-Ort [edit]
Use the $wgStylePath variable to set the URL path to the place where the stylesheets (CSS) for the MediaWiki installation are located. The $wgStyleDirectory variable should point the same place, but note that this is a local file system path for use in internal scripts accessing the file system.
Ort zum hochladen [edit]
The upload directory is the place where files uploaded by the users are stored. The $wgUploadPath variable specifies the URL path, the $wgUploadDirectory points to the local file system path.
Logo [edit]
The $wgLogo variable specifies which graphical logo is displayed in the top left corner of all mediawiki pages.
Add the following two lines to LocalSettings.php (below the "require" statements):
$wgStylePath = "/wiki/skins/"; $wgLogo = "{$wgStylePath}/common/images/wiki.png";
This replaces the default logo in the /wiki/skins/common/images/ directory.
The logo must be web accessible. The value of this variable is passed to the web browser, which uses it to fetch the logo. If in doubt, a good way to pick what to put here is navigate to the logo in your web browser (for example, this wiki the url of the logo is http://upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png ), and put the full url as the value of this variable.
Some people just replace the skins/common/images/wiki.png file with their logo. This is not recommended, as the customized logo would be overwritten on upgrade.
Kontaktinfo [edit]
The $wgEmergencyContact variable is the e-mail address of the user to contact when things happen. This e-mail address is used to send internal bug reports to. As an administrator, you want to include your e-mail address here.
The $wgPasswordSender variable is the e-mail address where e-mail 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.
Datenbankeinstellungen [edit]
MediaWiki needs access to the database (currently either MySQL or PostgreSQL) to store pages, modifications, user information, and a lot more things.
The $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.
The $wgDBuser and $wgDBpassword variables 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.
Sicherheit [edit]
Keep in mind that the LocalSettings.php permissions should not allow other users to view this file as it contains security-related data, including your database user password. chmod 700 or otherwise set the permissions to something that provides security from public access. The database user only needs to have SELECT, INSERT, UPDATE and DELETE permissions for the database. See also AdminSettings.php (until MediaWiki 1.16) which defines settings for a MySql user that has superuser database permissions to run the maintenance scripts.
Benutzerrechte [edit]
The $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.
"Capital links" erzwingen [edit]
By 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 the $wgCapitalLinks variable. Setting it to false allows lowercase characters, true chooses the default behaviour.
Unterseiten aktivieren [edit]
On localsettings.php, subpages are enabled on a per-namespace basis using the $wgNamespacesWithSubpages variable. For example, to enable subpages in the main namespace:
$wgNamespacesWithSubpages[NS_MAIN] = 1;
Bilder hochladen [edit]
Before 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 the $wgEnableUploads variable to true to allow uploading in the web user interface.
i.e. Here's some example code from includes/DefaultSettings.php to put in LocalSettings.php.
$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; $wgUseImageResize = 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, and make them all writable. Then uncomment this, if it's not already uncommented: $wgHashedUploadDirectory = false;
If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working ImageMagick installation. Set the $wgUseImageResize and $wgUseImageMagick variables to true once you have installed and tested ImageMagick on your system. Make sure the $wgImageMagickConvertCommand variable points to the proper location of the convert command of your installation, that the command is executable by the web server process, and $wgMaxShellMemory is large enough. See Manual:Image Administration#Image thumbnailing for detailed information and trouble-shooting.
Also, you may want to modify the list of accepted extensions, which is stored within the $wgFileExtensions array:
$wgFileExtensions = array('png','jpg','jpeg','ogg','doc','xls','ppt','mp3','sxc','pdf');
In case you run into trouble with ImageMagick, and obtain the following error message:
- Fatal error: mime_magic could not be initialized, magic file is not available in includes/MimeMagic.php on line 506
Try adding the following line to LocalSettings.php:
$wgMimeDetectorCommand = "file -bi";
Further information is available in Manual:Configuring file uploads, Manual:Mime type detection, and Manual:Image Administration#Image thumbnailing.
LaTeX Inline-Gleichungen [edit]
In order to render mathematical formulae in LaTeX, you need a working LaTeX installation on your system. Set the $wgUseTeX variable to true to enable that feature. Also make sure the $wgMathPath, $wgMathDirectory and $wgTmpDirectory are set properly, but you might want to go with the default values unless you have a very good reason to change it.
Interwiki-Unterstützung [edit]
InterWiki 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 $wgSitename, but in case you need to change that, you set the $wgLocalInterwiki variable to the preferred name.
Sprache des Benutzermenü [edit]
MediaWiki allows for a variety of localized user interfaces languages instead of the english default. If you want to run your wiki in a non-English language, set the $wgLanguageCode variable to the proper language code (e.g. "de" for German, "es" for Spanish, etc.)
You may use any of the languages found in the directory language. E.g., if you find MessagesEs.php, you can use "es" for Spanish. Do not use "Es" with a capital letter. Although it seems to work, not all texts are translated.
Note: After changing the language code, you will need to run a php script to make it work. With your command line tool, go to your wiki directory, open the "maintenance" folder, and type "php rebuildMessages.php --rebuild". Please note that on Windows, the PHP folder might not be included in the PATH environment variable.
Not all languages are supported. See here for a list of the localisation statistics of 1.22wmf4 (281e88a). See translatewiki.net for the statistics per released version.
Urheberrecht für die Seite einstellen [edit]
- $wgRightsPage is the page on the wiki that covers the copyrights that it falls under. Usually, this will be Project:Copyrights.
- $wgRightsUrl is the page describing full details of your license. (For the GNU FDL, for example, this would be
http://www.gnu.org/licenses/fdl.html.) - $wgRightsText is the text in the footer that follows "Content is available under". It will be linked to the page specified in
$wgRightsPage. - $wgRightsIcon is the URL of the image placed at the left of the footer.
- Note: If
$wgRightsPageis non-empty, the link in the copyright/license notice will link to that page on your site. If$wgRightsPageis empty then the copyright/license notice will link to$wgRightsUrlinstead.
- Note: If
To modify the copyright statements of the site, add something like this to LocalSettings.php:
$wgRightsPage = "YourWiki:Copyright"; $wgRightsText = "copyright YourWiki";
Afterwards, edit MediaWiki:Copyright to provide an appropriate message, using "$1" to indicate the position where the link to your copyright page will be.
Example: setting a Creative Commons license
To set a Creative Commons license do the following:
- Choose your license: http://creativecommons.org/text/publish-website
- Examine the returned HTML code, e.g.:
<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>.
- For
$wgRightsURLenter the href info from the first anchor:
$wgRightsUrl = "http://creativecommons.org/licenses/by-nc-sa/3.0/";
- For
$wgRightsTextenter the text the second anchor links from (add the "a" to the Wiki variable for a more grammatically correct version)
$wgRightsText = "a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License";
- For
$wgRightsIconenter the src info from the img link in the first anchor. You want to copy the badge to your own site instead of using the one from the Creative Commons site.
$wgRightsIcon = "http://creativecommons.org/images/public/somerights30.png";
- For using RDF metadata about copyright add one or both of the following lines to your LocalSettings.php
$wgEnableCreativeCommonsRdf = true; $wgEnableDublinCoreRdf = true;
Spezielle Namensräume [edit]
By declaring the $wgExtraNamespaces array, and modifying the $wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefault arrays, 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 in 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.
Skins [edit]
The default skin of the site can be modified via the $wgDefaultSkin variable.
Siehe auch [edit]
- Wiki Familien can share the same LocalSettings.php/de.
- Extension:Configure provides a way to set configuration settings from a special page.
- Manual:Securing_database_passwords - a guide to securing your database passwords and LocalSettings.php file.
| Sprache: | English • Deutsch • Ελληνικά • español • français • Bahasa Indonesia • 日本語 • 한국어 • русский |
|---|