Creating a New MediaWiki Community

From MontCo MediaWiki

Jump to: navigation, search

Contents

Create a New MediaWiki Community

To create a new community, you must have administrative rights to the physical MontCo Wiki Servers. If you do not, you will have to create a request and send it to someone who does. Once you have physical access to the machine, execute the following steps.

Log On to wiki.montcopa.org

Log Onto the physical Wiki Server (wiki.montcopa.org) in the server room or through remote connect

Copy Template Directory

Using the windows explorer, Copy the Template directory C:\Inetpub\wwwroot\Wiki\WikiMedia and give it the name of the directory you want to use. You can do a simple cut and paste the rename the directory to do this. (Example MyWiki). You should also delete anything under the images subdirectory - files not needed

Remove old localsettings.php

Delete the file 'localsettings.php' from the copied directory. This will cause MediaWiki to start a new configuration process

Create a New Virtual Directory that Corresponds to the New Physical Directory You Just Made

image:IIS Wiki Setup.GIF
  1. Go into the IIS Services (administrative tools->Internet Information Services)
  2. Right Click on the 'Wiki' Virtual Web and Create a new Virtual Directory (all wikis are currently under the overall wiki ('Wiki')
    • Right Click on New->Virtual Web . . .
      • Give it the name you want reference in the URL
      • Point it to the physical directory you just created

Modify New Virtual Directory Properties

Edit the New Virtual Directory Properties by right clicking on it in the IIS Service list and modify the following properties (the first 2 might already be done, but verify and/or correct anyway):

  1. Local Path - Change to the directory you created above
  2. Application Name - Probably same as the virtual site (in this example, MyWiki)

image:Update Virtual Web Properties.GIF

Define the Top-Level Document for Web Site

image:StartPages.GIF

Assign the default page for the wiki by clicking on the "Documents" tab and add the file "index.php", then move it to the top:

Create Image/File Directory - Optional, use if need to restrict access to images/files

You should use this only if you need to restrict access to uploaded files and images.

Step 1. Create New Virtual Directory for Images/Files.

Use the create virtual directory wizard in IIS Manager. The virtual directory and the physical directory should have the same name. Use the create new directory option in the wizard.

Step 2. Still in IIS Manager, right click on the new virtual directory->Properties select the 'Virtual Directory' tab and change the 'The content for this resource should come from:' to 'A redirection to a URL'. Fill in the 'Redirect To:' with the URL to img_authNS in your MediaWiki.

Example:

http://wiki.yourwiki.org/MyWiki/img_auth.php

Step 3. You will have to add the directory and path into your [newname]custom.php as follows:

$wgUploadPath = "/MyWikiImg";
$wgUploadDirectory = "c:\inetpub\wwroot\MyWikiImg";

For detailed instructions for this optional configuration, see Image Authorisation

Configure the Wiki

MediaWiki has a crude self-configuration capability that is initiated when the localsettings.php file. If the file is missing, it will start from scratch. The steps are as follows (once you delete localsettings.php):

  1. Start the wiki in your web browser (e.g. http://wiki.montopa.org/[NewWiki] and the configuration script will run.
  2. Set super user on and use the MySQL root user and password to create database.
  3. Change user to wikiadmin in configuration (needed to create a new database in the MySQL Database) and get password for this user from administrator (required)
  4. The configuration program will run and produce a file in the config directory (localsettings.php). Before you click on the 'goto here' in the configuration page after you hit submit, copy this file to the wiki root directory.
  5. if you are using Semantic MediaWiki (SMW), you will also have to perform these steps:
    1. For some reason, I haven't been able to allow the creation of new tables under the standard wiki admin and get a protections error if I do not change the AdminSettings.php user to the MySQL root user for the SMW Setup script.
    2. under extensions/SemanticMediaWiki/Maintenance, run "php SMW_setup.php"
    3. change AdminSettings.php back to the wikiadmin password (leaving the MySQL root id and password in a text file is a VERY bad idea).

Modify Rights, Extensions, and Various Settings

We usually add some custom extensions and configurations that are pretty common across all the MontCo wikis by adding the following line above the close line in the localsettings.php file ('?>).

require_once("$IP/extensions/[newname]local.php");

Where 'newname' is substituted by the name of the new wiki you are creating.


Rename extensions/'cleanlocal.php' to extensions/[newname]custom.php

Where 'newname' is substituted by the name of the new wiki you are creating.

This is a blank template copy for all MontCo MediaWiki sites. Renaming it creates the new, un-customized configuration for this site.

Modify Privileges and/or Default Skins in [newname]custom.php

Most of the MontCo specific changes and configurations occur in a standard set of extensions and in the [newname]custom.php file. These include which extensions can/should be used, additional namespaces and/or role groups, and many other custom configurations.

You should also modify the desired privileges and/or default skins (a sample is in extensions/wikicustom.php)

Modifying rights and namespaces is discussed elsewhere, but you should at least update the following line:

$wgNewUserNotifEmailTargets = array("[wikimaster]@montcopa.org");

Add the Ability to Query External Databases

The Semantic MediaWiki has the ability to query external databases via the External Data Extension and incorporate the information directly into the wiki.

For details on how to do this see here.

Start Up the New Wiki

With the changes made and saved, you can now start the wiki. If you left up the configuration script from the MediaWiki configuration process, click on the last hyperlink and the new Wiki should start up.

Set Privileges for Admin

The County has a specific administrative user for the MySQL server. If you have designated this user (via AdminSettings.php), you need to go into MySQL server and set that administrative user ID to have all privileges for the new catalog for this wiki.

Setup SemanticMediaWiki(SMW) (optional)

If you are using SMW, you need to go into the extension and execute the SMW_Setup.php file:

extensions\SemanticMediaWiki\maintenance>php SMW_setup.php

Wiki Customizations

There are several modifications that make the wiki easier to use that can be done in a single export/import.

Copy the following exactly, then go to Special:Export (this Wiki) and paste into the edit box. Click export, then use your browser to save file as [whatever you'd like on your local machine].

MediaWiki:Addsection
MediaWiki:common.js
MediaWiki:createarticle
MediaWiki:edithelppage
MediaWiki:newusernotifbody
MediaWiki:Loginreqpagetext
MediaWiki:Sidebar
MediaWiki:welcomecreation
Template:Tbl
Template:TblStyle
Template:TblHdr
Template:RowHdr
Template:!
Template:Create System Info Form
Template:Create Department Form 
Template:CreateRosterForm 
Template:CreateSiteDeployment
Template:CreateTaskForm
Template:CRForm
Template:CurrentProjectListForm
Template:CurrentTaskForm 
Template:IssueForm
Template:MakeNewStrategicProject
Template:NewIssueList
Template:Procurement
Template:Project Template
Template:SiteDeploymentForm
Template:SiteDeploymentRow
Template:TaskForm
Template:TeamRosterForm 
Template:TeamRosterRow
Template:SystemInfo

Go to the new wiki, then use Special:Import, browse for the file you just saved, and click import - it will take care of everything for you and tell you what was updated.

For a complete current list of templates used for Collaborative Development (at MontCo), check here.

Whitelist for Un-Approved Access

Make sure you've "whitelisted" those pages necessary to self-register and confirm users (Case sensitive):

$wgWhitelistRead = array( "Main Page","Special:Userlogin","Special:ConfirmEmail","Special:UserLogout","Special:Invalidateemail","-",

Make Site SSL (Windows)

There might be a better way than this, but using IIS, the procedure is to go in and add a custom error message for error 403;4 HTML redirect page (you can't use a script here for some reason).

Step 1 - Create an HTML file that redirects to the https: of your site and put it in the base directory.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>The page must be viewed over a secure channel</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=https://wiki.yourwiki.org/YourWiki">
</HEAD><BODY></BODY></HTML>
Step 2 - Go into IIS Manager and properties for the wiki, select the "custom errors" messages tabe, then select the custom error message 403;4 Image:SSLCustomErrorSetup.JPG
Step 3 - Set error message 403;4 to point to the redirect file created in step 1 Image:SSLErrorMsgRedirect.JPG
Step 4 - Go to the "Directory Security" tab and click on the "edit" button in the Secure Communications Section. Then click on "Require Secure Channel(SSL)" Image:SSLSetup.JPG

OpenID Installation

Installing OpenID (at least using the is a complex process including:

  • You have to manually create the new tables and index by going into the MySQL query tool and executing the commands found in openid_table.sql
  • Load the GMP extension (required for OpenID) add the following to php.ini
[gmp]
extension=php_gmp.dll
  • Load the PHPUnit using command line:
pear install PHPUnit
pear install HTML_Common
  • Move the Auth directory to c:\Program Files\PHP\pear (This would not be necessary if I could find a valid OpenID pear package)
  • Modify Auth/Yadis/ParanoidHTTPFetcher.php:
# Added from instructions at http://community.elgg.org/pg/pages/view/204143/
			curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0); 
			curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
# end Add
Personal tools