Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion install/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,67 @@ There are several solutions to run Wiki.js as a background service, e.g.:
- [forever](https://www.npmjs.com/package/forever)
- [node-windows](https://github.com/coreybutler/node-windows)

![](https://a.icons8.com/djxbtnYm/GBjHDS/svg.svg){.align-abstopright}
![](https://a.icons8.com/djxbtnYm/GBjHDS/svg.svg){.align-abstopright}

# Run under IIS

## Install iisnode

If we want to run wikijs under iis then we first need to install [iisnode](https://github.com/Azure/iisnode/releases).

## Setup a IIS site

Next we need to setup a new site under IIS.
Configuring new sites under IIS is outside the scope of this document

make a note of the directory that the site points to
In this case we're going to assume this is **C:\\wikijs\\** for the sake of simplicity

## Create an init file

Next we need to create a javascript startup file
place this under **C:\\wikijs\\** or your site directory

**wikiSiteInit.js**
```js
require('./server/index.js');
```

## Web.Config file

Next we're going to create a Web.Config file
place this under **C:\\wikijs\\** or your site directory

**Web.Config**
```xml
<configuration>
<system.webServer>

<!-- Uncomment the following line if Node.js is not available via the environment path -->
<!-- <iisnode nodeProcessCommandLine="{Path to node.exe}" /> -->

<!-- In some cases additional flags are needed to ignore deprecation warnings, this is due to iisnode using Buffer() -->
<!-- <iisnode nodeProcessCommandLine="node.exe --no-deprecation --no-warnings"/> -->

<handlers>
<add name="iisnode" path="wikiSiteInit.js" verb="*" modules="iisnode" />
</handlers>

<rewrite>
<rules>
<rule name="default">
<match url="/*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="wikiSiteInit.js" />
</rule>
</rules>
</rewrite>

</system.webServer>
</configuration>
```

> You'll notice above that we may need to pass in the flags
**--no-deprecation --no-warnings**
to get things to work. This is due to a bug associated with iisnode's use of the depreciated Buffer() [tjanczuk/iisnode#668](https://github.com/tjanczuk/iisnode/issues/668)
{.is-warning}