Attention

This document was written for an old version of Plone, Plone 3, and was last updated 874 days ago.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Setting up Plone behind IIS (Reverse Proxy) (non-Enfold-Proxy solution)

by Bao Nguyen last modified Dec 31, 2009 02:52 AM
How to set up Plone on a IIS server (Reverse Proxy). This method does NOT require Enfold Proxy.

Purpose

I have just learnt Plone for 2 weeks, and had spent lot of time & effort on finding a free solution to have Plone worked with IIS. Ofcourse this can be achieved with commercial software called Enfold Proxy (EP). EP is a powerful product with ease of use & enhanced features (load balancing, caching,...). However, what I want is to setup Plone with IIS using free proxy software.

The reason to put IIS in front of Zope because of IIS's function: hostname based routing. In IIS you can host multiple websites at the same TCP port (i.e. 80), on the same IP address of IIS, providing that each website shall have unique hostname (FQDN), i.e. www.bao-nguyen.com, www2.baonguyen.vn...

This Tutorial will help with the below scenario:

  1. You have a Plone website running, i.e. http://my-plone-server:8080/Plone
  2. You have an IIS Server running somewhere, either on the same Plone server or on other server. IIS server must have access to your Plone website.
  3. You have the FQDN (full qualified domain name), pointing to IIS Server's IP address.
  4. When people type in http://FQDN, they will see your Plone site's content.

Prerequisites

1. A proper Plone Site up (any version). Mine is 3.3.2 for Windows. It should be reachable via url http://my-plone-server:8080/Plone or similar.

2. IIS version 6. I'm not testing with IIS7, but this should work also. (*)

3. Net Framework 2.0 or newer. I use 3.5 SP1 (for Managed Fusion URL Writer)

4. Managed Fusion URL Rewriter files. An amazing yet free URL Writer software, similar to mod_rewrite in Apache. More info: http://urlrewriter.codeplex.com/

Step by step

1. Install Net Framework 2.0 or newer on IIS Server.

2. Create a folder name Plone-or-whatever for new web site. Mine is C:\inetpub\wwwroot\Plone

3. Download Manage Fusion URL Rewriter, hereby called UR.
   At the time of this writing, UR latest version is 3.0.

   It is a zip containing 2 files: ManagedFusion.Rewriter.dll & ManagedFusion.Rewriter.pdb
   Create a folder named "bin" inside C:\inetpub\wwwroot\Plone, and put these 2 files in.

5. Download the Managed Fusion UR sample files name managedfusion-rewriter-example.zip using the same link at step 3.
    Unzip this sample file, and copy these two files: ManagedFusion.Rewriter.txt & Web.config (located in "Website" Folder) to C:\inetpub\wwwroot\Plone.

    At this step, the folder C:\inetpub\wwwroot\Plone shall look like:

   + Plone:
          - ManagedFusion.Rewriter.txt
          - Web.config
          + bin:
                   - ManagedFusion.Rewriter.dll
                   - ManagedFusion.Rewriter.pdb

6. Now configure UR to do the URL rewrite.

    a. Edit C:\inetpub\wwwroot\Plone\ManagedFusion.Rewriter.txt

    b. Delete all the content of this file, then paste in two lines:

 RewriteEngine On
 RewriteRule ^/(.*) http://my-plone-server:8080/VirtualHostBase/http/%{SERVER_NAME}:80/Plone/VirtualHostRoot/$1 [P]

Note: adjust the above to match your VirtualHostBase (if differs)

7. Create a website in IIS with custom hostname (FQDN),
     I go fast in this section. More info can be found here.

    a. Open IIS

    b. Right click "Web Sites" -> New -> Web Site

    c. Click Next, then enter Description, i.e. PloneWS, Next. Enter custom hostname into "host header for this Website"

    d. Browse to the folder created at step 2. Or you can type the path (.i.e C:\inetpub\wwwroot\Plone). Next

    e. On Website Access Permissions Page, allow the first 3 (Read, Run, Execute...). Next. Finish.

   Note: make sure this new website allow anonymous logon, as set by default.

8. Now you'll see a new website appears in IIS. It's time to configure it with URL Rewriter.

    f. Open IIS Manager, then Right click the newly-created site PloneWS -> Properties.

   g. On "Home Directory" tab, change "Execute Permission"  to "Scripts & Executables".

   h. Click Configuration. In "application Configuration" window, click Insert.

   i. In Add/Edit Application Extension Mapping windows, browse to :

  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll  

    Note: if you dont see folder v2.0.50727, this means Netframwork 2.0+ is not installed on IIS Server.

  j. OK, OK, OK...

 

9. FINISHED!. Now open a web browser and type in: http://FQND. You should see your Plone website appears under the URL http://FQND

(*): If you are using IIS7, there is another solution for URL rewrite, called Application Request Routing (ARR). See more here. (I'm not testing yet)

Note: if you modify URL rewrite rules in ManagedFusion.Rewriter.txt, make sure to also open+save Web.config file in order for IIS to update these new changes. I figured it out after a while. :)

Further information

 Here are some references that I used to make this work. Many thanks to their authors

1. Understand basic URL rewrite

2. How to install Managed Fusion UR

3. Managed Fusion UR homepage

4. Setup Plone/IIS using Enfold

5. How VHM works

Bao Nguyen
Bao Nguyen IT Co., Ltd

 

Users Feedback

 

 

31/12/2009: John Fugazi (johnfugazi), ken(dot)knee(at)gmail(dot)com wrote:

This works great. I tried it behind IIS 5.1 (WinXP). Just one thing that you can put on the doc. i kept getting a error message when navigating to site ("Server Application Unavailable"). i resolve this by doing two things:

1. under inetpub, i gave "IIS_WPG" read/write permissions on the "plone" folder. still got error.

2. open command prompt, went to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" and typed the command "aspnet_regiis.exe -i".

3. Reset IIS with "iisrest /noforce" everything works great. thanks.


Contribute

Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.