Mediawiki: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
| No edit summary | |||
| Line 1: | Line 1: | ||
| {{lowercase title}} | {{lowercase title}} | ||
| == Upgrade from tarball == | == Upgrade from tarball == | ||
| Line 16: | Line 13: | ||
| php maintenance/update.php | php maintenance/update.php | ||
| </pre> | </pre> | ||
| == Increase the maximum upload file size == | == Increase the maximum upload file size == | ||
| Line 117: | Line 106: | ||
| flush privileges; | flush privileges; | ||
| </pre> | </pre> | ||
| == OLD == | |||
| === Setup === | |||
| On Ubuntu, install the <code>mediawiki</code> package. May also want <code>mediawiki-extensions</code> and <code>mediawiki-math</code>. | |||
| https://help.ubuntu.com/community/MediaWiki | |||
| * uncomment alias line of <code>/etc/apache2/conf.d/mediawiki1.10.conf</code> | |||
| * restart apache2 | |||
| * open a browser window and visit http://localhost/mediawiki | |||
| * fill out installation form | |||
| * move <code>/var/lib/mediawiki1.10/config/LocalSettings.php</code> to <code>/etc/mediawiki1.10/</code> | |||
Revision as of 19:28, 9 December 2014
Upgrade from tarball
- read all Release Notes
- download new tarball
- unpack in deploy@linode2:wiki/
- copy over LocalSettings.php (which is a pointer to ~/wiki/var/LocalSettings.php)
- make images point to ../var/images
- in extensions, make links to folders in ~/wiki/var/extensions
- make skins/common/images/wiki.png a link to ~/wiki/var/myimage.png
- run the database update script:
php maintenance/update.php
Increase the maximum upload file size
- Edit /etc/php5/apache2/php.inito change this line:
; Maximum allowed size for uploaded files. upload_max_filesize = 200M
- restart apache
Allow additional file types for upload
- Edit /etc/mediawiki/LocalSettings.phpand add something like this:
$wgFileExtensions = array('png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'pdf', 'txt');
Add your own logo image
- create a 135x135-pixel logo image and save as png
- copy the png file to /var/lib/mediawiki1.10/skins/common/images
- edit /etc/mediawiki1.10/LocalSettings.phpto include this line:
$wgLogo = "/mediawiki/skins/common/images/mylogo.png";
- log in as the admin user
- edit the wiki page http://localhost/mediawiki/index.php/MediaWiki:Sidebar
Lowercase Page Titles
- This helps you fix the titles of pages like "iPhone" that mediawiki automatically converts to "IPhone".
- install and enable the ParserFunctions extension:
apt-get install mediawiki-extensions (if not already installed) mwenext ParserFunctions.php
- open the page Template:Lowercase_title for editing.
- add this code:
<span>{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{lcfirst:{{PAGENAME}}}}}}</span><noinclude>
{{documentation}}
</noinclude>
This can be found on Wikipedia: http://en.wikipedia.org/w/index.php?title=Template:Lowercase_title&action=edit
- add this line to the top of each affected page:
{{lowercase title}}
Syntax highlighting
Use the GeSHi extension included with mediawiki-extensions: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
Custom edit buttons
- download the icons you want to use: http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar
- download the icons in the images tree and find out where they ended up
- open the MediaWiki:Common.js page on your wiki for editing and add something like this
if (mwCustomEditButtons) {
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "images/2/23/Button_code.png",
     "speedTip": "inline <code> tag",
     "tagOpen": "<code>",
     "tagClose": "</code>",
     "sampleText": "Insert code here"};
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "images/3/3c/Button_pre.png",
     "speedTip": "block <pre> tag",
     "tagOpen": "<pre>\n",
     "tagClose": "\n</pre>",
     "sampleText": "Insert code here"}
}
- hold down the shift key and hit refresh on the browser to get the page to completely reload
Delete History
- Make sure the php5-clipackage is installed.
- cd to /usr/share/mediawiki/maintenance
- run this:
sudo php deleteOldRevisions.php --delete
Back up the wiki
Use a command like this to dump the wiki database to a flat file:
/usr/bin/mysqldump --opt -u barney -pXXXXXXXX wikidb > /backup/wikidb.sql
May need this command in mysql to get it to work: 
grant lock tables on *.* to barney@localhost; flush privileges;
OLD
Setup
On Ubuntu, install the mediawiki package. May also want mediawiki-extensions and mediawiki-math.
https://help.ubuntu.com/community/MediaWiki
- uncomment alias line of /etc/apache2/conf.d/mediawiki1.10.conf
- restart apache2
- open a browser window and visit http://localhost/mediawiki
- fill out installation form
- move /var/lib/mediawiki1.10/config/LocalSettings.phpto/etc/mediawiki1.10/