Title

Getting MindTouch Deki Wiki working on Windows Server

This site is intended to read more like a series of instructions than a blog, so I would recommend using the Table of Contents on the right to navigate.

Wednesday, March 8, 2017

Installing Deki from Source on Windows Server

This is how you install MindTouch Core (Deki Wiki) 10.1.14 from source on Windows Server.  These instructions work with Windows Server 2016 and Windows Server 2008 R2.

Install .NET 3.5

  • For Windows Server 2016:
    • Start Server Manager.
    • Go to Manage > Add Roles and Features.
    • In the Server Roles section, just click Next.
    • In the Features section, open .NET Framework 3.5 Features and select .NET Framework 3.5 (includes .NET 2.0 and 3.0).
    • Finish the install.

  • For Windows Server 2008 R2:
    • Start Server Manager.
    • Click Features and then Add Features.
    • Open .NET Framework 3.5.1 Features and select .NET Framework 3.5.1.
    • Finish the install.

Install IIS

  • For Windows Server 2016:
    • Start Server Manager.
    • Go to Manage > Add Roles and Features.
    • In the Server Roles section, select Web Server (IIS).
      • It will ask you if you also want to install the management tools.  Do so.
    • In the Features section, just click Next.
    • In the Web Server Role (IIS) > Role Services section, open the Web Server > Application Development group and add these to the defaults:
      • CGI
      • ISAPI Extensions
      • ISAPI Filters
    • Finish the wizard to install the components.

  • For Windows Server 2008 R2:
    • Start Server Manager.
    • Go to Roles and click Add Roles.
    • In the Server Roles section, select Web Server (IIS).
    • In the Web Server (IIS) > Role Services section, in the Web Server > Application Development group, add these to the defaults:
      • CGI
      • ISAPI Extensions
      • ISAPI Filters
    • Finish the wizard to install the components.

Install MySQL

These instructions are based on MySQL 5.7.17, but that's the latest version as of this writing so they will probably work with future versions as well.

  • Download it at MySQL.com
    • Go to MySQL Community Edition > MySQL Community Server.  As of this writing it's available here.
    • Download the MySQL Installer for Windows, the MSI version.
      • It's okay that it says 32-bit.  It can install either 32-bit or 64-bit versions of the server.

  • Install MySQL
    • In Choose a Setup Type, select Custom.
    • In Select Products and Features, choose these options:
      • MySQL Servers > MySQL Server 5.7.17 - X64
      • Applications > MySQL Workbench 6.3.8 - X64
        • The workbench isn't required, but you should include it if you're going to be importing data from another Deki installation or if you want to be able to inspect the database.
    • In Check Requirements, click Execute to install the Visual C++ Runtime.
    • Continue until you get to the product configuration section.

  • Configure MySQL
    •  In the Type and Networking section:
      • Set Config Type to Server Machine.
      • Leave TCP/IP and Port Number: 3306 checked, but uncheck Open Firewall port for network access.
        • This is for accessing the database directly over the network, which we won't need.  Only Deki will access it from the current machine.
    • In the Accounts and Roles section, add a root password.
    • In the Windows Service section, leave Configure MySQL Server as a Windows Service and Start the MySQL Server at System Startup checked.
    • Everything else should be fine to leave at their defaults.  Apply the server configuration.

Install PHP


  • Install PHP
    • In the Web Server Setup section, choose IIS FastCGI.
    • In the Choose Items to Install section, add these items:
      • In Extensions:
        • Curl
        • GD2
        • Multi-Byte String
        • Mimetypec
        • MySQL
        • MySQLi
      • In Extras:
        • PEAR Install
    • Finish the install.

  • Configure PHP
    • Edit php.ini.  The installer should have created a Start menu shortcut to it in the PHP 5 group.
    • In all the examples below, make sure you change the lines that don't start with a semicolon.  Lines starting with a semicolon don't affect anything and are just examples.
    • Search for short_open_tag and set it to On
    • Search for error_reporting and set it to E_ALL & ~E_NOTICE
    • Search for max_execution_time and make sure it's at least 300.
      • I've found some operations, like viewing the very long edit history of our telephone directory, can take some time to execute.  This is the amount of time in seconds the server will let the operation run before it cancels it.  Setting it to 300 means five minutes.

Install Deki Source Files

  • Download MindTouch Core Source > Pipestone 10.1.4 at SourceForge.
    • It's in .tar.gz format, so you may need to use 7-Zip to extract it.
  • Delete everything in c:\inetpub\wwwroot.
  • Copy the contents of the "web" folder in the archive to c:\inetpub\wwwroot.
  • Also copy src\services\deki\resources\license-community.xml somewhere.  You'll need it later, but it doesn't have to be in wwwroot.
  • Give "everyone" full permission on c:\inetpub\wwwroot\config.
    • Right click on the folder in Explorer and go to Properties > Security tab > Edit button > Add button > type "everyone" > check Full Control under Allow.

Install ISAPI_Rewrite

These instructions are based on ISAPI_Rewrite 3 Build 0112.

  • Download the full or trial (not lite) version of ISAPI_Rewrite 64-bit
    • The lite version does not support [S] which is used in the configuration.  The full version costs money but there's a 45-day trial you can use first.
    • The web page only lists up to Windows Server 2012 R2 but it works on 2016.

  • Install ISAPI_Rewrite
    • The defaults are fine for everything. 

  • Start Helicon > ISAPI_Rewrite Manager
    • Click Edit.
    • Paste in these settings and click Apply:
RewriteEngine On

RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/$ /index.php?title= [L,NE]

RewriteCond %{REQUEST_URI} ^/@gui/[^.]+$
RewriteRule ^/@gui/(.*)$ /proxy.php?path=$1 [L,QSA,NE]

RewriteCond %{REQUEST_URI} ^/@api/
RewriteRule ^/@api/(.*)$ http://localhost:8081/$1 [P,L]

RewriteCond %{REQUEST_URI} !^/(@api|editor|skins|config|@gui)/
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !^/favicon\.ico$
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteCond %{REQUEST_URI} !^/deki/
RewriteCond %{QUERY_STRING} ^$ [OR]
RewriteCond %{REQUEST_URI} ^/Special:Search
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA,NE]
  • Click Apply in the Helicon Manager window and close it.

Install ImageMagick


  • Install ImageMagick
    • You can uncheck the option to add the application directory to your system path.

Configure Deki

  • Open the site in a web browser.
    • From the server it will be http://localhost.  From a different computer you would replace localhost with the server name.
  • Click Install for MindTouch Core.
  • In the Site Setup section, fill in all the information.
  • In the Configuration section, use these settings:
    • Set Superuser name to root.
    • Set Superuser password to the password you chose when you installed MySQL.
    • Set ImageMagick convert to convert.exe in the ImageMagick folder.  By default it should be C:\Program Files\ImageMagick-6.9.7-Q8\convert.exe
    • Set ImageMagick identify to identify.exe in the ImageMagick folder.  By default it should be C:\Program Files\ImageMagick-6.9.7-Q8\identify.exe
    • The rest can be left at their defaults.  It's okay for Mono and Prince to be blank.
  • You can ignore the stuff in the Your Organization section.
  • In the Confirmation section click Install MindTouch.
  • If it succeeds it will tell you to open a command prompt and do this:
cd C:\inetpub\wwwroot\config
mkdir C:\dekiwiki
copy mindtouch.deki.startup.xml C:\dekiwiki
copy LocalSettings.php C:\inetpub\wwwroot\
copy mindtouch.host.bat C:\inetpub\wwwroot\bin
cd C:\inetpub\wwwroot\bin
mindtouch.host.bat
  • After running mindtouch.host.bat and waiting for it to be ready, the text under the Continue to MindTouch button should change to "MindTouch is running!".  Click Continue to MindTouch.
  • Click Browse and upload the license-community.xml file you got from the Deki archive.  It was in src\services\deki\resources.
  • Click Activate License.
  • Click Return to MindTouch on the upper left corner of the page to get started.

Make Deki Start Automatically

Deki is running but mindtouch.host.bat won't start automatically with Windows.  This is a problem if you ever reboot the server since you'd have to remember to log in and start it again every time.  We can make Windows do this for us though.

  • Click Start and type in Task Scheduler.
  • Click Create Basic Task on the right.
  • Give it a name, like Start Deki Wiki.
  • In the Trigger section, select When the computer starts.
  • In the Action section, select Start a program.
  • In the Start a Program section, enter C:\inetpub\wwwroot\bin\mindtouch.host.bat
  • In the Finish section, check Open the Properties dialog for this task when I click Finish.
  • On the General tab, select Run whether user is logged on or not.
  • On the Settings tab, uncheck Stop the task if it runs longer than.
  • Click OK and enter your password.  It will save it so it can run the task with your account without you logging in.

Now you are finally, finally done!

No comments:

Post a Comment