MediaWiki: Unterschied zwischen den Versionen

Aus crazylinux.de
Zur Navigation springen Zur Suche springen
(highlighting)
(small fixes)
Zeile 1: Zeile 1:
MediaWiki ist ein freies Wiki-Softwarepaket, welches für die Wikipedia geschrieben worden ist. Es wird als Grundlage der Non-Profit-Organisation der Wikimedia Foundation und viele andere Wikis genutzt, einschließlich dieser Webseite, der Heimat von Mediawiki.
http://www.mediawiki.org/
Folgende Erweiterungen bzw. Konfixx waren/sind relevant:
==404/Seite existiert nicht==
==404/Seite existiert nicht==
Ist ein Systemtext: [https://crazylinux.de/index.php?title=MediaWiki:Noarticletext&action=edit| MediaWiki:Noarticletext]
Ist ein Systemtext: [https://crazylinux.de/index.php?title=MediaWiki:Noarticletext&action=edit| MediaWiki:Noarticletext]
Zeile 21: Zeile 26:
http://www.mediawiki.org/wiki/Extension:TopTenPages
http://www.mediawiki.org/wiki/Extension:TopTenPages


==Enabling for a namespace==
==Enabling subpages for a namespace==
An easy way to enable subpages for a given namespace is to edit the LocalSettings.php and insert the following:
An easy way to enable subpages for a given namespace is to edit the LocalSettings.php and insert the following:


# Enable subpages in the main namespace
<source lang="php">
$wgNamespacesWithSubpages[NS_MAIN] = true;
# Enable subpages in the main namespace
 
$wgNamespacesWithSubpages[NS_MAIN] = true;
</source>
http://www.mediawiki.org/wiki/Manual:%24wgNamespacesWithSubpages
http://www.mediawiki.org/wiki/Manual:%24wgNamespacesWithSubpages


Zeile 38: Zeile 44:


==Eliminating index.php from the url==
==Eliminating index.php from the url==
das wiki läuft unter /mediawiki. /wiki ist die virtuelle url.
Das Wiki läuft direkt unter http://crazylinux.de/. Artikel sind damit unter /, also z.b. http://crazylinux.de/Apache2.
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url


LocalSesstings.php:
LocalSesstings.php:
$wgScriptPath      = "/mediawiki";
<source lang="php">
## If using PHP as a CGI module, use the ugly URLs
$wgScriptPath      = "";
$wgArticlePath      = "/wiki/$1";
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath      = "/$1";
</source>
 
Zusätzlich muss noch [[Apache2|mod_rewrite]] aktiviert werden. Leider funktioniert die Regeln nicht in der .htaccess, deshalb müssen diese in die Apache-Conf
<source lang="apache">
RewriteEngine on
 
#forward old wiki-url to new one
RewriteRule ^/wiki/(.*)$        http://crazylinux.de/$1 [R=301,L]
 
# forbid bots to spider pages with certain urls that are forbidden in robots.txt anyway.
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteRule ^/index.php?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteRule ^/(Spezial):.*?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^/?$ /Hauptseite [L,QSA,gone]
 
# rules for well-behaving bots and normal browser:
RewriteCond %{REQUEST_URI} !^/files/
RewriteCond %{REQUEST_URI} !^/[i|I]cons/
 
# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/(images|skins|cgi-bin|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/(favicon.ico|sitemap.xml)
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/opensearch_desc.php
RewriteCond %{REQUEST_URI} !^/api.php
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]
</source>
 
TODO: [[:Special:Alle_Seiten]] sollte natürlich von den Spidern gefunden werden


==File Upload==
==File Upload==
LocalSesstings.php:
LocalSesstings.php:
$wgEnableUploads = true; // Enable uploads
<source lang="php">
$wgCheckFileExtensions = false;
$wgEnableUploads = true; // Enable uploads
$wgStrictFileExtensions = false;
$wgCheckFileExtensions = false;
$wgStrictFileExtensions = false;
</source>
http://www.mediawiki.org/wiki/Configuring_file_uploads
http://www.mediawiki.org/wiki/Configuring_file_uploads


==No Anonymous==
==No Anonymous==
<pre>
<source lang="php">
# Permission keys given to users in each group.
# Permission keys given to users in each group.
  # All users are implicitly in the '*' group including anonymous visitors;
# All users are implicitly in the '*' group including anonymous visitors;
  # logged-in users are all implicitly in the 'user' group. These will be
# logged-in users are all implicitly in the 'user' group. These will be
  # combined with the permissions of all groups that a given user is listed
# combined with the permissions of all groups that a given user is listed
  # in in the user_groups table.
# in in the user_groups table.
  #
#
  # This replaces wgWhitelistAccount and wgWhitelistEdit
# This replaces wgWhitelistAccount and wgWhitelistEdit
  #
#
  # The following line should be commented, otherwise these settings will
# The following line should be commented, otherwise these settings will
  # throw away the settings on DefaultSettings.php (you probably don't want this).
# throw away the settings on DefaultSettings.php (you probably don't want this).
  # With this line commented you will only overwrite the settings you explicitly
# With this line commented you will only overwrite the settings you explicitly
  # define here (that's what you probably want).
# define here (that's what you probably want).
  #$wgGroupPermissions = array();
#$wgGroupPermissions = array();
$wgGroupPermissions['*'    ]['createaccount']  = false;
$wgGroupPermissions['*'    ]['createaccount']  = false;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = false;
$wgGroupPermissions['*'    ]['edit']            = false;
</pre>
</source>
 
Desweiteren sollten natürlich die 'Actions' ausgeblendet werden:
http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_remove_the_article.2Fedit_etc_tabs_for_users_who_are_not_logged_in.3F


==Überschriften nummerieren/numberheadings==
==Überschriften nummerieren/numberheadings==
in LocalSettings.php:
in LocalSettings.php:
$wgDefaultUserOptions['numberheadings'] = 1;
<source lang="php">
 
$wgDefaultUserOptions['numberheadings'] = 1;
</source>
==Farmer - (Multisite) Mediawiki farm==
==Farmer - (Multisite) Mediawiki farm==
http://www.mediawiki.org/wiki/User:IndyGreg/Farmer
http://www.mediawiki.org/wiki/User:IndyGreg/Farmer


==Dublin Core==
==Dublin Core==
$wgEnableDublinCoreRdf = true;
<source lang="php">
 
$wgEnableDublinCoreRdf = true;
==WikiArticleFeeds==
</source>
The WikiArticleFeeds Extension is a MediaWiki extension for converting regular wiki articles into RSS and Atom feeds.
http://jimbojw.com/wiki/index.php?title=WikiArticleFeeds&action=raw&ctype=text/plain&name=WikiArticleFeeds.php


==Config-Übersicht==
==Config-Übersicht==

Version vom 15. März 2007, 01:13 Uhr

MediaWiki ist ein freies Wiki-Softwarepaket, welches für die Wikipedia geschrieben worden ist. Es wird als Grundlage der Non-Profit-Organisation der Wikimedia Foundation und viele andere Wikis genutzt, einschließlich dieser Webseite, der Heimat von Mediawiki.

http://www.mediawiki.org/

Folgende Erweiterungen bzw. Konfixx waren/sind relevant:

404/Seite existiert nicht

Ist ein Systemtext: MediaWiki:Noarticletext

Diese Seite enthält momentan noch keinen Text, aber du kannst nach dem Seitentitel [[{{ns:special}}:Search/{{PAGENAME}}|suchen]] oder 
diese Seite [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} bearbeiten].

siehe auch http://bugzilla.wikimedia.org/show_bug.cgi?id=2585

Syntax-Highlighting

This extension adds the source tag to present formatted source code.
http://www.mediawiki.org/wiki/Extension:Highlight

Last Updates

http://www.mediawiki.org/wiki/Extension:News

Sitemap (Google)

http://www.mediawiki.org/wiki/Extension:Google_Sitemap

Top10-Pages

http://www.mediawiki.org/wiki/Extension:TopTenPages

Enabling subpages for a namespace

An easy way to enable subpages for a given namespace is to edit the LocalSettings.php and insert the following:

# Enable subpages in the main namespace
$wgNamespacesWithSubpages[NS_MAIN] = true;

http://www.mediawiki.org/wiki/Manual:%24wgNamespacesWithSubpages

Restricted Page Patch

http://conseil-recherche-innovation.net/index.php/1974/04

weitere http://www.mediawiki.org/wiki/Extension:PageSecurity

Navigation

http://meta.wikimedia.org/wiki/Help:Navigation_bar

MediaWiki:Sidebar

Eliminating index.php from the url

Das Wiki läuft direkt unter http://crazylinux.de/. Artikel sind damit unter /, also z.b. http://crazylinux.de/Apache2. http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url

LocalSesstings.php:

$wgScriptPath       = "";
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath      = "/$1";

Zusätzlich muss noch mod_rewrite aktiviert werden. Leider funktioniert die Regeln nicht in der .htaccess, deshalb müssen diese in die Apache-Conf

RewriteEngine on

#forward old wiki-url to new one
RewriteRule ^/wiki/(.*)$        http://crazylinux.de/$1 [R=301,L]

# forbid bots to spider pages with certain urls that are forbidden in robots.txt anyway.
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteRule ^/index.php?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteRule ^/(Spezial):.*?.*$ /Hauptseite [L,QSA,gone]
RewriteCond %{HTTP_USER_AGENT} .*Yahoo\!\sSlurp.*|.*Googlebot.*|.*msnbot.*
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^/?$ /Hauptseite [L,QSA,gone]

# rules for well-behaving bots and normal browser:
RewriteCond %{REQUEST_URI} !^/files/
RewriteCond %{REQUEST_URI} !^/[i|I]cons/

# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/(images|skins|cgi-bin|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/(favicon.ico|sitemap.xml)
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/opensearch_desc.php
RewriteCond %{REQUEST_URI} !^/api.php
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA]

TODO: Special:Alle_Seiten sollte natürlich von den Spidern gefunden werden

File Upload

LocalSesstings.php:

$wgEnableUploads = true; // Enable uploads
$wgCheckFileExtensions = false;
$wgStrictFileExtensions = false;

http://www.mediawiki.org/wiki/Configuring_file_uploads

No Anonymous

# Permission keys given to users in each group.
# All users are implicitly in the '*' group including anonymous visitors;
# logged-in users are all implicitly in the 'user' group. These will be
# combined with the permissions of all groups that a given user is listed
# in in the user_groups table.
#
# This replaces wgWhitelistAccount and wgWhitelistEdit
#
# The following line should be commented, otherwise these settings will
# throw away the settings on DefaultSettings.php (you probably don't want this).
# With this line commented you will only overwrite the settings you explicitly
# define here (that's what you probably want).
#$wgGroupPermissions = array();
$wgGroupPermissions['*'    ]['createaccount']   = false;
$wgGroupPermissions['*'    ]['read']            = true;
$wgGroupPermissions['*'    ]['edit']            = false;

Desweiteren sollten natürlich die 'Actions' ausgeblendet werden: http://www.mediawiki.org/wiki/Manual:FAQ#How_do_I_remove_the_article.2Fedit_etc_tabs_for_users_who_are_not_logged_in.3F

Überschriften nummerieren/numberheadings

in LocalSettings.php:

$wgDefaultUserOptions['numberheadings'] = 1;

Farmer - (Multisite) Mediawiki farm

http://www.mediawiki.org/wiki/User:IndyGreg/Farmer

Dublin Core

$wgEnableDublinCoreRdf = true;

Config-Übersicht

http://www.mediawiki.org/wiki/Manual:Configuration_settings