Perhaps I'm making this post with a little bit of irony in that I am putting up procedures on how to create a wiki server on a page not hosted by a wiki server. Oh well, limitations on resources in my environment prevent me from hosting and maintaining a public wiki server and I haven't found the right page to dump this info on to yet. This page however was originally written up using wiki (hence the [] I'm too lazy to remove), so that's at least something.


But, a wiki server is great for maintaining generlized procedures (SOPs) for not only IT, but other departments as well. It can also be used as a documentation resource, but I personally shy away from maintaining network specifics through the wiki. This guide will lead you through not only installing MediaWiki on a Windows 2012 server (although it should be applicable for 2016 as well), but it's leading you through installing MediaWiki with BlueSpice, which is a much more user friendly version of MediaWiki with a sleeker design to it. The accompanying video that has turned Youtube into Snoozetube can be used for reference if you get stuck.

The goal of this guide is to document the step by step procedures used to install MediaWiki with BlueSpice on Windows Server 2012 and use Windows authentication and domain user accounts as Wiki accounts (single sign on).

Required Software[]

PHP 5.6.30 (Non-Thread Safe) php-5.6.30-nts-Win32-VC11-x86.zip
PHP WinCache 1.3.6.1-5.6 (Non-Thread Safe) php_wincache-1.3.6.1-5.6-nts-vc11-x86.zip
BlueSpice with installer already includes a MediaWiki 1.27 BlueSpice-free-2.27.3-installer.zip
MySQL Installer 5.7.22 mysql-installer-community-5.7.22.1.msi
GNU Diff3

diffutils-2.8.7-1-bin.zip

Visual C++ Redistributable for Visual Studio 2012 Update 4 (x86)

vcredist_x86.exe

Visual C++ Redistributable for Visual Studio 2015 (x64)

vc_redist.x64.exe

Visual C++ Redistributable for Visual Studio 2013 (x64)

vcredist_x64.exe

Microsoft .NET Framework 4.5.2 (Offline Installer)

NDP452-KB2901907-x86-x64-AllOS-ENU.exe

Auth_remoteuser for MediaWiki 1.27

Auth_remoteuser-REL1_27-89faa0c.tar.gz


Optional Software
[]

Notepad++ npp.7.5.6.Installer.exe
WinRAR winrar-x64-560.exe

Before you begin[]

  1. Download all the software to the server you will be installing on
  2. Change the view settings for the file extensions
    1. Go to Control Panel - Folder Options
    2. Choose View' Tab
    3. uncheck Hide extensions for known file types and press OK
  3. Disable IE Enhanced Security Configuration
    1. Go to Server Manager
    2. Select Local Server
    3. Look for IE Enhanced Security Configuration and click On next to it
    4. Turn both the Users and Administrators option to Off and click OK
  4. Install optional software (if you want to make your life easy)
    1. Notepad++, WinRAR
  5. Install Microsoft Visual C++ 2012 Redistributable - vcredist_x86
  6. install Microsoft .NET Framework 4.5.2

Internet Information Services (IIS)[]

To install IIS follow the steps below:

  1. Open Server Manager, select Roles
  2. Add the Web Server role and include the following:
    1. Common HTTP Features -> HTTP Redirection
    2. Application Development -> CGI
    3. Web Server -> Security -> Windows Authentication
  3. Open Internet Explorer and access http://localhost, it should bring up the IIS splash page.

Install and configure PHP[]

  1. Unzip the PHP non-threadsafe installation file to c:program files (x86)php (create the folder if necessary)
  2. Copy php.ini-development in the C:Program files (x86)php directory and rename the copied file to php.ini
  3. Open php.ini in Notepad++ and remove the ; in front of the following, change the value where in bold and save:
    cgi.fix_pathinfo=1
    fastcgi.impersonate = 1
    cgi.force_redirect = 0
    fastcgi.logging = 0
    extension_dir = "ext"
    extension=php_curl.dll
    extension=php_gd2.dll
    extension=php_intl.dll
    extension=php_ldap.dll
    extension=php_mbstring.dll
    extension=php_mysql.dll
    extension=php_mysqli.dll
    extension=php_tidy.dll
    date.timezone = America/New_York
  4. Search for the following and update the values:
    max_execution_time = 120
    post_max_size=32M
    upload_max_filesize=100M
    session.save_path="c:program files (x86)phptmp"
    upload_tmp_dir="c:program files (x86)phptmp"
  5. Create the tmp folder; path: "c:program files(x86)PHPtmp"
    1. Give modify permissions to the folder to IUSR and Authenticated Users

Install WinCache[]

  1. Open php_wincache-1.3.6.1-5.6-nts-vc11-x86.zip and extract/copy php_wincache.dll
  2. Paste php_wincache.dll under the c:program files(x86phpext directory
  3. Add the following lines to php.ini:
    [PHP_WINCACHE]
    extension=php_wincache.dll
  4. Close and save the php.ini file

Verify PHP installation[]

  1. Execute c:program files (x86)phpcgi-php.exe
    1. If a blank command prompt window pops up, PHP and WinCache was installed correctly.
    2. Else, resolve any errors prior to moving forward

Configure IIS[]

Set the default document to index.php[]

  1. Open Internet Information Services (IIS) Manager, select and highlight the server name from the list.
  2. In the window to the right, select Default Document
  3. Select Add and type index.php then OK
  4. If necessary, highlight index.php and choose Move Up from the Actions side panel until index.php is at the top.
  5. To make things easy, set the permissions for users in the c:inetpubwwwrootfolder to modify

Configure FastCGIModule mapping[]

  1. Open Internet Information Services (IIS) Manager, select and highlight the server name from the list.
  2. In the window to the right, select Handler Mappings
  3. Select Add Module Mapping from the right hand Actions bar
  4. Fill in the following:
    Request Path: *
    Module: FastCgiModule
    Executable (optional): c:program files (x86)phpphp-cgi.exe
    Name: PHP Via FastCGI
  5. after clicking OK, click Yes to add the entry to the FastCGI collection
  6. Stop and Start IIS
    1. Run cmd as an admin
    2. type iisreset and enter

Verify that PHP is working with IIS[]

  1. Create a new file in C:inetpubwwwroot named phpinfo.php
  2. Edit phpinfo.php in notepad and add in the following lines:
  3. Save and close the file
  4. On the web server, open Internet Explorer and access http://localhost/phpinfo.php. It should bring up a PHP Information page
  5. Confirm that the wincache section exists

MySQL[]

To install MySQL follow the steps below:

  1. Launch the installer, select Server only.
    1. After the installer finishes installation you will be prompted to run the MySQL Server Instance Configuration Wizard.
    2. Select Server Machine, then click Next
    3. Confirm Enable TCP/IP Networking and Add firewall exception for this port are checked, then click Next.
    4. Enter in root password, then click Next.
    5. Confirm Install as Windows Service is checked, then click Next.

GNU diff3 Installation (Optional)[]

Install GNU diff3 files.

  1. Create directory GnuWin in C:Program Files (x86).
  2. Navigate to DiffUtils website.
  3. Download the file diffutils-2.8.7-1-bin.zip.
  4. Extract to the C:Temp directory.
  5. Copy the bin directory to C:Program Files (x86)GnuWin.
  6. Navigate to File website.
  7. Download the file file-5.03-bin.zip.
  8. Extract to the C:Temp directory.
  9. Copy the bin directory to C:Program Files (x86)GnuWin.
  10. Update the LocalSettings.php located in C:inetpubwwwroot[media wiki name].

Original LocalSettings.php

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "";

Updated LocalSettings.php

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "C:/Program Files (x86)/GnuWin/bin/diff3.exe";
# Use external mime detector
$wgMimeDetectorCommand = "C:/Program Files (x86)/GnuWin/bin/file.exe -bi"; 

Common Errors[]

  • No styling when installing MediaWiki: Set the permissions for the temp directory of windows (C:WindowsTemp) and add IUSR with modify privileges.
  • IIS 500 Error code: Install the Microsoft Visual C++ Redistributable.

Install MediaWiki-BlueSpice[]

Note: in these procedures, we are installing BlueSpice into the default wwwroot directory on the C Drive. However, it is recommended that a different local drive (separate from the OS drive). This directory will accept uploaded files, images, and videos, so it may end up taking a lot of space in a production environment. Don't want ti killing your server when it gets to max capacity

  1. Unzip the contents of BlueSpice installer file to c:inetpubwwwroot
    1. Ensure that it is not extracted to a subfolder under wwwroot
  2. Rename the following files and directories:
    c:inetpubwwwrootextensionsBlueSpiceFoundationdata.template
    to
    c:inetpubwwwrootextensionsBlueSpiceFoundationdata
    -----
    c:inetpubwwwrootextensionsBlueSpiceFoundationconfig.template
    to
    c:inetpubwwwrootextensionsBlueSpiceFoundationconfig
    -----
    c:inetpubwwwrootLocalSettings.BlueSpice.php.template
    to
    c:inetpubwwwrootLocalSettings.BlueSpice.php
  3. Set write permissions for IUSR to include Modify on the following directories:
    c:inetpubwwwrootcache
    c:inetpubwwwrootimages
    c:inetpubwwwrootextensionsBlueSpiceFoundationdata
    c:inetpubwwwrootextensionsBlueSpiceFoundationconfig

Create MediaWiki-BlueSpice LocalSettings.php file[]

  1. Open Internet Explorer and navigate to http://(yourserverFQDN)/mw-config/index.php
  2. For Language, Select Language and Continue
  3. For Welcome to MediaWiki, Verifiy everything is installed correctly and Continue
    1. GNU diff3 might be not found, it will be resolved later in this task
  4. For Connect to Database, Optionally you can change the database name here, or leave it as default
  5. Enter the root database password (or other user name) that you created when installing MySQL
  6. For Database Settings, Keep with defualts for the Database settings, continue
  7. For Name, Name the Wiki and define a local admin account (email does not need to be used)
    1. Password needs to be complex, ensure you write this username and password down!
  8. For Options, Select license type or keep with defaults and Continue
  9. Download the LocalSettings.php and move or copy it to the c:inetpubwwwroot directory

Verify MediaWiki Installation[]

  1. From an internet browser, go to http://(yourserverFQDN)/installcheck.php
  2. further requirements and information for the installation as well as occuring errors (e.g. missing permissions) will be displayed there.
  3. If everything is alright (indicated by the green OK) you can go on with the setup of BlueSpice.

Copy in Additional Extensions[]

  1. Extract the contents of the Auth_remoteuser*.tar.gz file using WinRAR to c:inetpubwwwrootextensions
  2. Extract the contents of the CategoryTree*.tar.gz file using WinRAR to c:inetpubwwwrootextensions

Configure BlueSpice[]

  1. Open c:inetpubwwwrootLocalSettings.php in a text editor (Notepad++ is recommended)
  2. Scroll down to the bottom of the file and append the following:
unset ($wgFooterIcons['poweredby']);
$wgShowIPinHeader = false;

$wgTmpDirectory = "{$IP}/cache" ;


$wgUploadPath = "{$wgScriptPath}/images";
$wgUploadDirectory = "{$IP}/images";

#part of allowing for paths to files on the networks using ParseFunctions
$wgPFEnableStringFunctions = true;
array_push($wgUrlProtocols, "file://");

#Default Permissions (those not logged in cannot read anything besides the main page
$wgGroupPermissions['*']['read'] = false;
$wgWhiteListRead = array(
	"Main Page", "MediaWiki:Common.css", "MediaWiki:Common.js"
	);
	
#Default Permissions (those not logged in cannot read anything besides the main page
$wgGroupPermissions['*']['read'] = false;
$wgWhiteListRead = array(
	"Main Page", "MediaWiki:Common.css", "MediaWiki:Common.js"
	);
	
#Extensions
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'EmbedVideo' );
$wgUseAjax = true;


#Authentication
wfLoadExtension( 'Auth_remoteuser' );


$wgAuthRemoteuserUserName = getenv( 'LOGON_USER' );
$wgAuthRemoteuserUserNameReplaceFilter = ['DOMAIN\' => '','@DOMAIN.NET

#Edit the DOMAIN and DOMAIN.NET to match your domain name
#Search for and change the line with '''$wgDiff3''' to:
#:$wgDiff3 = "C:Program Files (x86)GnuWin32binsed.exe";

==Update the Database==
#Open '''cmd''' as an administrator (run as admin)
#Execute the following:
#:cd c:inetpubwwwroot
#:"c:program files (x86)phpphp.exe" maintenance/update.php
#The output should look like this:
(...)
Creating bs_whoisonline table...ok
(...)
Creating bs_saferedit table...ok
(...)
...done.

Make your domain user account a Wiki admin[]

At this stage of the install, only the user account created during the installation (local to the Wiki) is an admin. Windows Authentication will need to be enabled and Anonymous authentication disabled. Auth_Remoteuser will prevent the use of the built in admin account, but will create a Wiki user account for the windows login used. Once this account is created and cached, anonymous access will need to be reenabled so the wiki admin account can login and set the domain user account as an admin. After this is done, anonymous authentication will be set to disabled again and Windows Authentication used.

  1. Open Internet Information Services (IIS) Manager, expand sites and highlight Default Web Site
  2. Open Authentication in the window to the right
  3. Disable Anonymous Authentication
  4. Enable Windows Authentication
  5. Using Internet Explorer, open the wiki site http://(yourserverFQDN)/index.php
  6. Depending on your group policy, it may prompt you to login through a Windows Authentication window
  7. Login with the domain user account you want to make an admin
  8. If MediaWiki installed correctly, you should see your user name as the user in the top rightcorner
    1. This may be the first time opening this page, and there is a high probability there are errors. Restart the server if there is and conduct further troubleshooting if neccesary
  9. Close the browser and go back to IIS
  10. Enable Anonymous Authentication
  11. Disable Windows Authentication
  12. Using Internet Explorer, open the wiki site http://(yourserverFQDN)/index.php
  13. Login using the Wiki account created during the initial installation
    1. This should be from the login page of the wiki page itself, not an external prompt

Fix BlueSpice Image not populating bug[]

A bug has been identified in BlueSpice where when uploading a picture or file the progress wheel eternally spins and says loading. This will fix that issue.

  1. Open MediaWiki and login using a wiki admin account
  2. Navigate to http://(yourserverFQDN)/index.php?title=MediaWiki:Common.js
  3. Edit the page and add the below (if you cannot edit, then you're not an admin)
mw.loader.using ( 'mediawiki.Title' );
  1. save the edit

-THIS ENDS THE DEFAULT INSTALLATION


-

Edit the Appearance[]

The following are all optional and will change the page design.

Insert Classification header[]

  1. Open C:inetpubwwwrootextensionsBlueSpiceFoundationincludesskinsBsBaseTemplate.php in a text editor
  2. Search for if($this->data['bs_navigation_sites']) (might be around line 646)
  3. Under the if($this block and above $aOut = ;, insert the following:
$aOut[] = '<br><br>';
$aOut[] = '<div id="securitybanner" style="text-align: left; color: black; font-size: 10pt;">ANYONE USING THIS SYSTEMS EXPRESSLY CONSENTS TO MONITORING'; $aOut[] = '<br /> Highest Possible Classification is: <strong style="color: green;">UNCLASSIFIED</strong>'; $aOut[] = '</div>';
  1. Change the colors, messages and classification to what is appropriate

Insert Classification Footer[]

  1. Open C:inetpubwwwrootextensionsBlueSpiceFoundationincludesskinsBsBaseTemplate.php in a text editor
  2. Search for if (count($aFooterIcons) > 0):
  3. Under the $aFooterIcons code block (after the line with), insert the following lines:
<div id="Wiki-Footer" style="text-align: center; font-size: 10 pt;">Use of this system authorized or unauthorized, constitutes consent to monitoring of this system. Unauthorized use may subject you to criminal prosecution. 
<br />Evidence of unauthorized use collected during monitoring may be used for administrative, criminal or other adverse actions. 
<br />Highest Possible Classification is: <strong style="color: green;">UNCLASSIFIED</strong>
</div>
  1. Change the colors, messages and classification to what is appropriate

Change the background image[]

  1. Create a png file that measures about 300px x 300px
    1. The background of the png should be transparent
  2. Copy the png file to C:inetpubwwwrootskinsBlueSpiceSkinresourcesimagesdesktop
  3. Open C:inetpubwwwrootskinsBlueSpiceSkinresourcesscreen.layout.less in a text editor
  4. Search for background:url
  5. Change bs-lo.png to the name of your png file

Change center to left

    1. Example: background:url(images/desktop/MyPic.png) no-repeat left top #F4F4F4;
  1. Add the following below the background:url line:
    background-attachment:fixed;
  2. Save the file

Work the navigation pane around the background[]

  1. Open C:inetpubwwwrootskinsBlueSpiceSkinresourcesscreen.layout.less in a text editor
  2. Edit the #bs-nav-sections and add edit it to look like below:
#bs-nav-sections {
	position: absolute;
	top: 308px;
	left: 10px;
	width: @bs-width-navcol;
}

[]

  1. On the Wiki page as a wiki admin, go to the Sprocket on the left navigation pane and Preferences
  2. Expand BlueSpice
  3. Clear Logo path
  4. Click Save at the bottom of the page

Allow MP4 uploads[]

  1. On the Wiki page as a wiki admin, go to the Sprocket on the left navigation pane and Preferences
  2. Expand BlueSpice
  3. Press the + sign under Allowed file extensions
  4. Type MP4 then OK
  5. Click Save at the bottom of the page

Set Wiki Edit as the default editing style[]

  1. On the Wiki page as a wiki admin, go to the Sprocket on the left navigation pane and Preferences
  2. Expand Visual editor
  3. Uncheck Use WYSIWYG editor by default
  4. Click Save at the bottom of the page

Change the Width of the Page[]

  1. By default, the BlueSpice skin is limited to a width of 1222px that doesn't adjust with the window. It is preferrable that it does adjust. This is optional.
  2. Open C:inetpubwwwrootskinsBlueSpiceSkinskin.json in a text editor
  3. Look for bs-width-page and change the value to auto
  4. Should look like this:
"bs-width-page": "auto",
  1. Save and close
  2. Edit the DOMAIN and DOMAIN.NET to match your domain name
  3. Search for and change the line with $wgDiff3 to:
    $wgDiff3 = "C:Program Files (x86)GnuWin32bindiff3.exe";

Update the Database[]

  1. Open cmd as an administrator (run as admin)
  2. Execute the following:
    cd c:inetpubwwwroot
    "c:program files (x86)phpphp.exe" maintenance/update.php
  3. The output should look like this:
(...)
Creating bs_whoisonline table...ok
(...)
Creating bs_saferedit table...ok
(...)
...done.

Make your domain user account a Wiki admin[]

At this stage of the install, only the user account created during the installation (local to the Wiki) is an admin. Windows Authentication will need to be enabled and Anonymous authentication disabled. Auth_Remoteuser will prevent the use of the built in admin account, but will create a Wiki user account for the windows login used. Once this account is created and cached, anonymous access will need to be reenabled so the wiki admin account can login and set the domain user account as an admin. After this is done, anonymous authentication will be set to disabled again and Windows Authentication used.

  1. Open Internet Information Services (IIS) Manager, expand sites and highlight Default Web Site
  2. Open Authentication in the window to the right
  3. Disable Anonymous Authentication
  4. Enable Windows Authentication
  5. Using Internet Explorer, open the wiki site http://(yourserverFQDN)/index.php
  6. Depending on your group policy, it may prompt you to login through a Windows Authentication window
  7. Login with the domain user account you want to make an admin
  8. If MediaWiki installed correctly, you should see your user name as the user in the top rightcorner
    1. This may be the first time opening this page, and there is a high probability there are errors. Restart the server if there is and conduct further troubleshooting if neccesary
  9. Close the browser and go back to IIS
  10. Enable Anonymous Authentication
  11. Disable Windows Authentication
  12. Using Internet Explorer, open the wiki site http://(yourserverFQDN)/index.php
  13. Login using the Wiki account created during the initial installation
    1. This should be from the login page of the wiki page itself, not an external prompt

Fix BlueSpice Image not populating bug[]

A bug has been identified in BlueSpice where when uploading a picture or file the progress wheel eternally spins and says loading. This will fix that issue.

  1. Open MediaWiki and login using a wiki admin account
  2. Navigate to http://(yourserverFQDN)/index.php?title=MediaWiki:Common.js
  3. Edit the page and add the below (if you cannot edit, then you're not an admin)
    mw.loader.using ( 'mediawiki.Title' );
  4. save the edit

-THIS ENDS THE DEFAULT INSTALLATION


-

Edit the Appearance[]

The following are all optional and will change the page design.

Insert Classification header[]

  1. Open C:inetpubwwwrootextensionsBlueSpiceFoundationincludesskinsBsBaseTemplate.php in a text editor
  2. Search for if($this->data['bs_navigation_sites']) (might be around line 646)
  3. Under the if($this block and above $aOut = ;, insert the following:
$aOut[] = '<br><br>';
$aOut[] = '
ANYONE USING THIS SYSTEMS EXPRESSLY CONSENTS TO MONITORING'; $aOut[] = '
Highest Possible Classification is: UNCLASSIFIED'; $aOut[] = '
';
  1. Change the colors, messages and classification to what is appropriate

Insert Classification Footer[]

  1. Open C:inetpubwwwrootextensionsBlueSpiceFoundationincludesskinsBsBaseTemplate.php in a text editor
  2. Search for if (count($aFooterIcons) > 0):
  3. Under the $aFooterIcons code block (after the line with), insert the following lines:
 
  1. Change the colors, messages and classification to what is appropriate

Change the background image[]

  1. Create a png file that measures about 300px x 300px
    1. The background of the png should be transparent
  2. Copy the png file to C:inetpubwwwrootskinsBlueSpiceSkinresourcesimagesdesktop
  3. Open C:inetpubwwwrootskinsBlueSpiceSkinresourcesscreen.layout.less in a text editor
  4. Search for background:url
  5. Change bs-lo.png to the name of your png file

Change center to left

    1. Example: background:url(images/desktop/MyPic.png) no-repeat left top #F4F4F4;
  1. Add the following below the background:url line:
    background-attachment:fixed;
  2. Save the file

Work the navigation pane around the background[]

  1. Open C:inetpubwwwrootskinsBlueSpiceSkinresourcesscreen.layout.less in a text editor
  2. Edit the #bs-nav-sections and add edit it to look like below:
#bs-nav-sections {
	position: absolute;
	top: 308px;
	left: 10px;
	width: @bs-width-navcol;
}

Remove the BlueSpice Logo[]

  1. On the Wiki page as a wiki admin, go to the Sprocket on the left navigation pane and Preferences
  2. Expand BlueSpice
  3. Clear Logo path
  4. Click Save at the bottom of the page

Allow MP4 uploads[]

  1. On the Wiki page as a wiki admin, go to the Sprocket on the left navigation pane and Preferences
  2. Expand BlueSpice
  3. Press the + sign under Allowed file extensions
  4. Type MP4 then OK
  5. Click Save at the bottom of the page

Set Wiki Edit as the default editing style[]

  1. On the Wiki page as a wiki admin, go to the Sprocket on the left navigation pane and Preferences
  2. Expand Visual editor
  3. Uncheck Use WYSIWYG editor by default
  4. Click Save at the bottom of the page

Change the Width of the Page[]

  1. By default, the BlueSpice skin is limited to a width of 1222px that doesn't adjust with the window. It is preferrable that it does adjust. This is optional.
  2. Open C:inetpub\wwwroot\skins\BlueSpiceSkin\skin.json in a text editor
  3. Look for bs-width-page and change the value to auto
  4. Should look like this:
    "bs-width-page": "auto",
  5. Save and close

Change the Width of the Content Column[]

  1. The content will be limited from extending out by about 120 or so pixels on the right side. This will fix it. This is optional.
  2. Open C:inetpubwwwrootskinsBlueSpiceSkinresourcesscreen.layout.less in a text editor
  3. Look for bs-application and change the padding to 0px 30px 0px 0px
  4. Remove float:left;
  5. Should look like this:
    padding:0px 30px 0px 0px;
  6. Save and close

Got something you would like to contribute? Use Facebook to add your comments here!

blog comments powered by Disqus, blog itself powered by MiniBlog