Main Page | Recent changes | View source | Page history

Printable version | Disclaimers | Privacy policy

Not logged in
Log in | Help
 

HOWTO:Creating a MediaWiki Site

From NEBL

MediaWiki is the free wiki software package well known because of its use for Wikipedia.

These instructions are how I set up this NEBL site, and are specific to the server environment we have in the Department of Computer Science & Engineering at the University of Nevada, Reno. They also assume that you are configuring the wiki as a sub-site, e.g. wrapping the wiki in a non-wiki home page. If these assumptions do not apply, you will have to modify various parts of the following instructions, tips, and examples.

Contents

Installing

Ask your sysadmin for -

Back up your MySQL database

Fetch and unpack the installation kit

md5sum -b mediawiki-1.11.0.tar.gz
md5sum -b mediawiki-1.11.0.patch
tar -xzf mediawiki-1.11.0.tar.gz
mv mediawiki-1.11.0 public-wiki
pushd public-wiki
patch -p0 <../mediawiki-1.11.0.patch
chown -R :nebl *
rm ../mediawiki-1.11.0.*
more RELEASE-NOTES
more INSTALL

Base configuration

N.B. - Once you start this you will need to continue down through the Security Configuration section before you stop.

chmod a+w config
cp config/LocalSettings.php .
chown :www-data LocalSettings.php
chmod g-w LocalSettings.php
chmod o-rwx LocalSettings.php
ls -l LocalSettings.php
-rw-r----- 1 bdbryant www-data 4336 Oct 14 20:37 LocalSettings.php
chmod go-rwx config

Site Version Control

The wiki does its own version control on its content. However, it does not track changes to the configuration files. If the wiki area is a sub-site and the outer site is under version control, you might want to add LocalSettings.php to your repository before you start modifying it. (There does not seem to be any need to put the entire wiki directory under version control.)

If you have your version control repository set up to automagically update the production site whenever you check in a change, you need to make sure it leaves LocalSettings.php with the correct ownership and permissions when it is done. (I recommend setting it up that way, both as a labor saver and as a guard against accidentally leaving it with the wrong protections after changing it by hand.)

Here is an example of what to do if your site is already under SVN control:

mkdir public-wiki/
scp banyan.cse.unr.edu:/web/htdocs/nebl/public-wiki/LocalSettings.php public-wiki/
svn add public-wiki/
svn commit -m "Added the configuration file for the public wiki."
svn export --force file:///staff/bdbryant/repositories/svn/nebl-www/ /web/htdocs/nebl/
chown :www-data /web/htdocs/nebl/public-wiki/LocalSettings.php
chmod o-rwx /web/htdocs/nebl/public-wiki/LocalSettings.php

Security Configuration

Unless someone is going to monitor the wiki very thoroughly, you want to keep anonymous editing and account creation turned off. (Otherwise spammers' bots will find your site and modify it for their own purposes.)

If you did not specify your own account as the sysop during the on-line configuration, you may want to create your personal account before turning account creation off.

Now add this to LocalSettings.php:

## Account permissions
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['sysop']['createaccount'] = true;
#--
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['user']['createpage'] = true;
#--
$wgGroupPermissions['*']['delete'] = false;
$wgGroupPermissions['user']['delete'] = false;
$wgGroupPermissions['sysop']['delete'] = true;
#--
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = true;

That means that only people logged in to a wiki account can create or edit pages, and only someone logged in with sysop privileges can create an account or delete a page.

Save the file and upload it to the server right now.

Now it is locked down (I hope!), and you can continue with the customizations at your leisure. However, some of the customizations should be done before you add any content. Skim the following section before you start.

Customization

Prettifying the URLs

N.B. - Do this before you link to the site or create any content.

There are several ways to do this; see http://www.mediawiki.org/wiki/Manual:Short_URL for examples.

At cse.unr.edu, the .htaccess mechanisms will only work if your wiki is under public_html in a user's directory tree. If you have a custom URL your files are probably under /web/htdocs/, and you will have to use the following mechanism:

<Directory "/web/htdocs/nebl/">
       RewriteEngine on
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule ^wiki/(.*)$ public-wiki/index.php?title=$1 [PT,L,QSA]
</Directory>
$wgArticlePath = "/wiki/$1";

Creating Additional Namespaces

N.B. - This can also save some trouble if you do it before much content is added, but you may not know at first what kind of namespaces you will want.

A namespace is a keyword followed by a colon prefixed to an article's title. For example, this page is in the HOWTO: namespace.

The on-line MediaWiki manual lists the predefined namespaces and tells how to add your own custom namespaces.

$wgContentNamespaces[] = 100
$wgExtraNamespaces[100] = "Notes"; $wgExtraNamespaces[101] = "Notes_talk"; $wgExtraNamespaces[102] = "HOWTO"; $wgExtraNamespaces[103] = "HOWTO_talk"; $wgContentNamespaces[] = 100; $wgContentNamespaces[] = 102;

Changing the Theme

To change the default layout of the pages rendered by the wiki engine, change $wgDefaultSkin in LocalSettings.php.

Changing the Logo

Some of the themes, such as standard show a logo. The installation provides a placeholder logo that you will need to replace.

The standard them expects a PNG logo 135 pixels wide. If you vary from that very much it may not look right in the layout of rendered pages.

When you have created your new logo, point to it by changing $wgLogo in LocalSettings.php. The logo file can be outside the wiki if you wish.

Hint: For a quick fix, just use a grapics program to create an image 135 pixels wide with your site's acronym centered in the image, in color, and a transparent background. That lets you get rid of the placeholder logo with minimal trouble; you can create a custom logo when time allows.

Customizing the Sidebar

This can only be done from an account with sysop privileges.

Open the MediaWiki:Sidebar page at your site (type it in the search field of any page in the wiki), then edit it to show the desired layout. The edit will mostly consist of removing links you do not want, e.g. the link to the donation page if you are not taking donations.

If the wiki's main page is masked by a non-wiki home page, you can change "Main Page" to "Home" and link it in the usual fashion.

See http://nebl.cse.unr.edu/wiki/MediaWiki:Sidebar for an example.

Replace placeholder content

Several default pages were created by the installation but contain throw-down content that you should replace before too many people visit the site. These include various links that show up along the top, bottom, and sides of every page in the wiki, such as:

Provide a users' guide

Unless all your users are already expert MediaWiki editors, it will be useful to provide a page of links to various help and tips pages. See Site Maintenance Links for an example

Creating Accounts

See the instructions at Site_Maintenance_Links.

Retrieved from "http://nebl.cse.unr.edu/wiki/HOWTO:Creating_a_MediaWiki_Site"

This page has been accessed 2,080 times. This page was last modified 07:29, 30 October 2007. Content is available under GNU Free Documentation License 1.2.


[Main Page]
NEBL Home
Recent changes
Random page
Help

View source
Discuss this page
Page history
What links here
Related changes

Special pages
Bug reports