Dynmap With IIS Using URL Rewrite and applicationrequestrouting thanks to kekec852 - webbukkit/dynmap GitHub Wiki
This page assumes:
- You have basic undersending of configurationg and managing IIS server
- The root directory of your webserver is found at C:\Inetpub\wwwroot.
- You have IIS and CraftBukkit running on the same machine.
- You have download and installed URL Rewrite and ApplicationRequestRouting(http://www.iis.net/downloads/microsoft/application-request-routing, http://www.iis.net/downloads/microsoft/url-rewrite)
Start:
- To start, create the directory C:\Inetpub\wwwroot\dynmap.
- Copy the contents of the web directory found in the repository to C:\Inetpub\wwwroot\dynmap.
There are two choices:
- Create folder
C:\Inetpub\wwwroot\dynmap\tiles\
and editconfiguration.txt
and make sure you have the property tilespath set toC:\Inetpub\wwwroot\dynmap\tiles\
:
# The path where the tile-files are placed.
tilespath: C:\Inetpub\wwwroot\dynmap\tiles
OR
- Create virtual folder inside iis by right clicking on dynmap folder
Add Virtual Directory
nameedtiles
(alias) andPhysical path
that points todynmap plugin folder/web/tiles
Now the rewrite part:
- Select dynmap folder in IIS and click URL Rewrite icon, then
Add rule(s)
; selectReverse proxy
. In inbound rule enter127.0.0.1:8123
and click ok. When asked if enable reverse proxy selectYes
. - Browse to your dynmap web folder (
C:\Inetpub\wwwroot\dynmap\
) and openweb.config
with notepad and adjust content to:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="up/(.*)" />
<action type="Rewrite" url="http://127.0.0.1:8123/up/{R:1}" />
</rule>
<rule name="ReverseProxyInboundRule2" stopProcessing="true">
<match url="standalone/(.*)" />
<action type="Rewrite" url="http://127.0.0.1:8123/standalone/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Also, some version of IIS (7.x in any case) will not automatically assign the proper MIME type for the *.json files that can be needed by dynmap (resulting in a 406 or 404 error when attempting to load these files, such as those used by the Markers API). To address this, follow the procedure here - http://support.microsoft.com/kb/942050 - to define the MIME type 'application/json' to the 'json' file extension.
Also, for more details on how to get IIS6 and IIS7 handing JSON properly, see http://www.sencha.com/forum/showthread.php?33266-Some-Problem-with-JSON&p=229858&viewfull=1#post229858