Media Wiki Quick Cookbook

We've been testing mediawiki as a possible replacement for PMWiki. According to Darcy, it is more secure and easily maintainable. This page contains a hodgepodge of notes that may help other people install and test it.

Installing MediaWiki

MediaWiki uses a database to store things. So if you want to install it on our CPSC machine, you will have to go to the system's folks for now; they will set it up for you.

  • they will create a new website for you (eg., yourname.cpsc.ucalgary.ca/ ) that can contain your web content (although your old stuff won't be touched),
  • you can ssh into that account to see files, etc. via Unix
  • they will install and give you access to a new tool called CPanel that will help you manage all aspects of your web site (e.g., such as the ability to install wikis via a single button press).

Other handy things... instead of using SSH, you may want to consider filezilla which has a better interface:

Gotchas:

  • the password protection for Cpanel (and thus your site) is different from the password protection for logging into your wiki, so you will have to change both. I've found changing the password for mediawiki surprisingly painful (or cryptic), while Cpanel is very restrictive of what passwords it will allow (it checks them strongly where it doesn't allow passwords that are easily cracked).

Accessing your various accounts

Setting basic permissions

When installed, mediawiki lets anyone read and edit your site. You obviously want to start by turning off edit capabilities. To do so, you have to log onto your account via a terminal emulator, than change into the www folder (or wherever your wiki is located) and edit the file LocalSettings.php as follows. I don't know what everything does, but its a starting point. YOu can find documentation as follows

  • Everything is configured via the 'LocalSettings.php' configuration file which resides in the root of the installation (typically something like:

web2:/home/<yourname>/www/LocalSettings.php)

################################################ ## Group Permissions # Make this false if you want the site only to be readable by someone who must log in $wgGroupPermissions['*']['read'] = true; # Disable editing for everyone. $wgGroupPermissions['*']['edit'] = false; # Disable editing for users, too: by default 'user' is allowed to edit, even if '*' is not. #$wgGroupPermissions['user']['edit'] = false; # Make it so users with confirmed e-mail addresses are in the group. $wgAutopromote['emailconfirmed'] = APCOND_EMAILCONFIRMED; # Hide group from user list. $wgImplicitGroups[] = 'emailconfirmed'; # Finally, set it to true for the desired group. $wgGroupPermissions['emailconfirmed']['edit'] = true; #############################################

Setting uploads

  • In LocalSettings.php, add:

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'pdf' ); ## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: $wgEnableUploads = true;

Changing some default looks

Changing the main logo in the sidebar on all pages

While you could just specify a URL, I

  • ftped into the site,
  • under images I created a folder called 'logos'.
  • I then copied my logo image to it (e.g., mylogo.png).
  • edited LocalSettings.php to change the existing myLogo variable as follows:
    • $wgLogo = "$wgScriptPath/images/logos/mylogo.png";

Removing the discussion tab

Since I don't have discussions on my site, I did the following

Editing the Sidebar

   * Title
   ** Main Page|Home  
   ** http://grouplab.cpsc.ucalgary.ca/sketchbook|Sketching UX