Table of Contents

DokuWiki with IIS

This is for people who want to use DokuWiki on a Windows machine with IIS webserver (Windows 2000, Windows XP or Windows Server 2003, 2008)

IIS6 and Prior

Install PHP

(Just install and leave the setting 'download and install FastCGI' and it will auto-detect fast-cgi on your System)

Configure IIS

  1. Extract the DokuWiki archive
  2. Rename the dokuwiki-YYYY-MM-DD directory to dokuwiki (or whatever else you like) and move it to:
    • BEST Practice is to put it somewhere other than your “system” drive, “D:\dokuwiki”. This is for security and mitigating the chance of a “disk full” condition on this drive.
    • Somewhere below your new webserver documentroot, e.g. c:\inetpub\wwwroot\dokuwiki
    • Secure all the directories as explained at the step 2 of the main Install page.
  3. Configure IIS (do one of these):
    • Virtual-Directory in an existing website like “www.YourSite.com/wiki”: so make sure to setup a Virtual Directory mapping to the wiki-code-location
    • New Website like “wiki.YourSite.com”: so add an new website-Config in the IIS and set the Root-Directory to the wiki-code-location
  4. Browse to the dokuwiki/ directory and Check the properties of the data/ folder. Ensure that the Internet Guest Account (IUSR_computername) or the appropriate web server account (or web server group like IIS_WPG) has Folder level “Write” permissions to the data/ folder.
  5. The wiki installer should now be available at http://localhost/dokuwiki/install.php

NOTES

IIS7/10

Install PHP

Configure IIS

  1. Extract the DokuWiki archive
  2. Rename the dokuwiki-YYYY-MM-DD directory to dokuwiki (or whatever else you like) and move it to:
    • BEST practice is to put it somewhere other than your system drive(e.g. D:\dokuwiki). This is for security and to mitigate the chance of a disk full condition on this drive.
    • However you can also put it somewhere below your new webserver documentroot, (e.g. c:\inetpub\wwwroot\dokuwiki)
  3. Secure all the directories as explained at the step 2 of the main Install page.
    • You will have to give the IUSR account read & execute permissions to the website, as it is not there by default.
      • In IIS Manager left click the site name
      • Click “Edit Permissions” in the Actions pane OR right click and choose “Edit Permissions” from the shortcut menu.
      • Click the Security tab
      • Click the Edit button
      • Click the Add button
      • Click the Locations button and choose the local server name
      • Now type in IUSR and click OK, and OK again.
  4. Configure IIS (do one of these):
    • Virtual-Directory in an existing website like “www.YourSite.com/wiki”: so make sure to setup a Virtual Directory mapping to the wiki-code-location
    • New Website like “wiki.YourSite.com”: so add an new website-Config in the IIS and set the Root-Directory to the wiki-code-location
  5. Browse to the dokuwiki/ directory and Check the properties of the data/ folder. Ensure that the Internet Guest Account(IUSR), the appropriate web server account or Server Group(IIS_IUSRS) has Folder level “Write” permissions to the data/ folder. See above for instructions.
  6. Browse to the dokuwiki/ directory and ensure that the Internet Guest Account(IUSR), the appropriate web server account or Server Group(IIS_IUSRS) has Folder level “Write” permissions to the conf/ folder. See above for instructions.
    • conf/
    • lib/plugins (if you don't do this, you will see the warning message in the Extension Manager)
  7. The wiki installer should now be available. Depending on how you installed it you can find it at http://localhost/dokuwiki/install.php OR http://(wiki site name)/install.php
  8. Browse to the dokuwiki/ directory and delete the install.php file.

Rewrite

Enable url rewriting and insert appropriate set of rules:

<rewrite>
<rules>
 
<rule name="rule 1C" stopProcessing="true">
	<match url="^_media/(.*)" />
	<action type="Rewrite" url="/lib/exe/fetch.php?media={R:1}" appendQueryString="true" />
</rule>
<rule name="rule 2C" stopProcessing="true">
	<match url="^_detail/(.*)" />
	<action type="Rewrite" url="/lib/exe/detail.php?media={R:1}" appendQueryString="true" />
</rule>
<rule name="rule 3C" stopProcessing="true">
	<match url="^_export/([^/]+)/(.*)" />
	<action type="Rewrite" url="/doku.php?do=export_{R:1}&amp;id={R:2}" appendQueryString="true" />
</rule>
<rule name="rule 4C" stopProcessing="true">
	<match url="^$" />
	<action type="Rewrite" url="/doku.php" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
           </conditions>
</rule>
<rule name="rule 5C" stopProcessing="true">
	<match url="(.*)" />
	<action type="Rewrite" url="/doku.php?id={R:1}" appendQueryString="true" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
</rule>
<rule name="rule 6C">
	<match url="^index.php$" />
	<action type="Rewrite" url="/doku.php" />
</rule>
</rules>
</rewrite>

If you are using Azure Web App, just put these lines under the <system.webServer> tags in web.config file (situated in wwwroot of your App).

IIS 7.0 or greater

IIS 7.0 and above can be extended with a the URL Rewrite module 2.0 available from Microsoft for both x86 and x64

Save the Apache rules above to a .htaccess file removing the “RewriteBase /dokuwiki” line. This will not be required as we will be adding the rules directly to the root of the wiki.

In IIS Manager select your Wiki folder, and under IIS select “URL Rewrite” (if you had Manager open before installing, a refresh will be required)

In the actions pane on the right hand side, choose “Import Rules”

For your configuration file, select the .htaccess file and Import, this should give you 6 converted rules.

Finally hit Apply in the Actions panel on the right hand side.

Configure your Wiki to use .htaccess rules for rewrite and you should now be seeing your URLs rewritten.