Edgewall Software

Changes between Version 5 and Version 6 of CookBook/Installation/TracOnWindowsIisWfastcgi

Nov 26, 2015, 6:13:49 AM (7 years ago)

Specifying URL rewriting rules to bypass FastGCI for static content did not work to me. So I suggested an alternative way to solve this problem.


  • CookBook/Installation/TracOnWindowsIisWfastcgi

    v5 v6  
    102102There is some magic here: we configure the FastCGI handler to handle *all* URIs under the virtual directory, but also tell rewrite to edit URIs under <vdir>/chrome.  Somehow, IIS understands that the rewritten URI should not be passed to FastCGI.  But why?
     104==== What if magic does not work?
     106Sometimes the method to isolate static content from Trac described above does not work. The files the `htdocs` folder are ignored and the css/js files are returned through the FastCGI handler.
     108If you run into this problem, try the alternative approach:
     110  - Instead of configuring the URL rewriting rules, create a Virtual Directory called `chrome` in the root of the website. If you already created URL rewriting rules, remove or disable them. 
     111  - Disable our handler for this virtual directory (through GUI or by modifying `web.config` as described below).
     112  - If it returns error 401, make sure that the `IUSR` account has read permissions for the `htdocs` folder.
     114To turn off our handler, find its name in the Handler Modules section of GUI and then create the following `web.config` file in the root of the `htdocs`:
     117<?xml version="1.0" encoding="UTF-8"?>
     119    <system.webServer>
     120        <handlers>
     121            <!-- Use GUI to find out how exactly your FastCGI handler is called -->
     122            <remove name="Python FastCGI_WSGI" />
     123        </handlers>
     124    </system.webServer>
     128If you want to re-enable the FastCGI handler for a specific subfolder of `htdocs`, you can create a similar `web.config` in this folder and instead of `<remove>` tag, insert something like this:
     131<add name="Python FastCGI_WSGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="[path to python]\python.exe|[path to wfastcgi.py]\wfastcgi.py" resourceType="Unspecified" />
     134You can also find it in the web.config of the root folder of the site.
    104136=== Enable Windows authentication, disable anonymous (if you aren't using [th:AccountManagerPlugin])