MediaWiki

From WickyWiki
Revision as of 21:23, 22 November 2012 by Wilbert (talk | contribs) (→‎Installation and configuration)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Installation and configuration

MySQL database server

sudo apt-get install install apache2 mysql-server php5 php5-mysql

MediaWiki website files

Download the code and copy to /var/www/mediawiki

Edit LocalSettings.php to add extensions and to customize.

Configuration LocalSettings.php

sudo gedit /var/www/mediawiki/LocalSettings.php
#GeshiHighlight, download from http://qbnz.com/highlighter/
require_once("$IP/extensions/GeshiHighlight.php");
$wgSyntaxHighlightDefaultLang = "bash";

# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
 
# But allow them to access the login page or else there will be no way to log in!
$wgWhitelistRead = array ("Special:Userlogin", "MediaWiki:Common.css", 
"MediaWiki:Common.js", "MediaWiki:Monobook.css", "MediaWiki:Monobook.js", "-");
 
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
 
# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;

# Custom favorite icon /mediawiki/favicon.ico
$wgFavicon = "$wgScriptPath/favicon.ico";

Apache2 webserver configuration

sudo gedit /etc/apache2/sites-available/http_wilbertvolkers.dyndns.org
<VirtualHost *:80>
	Servername mediawiki.wilbertvolkers.dyndns.org
	
	#redirect UserLogin page to https
	# you will need to configure your https as well
	RewriteEngine On
	RewriteCond %{REQUEST_URI} ^/mediawiki/index.php$
	RewriteCond %{QUERY_STRING} ^title=Special:UserLogin
	RewriteCond %{REQUEST_METHOD} ^GET$
	RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R]

	DocumentRoot /var/www/
	Alias /mediawiki/ /var/www/mediawiki/
	<Directory /var/www/mediawiki/>
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	LogLevel warn
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	ServerSignature Off
</VirtualHost>

To configure https read Create certificates for Apache2

The mediawiki - part in the configuration file will look something like this:

sudo gedit /etc/apache2/sites-available/https_wilbertvolkers.dyndns.org
...

<VirtualHost *:443>
	...

	# mediawiki directory https
	Alias /mediawiki/ /var/www/mediawiki/
	<Directory /var/www/mediawiki/>
		SSLRequireSSL
		AllowOverride None
		Order deny,allow
		Allow from all
	</Directory>

	...

</VirtualHost>

Categories

Use categories to group your pages by including one or more Category tags:

 [[Category:Name]]

Try to distribute your pages evenly over categories, first look here if any of the available categories can be used:

Special:Categories

Tips

The tooltips will show you the letter of the shortcut between brackets. You need to press SHIFT+ALT+<letter> to use it.

Shortcuts:

  • SHIFT+ALT+Z main page
  • SHIFT+ALT+E start edit (if allowed)
    • you can also right click on the section or click the [edit] link
  • SHIFT+ALT+P preview
  • SHIFT+ALT+S save
  • SHIFT+ALT+C cancel

Modify the [edit] link to be smaller with "myskin":

sudo gedit /var/www/mediawiki/skins/myskin/main.css
/* change edit-link size */
span.editsection {
	font-size: 30%;
	float: right;
	margin-left: 5px;
}

See also

Go to Apache2 webserver to read about installing and configuring Apache2 webserver.

Accidentally committed information that really needs to be removed? Go to: Permanently remove a MediaWiki revision using SQL.

MediaWiki help pages

Extensions

Other sources