MediaWiki Servers

From MyWiki

Jump to: navigation, search

Contents

[edit] Server List

public
anon
read
kerberos
authn [1]
auto
account
creation [2]
self
account
creation [3]
daily
backups [4]
logon
page
HTTPS
all
pages
HTTPS
mywiki Y Y Y N Y Y N
security Y Y Y N Y Y N
whoi N Y Y N Y Y N
omf N Y Y N Y Y N
ittf N Y N N N Y Y
myproxy-sdci N Y N N N Y Y
swiki N Y N N Y Y Y
affiliates N Y Y N Y Y Y
csd-wiki N Y N N Y Y Y
lodge N Y N N Y Y Y
spc N N N N Y Y Y
nwiki N Y Y N Y Y Y
ncdir-wiki N Y N N Y Y Y
cet-wiki N Y N N Y Y Y
bio N Y N N Y Y Y


  1. In addition to the normal mediawiki authentication mechanisms.
  2. Will Mediawiki automatically create new mediawiki accounts for successfully authenticated users (via krb)? If not, then mediawiki accounts must be manually created by an administrator (or self created).
  3. Are anonymous users allowed to create their own accounts on the wiki?
  4. In addition to the normal weekly backups.

[edit] Administration Documents

[edit] Configuration Settings

[edit] To allow file uploads of any type of file

Edit /var/www/mediawiki/LocalSettings.php and set to false

$wgStrictFileExtensions = false;

[edit] To increase the maximum upload file size

The default maximum file size that can be uploaded is 2M. The error message you will receive is "The file is bigger than the server is configured to allow". To increase this to (for example) 16M:

  • Edit /etc/php.ini
post_max_size = 16M
upload_max_filesize = 16M
  • Edit /var/www/mediawiki/includes/SpecialImport.php
    Grep for the string MAX_FILE_SIZE
<input type='hidden' name='MAX_FILE_SIZE' value='16000000' />
  • Restart apache
apachectl graceful
  • If you get the following error in /var/log/messages
httpd: PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 33883271 bytes) in /var/www/mediawiki-1.7.1/includes/Sanitizer.php on line 928

then edit /etc/php.ini and increase the value for memory_limit, e.g.

memory_limit = 128M

Also see http://meta.wikimedia.org/wiki/Uploading_files

[edit] To enable keyword searches for 3 letter acronyms

  • Edit /etc/my.cnf
    Locate section [mysqld]
ft_min_word_len = 3
  • Restart MySQL
service mysqld restart
  • Rebuild index table
mysql -uroot -p
mysql> use wikidb;
mysql> repair table searchindex quick;

[edit] Problems Rendering PNG Images

If png files don't render in wiki pages, then check the MIME type of the file by looking at the description page of the file. If it says text/plain, then try the following:

  • Edit LocalSettings.php and add the following:
$wgMimeDetectorCommand = "file -bi"; 
  • then rebuilding the images:
# cd <mediawiki_install_loc>/maintenance
# php rebuildImages.php 
Processing image...
Finished image... 3 of 4 rows updated
Processing oldimage...
Finished oldimage... 2 of 2 rows updated
#
  • Also see: [1]

[edit] Navigation Customization

[edit] New Logo

See [2]

% convert -resize 135x135 NCSA-CSD-Logo.png NCSA-CSD-Logo-small.png
  • Upload the logo to the wiki using the "Upload file" option.
  • Log onto the wiki system and find where the image was saved:
$ cd /var/www/mediawiki/images/
$ find . -name  NCSA-CSD-Logo-small.png -print
./b/bc/NCSA-CSD-Logo-small.png

(The subdirectories seem to be consistent for a given filename.)

  • Edit LocalSettings.php:
# vi /var/www/mediawiki/LocalSettings.php
  • Find the line for $wgLogo and set it to the new path. ("/mediawiki" in the value is apparently short for "/var/www/mediawiki".)
 $wgLogo             = "/mediawiki/images/5/5a/Ncsa-srd-logo-small.png";

[edit] Removed Heading

  • Removed the heading from each page:
[root@security-wiki skins]# diff -c /var/www/mediawiki/skins/MonoBook.php.orig /var/www/mediawiki/skins/MonoBook.php
*** /var/www/mediawiki/skins/MonoBook.php.orig  2007-05-22 23:15:02.000000000 -0500
--- /var/www/mediawiki/skins/MonoBook.php       2007-05-22 23:16:03.000000000 -0500
***************
*** 99,105 ****
        <div id="content">
                <a name="top" id="top"></a>
                <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
-               <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?></h1>
                <div id="bodyContent">
                        <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
                        <div id="contentSub"><?php $this->html('subtitle') ?></div>
--- 99,104 ----

[edit] Cleaned up Footer

  • Cleaned up bottom of page and added UIUC copyright.
# diff -c MonoBook.php.orig MonoBook.php
*** MonoBook.php.orig   2007-05-22 23:15:02.000000000 -0500
--- MonoBook.php        2007-06-18 13:42:41.000000000 -0500
***************
*** 260,267 ****
                        <ul id="f-list">
  <?php
                $footerlinks = array(
!                       'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
!                       'privacy', 'about', 'disclaimer', 'tagline',
                );
                foreach( $footerlinks as $aLink ) {
                        if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
--- 259,267 ----
                        <ul id="f-list">
  <?php
                $footerlinks = array(
!                       'lastmod', 'viewcount',
!                        //'numberofwatchingusers', 'credits', 'copyright',
!                        //'privacy', 'about', 'disclaimer', 'tagline',
                );
                foreach( $footerlinks as $aLink ) {
                        if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
***************
*** 269,274 ****
--- 269,275 ----
  <?php                 }
                }
  ?>
+               <li>All rights reserved. Copyright 2007 Board of Trustees of the University of Illinois.</li>
                        </ul>
                </div>
  

[edit] Removed Tabs for Anonymous Users

# diff -c MonoBook.php.orig MonoBook.php
*** MonoBook.php.orig   2007-05-22 23:15:02.000000000 -0500
--- MonoBook.php        2007-06-20 15:05:04.000000000 -0500
--- 99,104 ----
***************
*** 119,125 ****
                <h5><?php $this->msg('views') ?></h5>
                <div class="pBody">
                        <ul>
!       <?php                   foreach($this->data['content_actions'] as $key => $tab) { ?>
                                         <li id="ca-<?php echo Sanitizer::escapeId($key) ?>"<?php
                                                if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
                                         ?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"><?php
--- 118,124 ----
                <h5><?php $this->msg('views') ?></h5>
                <div class="pBody">
                        <ul>
!       <?php                   foreach($this->data['content_actions'] as $key => $tab) if($this->data['loggedin']==1) { ?>
                                         <li id="ca-<?php echo Sanitizer::escapeId($key) ?>"<?php
                                                if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
                                         ?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"><?php

[edit] Removed Edit Links for Anonymous Users

# diff -c MonoBook.php.orig MonoBook.php
*** MonoBook.php.orig   2007-05-22 23:15:02.000000000 -0500
--- MonoBook.php        2007-06-20 15:11:53.000000000 -0500
***************
*** 90,95 ****
--- 90,102 ----
                if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
                <!-- Head Scripts -->
                <?php $this->html('headscripts') ?>
+                 <?php if(!$this->data['loggedin']) { ?>
+                       <style>
+                         <!--
+                         .editsection { display: none; }
+                         -->
+                       </style>
+                  <?php } ?>
        </head>
  <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
  <?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?>

[edit] Removed IP from Header

  • added to LocalSettings.php:
$wgShowIPinHeader = false;
Personal tools