Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

IIS Setup Documentation #148

Open
akarel opened this issue Aug 27, 2018 · 9 comments
Open

IIS Setup Documentation #148

akarel opened this issue Aug 27, 2018 · 9 comments
Assignees

Comments

@akarel
Copy link

akarel commented Aug 27, 2018

Actual behavior

Setting up Wiki.js to run on IIS was kind of a pain, but isn't actually that hard. There just isn't any directly related documentation.

Expected behavior

It should be easier to run via IIS.

Steps to reproduce the behavior

Install Wiki.js and have it run on IIS without any documentation.

I'm happy to provide the steps that worked for me if you want one way to do it for your docs. I wrote it out below. Hope this helps someone.


Running Wiki.js on IIS

  1. On the server/computer where IIS is running, install iisnode
    1. A restart may be required for iisnode to properly pick up Node.js from the environment path, if it is set there, otherwise an additional configuration setting will be required (see Web.config below)
  2. In IIS, create a new website whose virtual directory is the folder where Wiki.js was installed (e.g. C:\wiki\)
  3. Add the file wikiSiteInit.js to the root site folder (same as in the previous step)
    1. The only content of the file should be: require('./server/index.js');
  4. Add a Web.Config to the root site folder (the same as in the previous steps)
<configuration>
  <system.webServer>
    
  <!-- Uncomment the following line if Node.js is not available via the environment path -->
  <!-- <iisnode nodeProcessCommandLine="{Path to node.exe}" /> -->

    <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>
@NGPixel NGPixel self-assigned this Aug 28, 2018
@NGPixel
Copy link
Member

NGPixel commented Aug 28, 2018

Thanks! I'll add it to the documentation soon.

@jimromaine
Copy link

Thank you for these instructions. They helped a lot in our IIS deployment.

One other thing that might be an issue that we got stuck on for hours... In the config.yml file, don't put a port. Keep it empty, as in:

image

IIS 10 will handle the ports via it's bindings.

@wooster11
Copy link

I also want to note that I had a small problem after getting it up and running where I couldn't save any edited pages. Of course, no error message would pop-up (just an empty error popup after clicking save) and I had to dig in to first find the logs and then interpret those logs.

Turns out that my application pool didn't have the proper rights to access the .gitconfig file.

I recommend that a new Application Pool be created and the identity used for that pool be set to Local System.

@wooster11
Copy link

I just found another issue running with Node IIS. It appears that items don't get synched automatically with my git repo.

Even though I can see a bunch of git processes running in the task manager, it fails to push changes. In addition, file uploads fail. Files are copied over to the repo folder, but don't get synched with git and Wiki.js is unable to fetch the file listing.

Once I switched back to running directly under node, this all worked again.

Just something to keep in mind with 2.x to see if we can get full Node IIS support.

@NGPixel NGPixel transferred this issue from requarks/wiki Dec 31, 2018
@toose
Copy link

toose commented Jan 29, 2019

Hey @wooster11, since you've gotten this up and running behind IIS, i was wondering if you could help me out.

  • I have my setup running on IIS following the steps you've provided
  • I've also followed this guide here in order to secure the site via SSL through IIS using Application Request Routing and a Reverse Proxy.

The problem seems to be that my browser is caching the content of these pages, so when I update a page through the web interface, the page gets updated correctly, I can confirm that the file on the backend (filesystem) does indeed get updated with new content, as well, a new commit is created in my repo. At this point, im brought back to view the updated changes. Everything is good so far. If however i choose to edit the page the second time, the previous version of the page is displayed in my the wiki.js editor.

Any ideas?

EDIT: It seems that the back end needs time to sync up. If i wait 5-10 minutes and then refresh the page, my changes are displayed. I still don't know why this happens.

@wooster11
Copy link

Hey @toose11,

I'm not sure what's going on here. I gave up on my IIS deployment as I was having all other kinds of problems (subsequent comment) with it working properly with my git repo and it saving changes. Sorry, I can't be of more help here.

@toose
Copy link

toose commented Feb 4, 2019

@wooster11 Thanks anyway 👍

@Chinh-P
Copy link

Chinh-P commented Apr 17, 2019

  1. In IIS, create a new website whose virtual directory is the folder where Wiki.js was installed (e.g. C:\wiki\)

May I know why do you need to create virtual directory instead of create a website with Physical directory is C:\wiki?

@Hecatron
Copy link

couple of notes for anyone else trying to get this to workk with iisnode

first I had to override the port with process.env.PORT
I got that from here - tjanczuk/iisnode#417

under server\core\config.js

    if (appconfig.port < 1 || process.env.HEROKU) {
      appconfig.port = process.env.PORT || 80
    }
    // override
    appconfig.port = process.env.PORT

next in the web.config I added a line of

<iisnode nodeProcessCommandLine="node.exe --no-deprecation --no-warnings"/>

this is due to this issue with iisnode
tjanczuk/iisnode#668

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants