Some of the information here may be outdated, please check the book instead
[edit]

This example shows how to integrate web2py and IIS using the commercial version of the Helicon ISAP_Rewrite 3 module.

Unfortunately the freely available Lite-version does not support the needed proxy features (believe me, I tried this, the documentation is correct). For me, the price for this tool is acceptable; it saves a lot of time.

Prerequisites

  • IIS is installed and running
  • Any edition of MS SQL Server is installed, running and reachable through the web server
  • Python is installed and running
  • web2py is installed and running

Steps

  • Install Helicon ISAP_Rewrite 3
  • Configure ISAP_Rewrite 3
  • Install web2py as a service
  • Configure MSSQL Server access

I assume, that you are logged into your windows server with an administrator account.

Install Helicon ISAP_Rewrite 3

Download the full version of Helicon ISAP_Rewrite 3, simply start the program and follow the installations instructions.

=> http://www.helicontech.com/download-isapi_rewrite3.htm

Configure ISAP_Rewrite 3

The ISAPRewrite module uses text-based configuration files like the apache web server. These file can be edited manually or with a little GUI-program, which is located under Programs > Helicon > ISAPIRewrite3. You can manually start this tool with:

=> "%ProgramFiles%\Helicon\ISAPI_Rewrite3\Helicon Manager.exe"

Choose the designated Website, click the edit button and paste the following text snippet into the editor. After closing the window and saving the file, the configuration is done.

RewriteEngine on RewriteBase / RewriteRule (.+) http://127.0.0.1:8000/$1 [NC,P]

Every Request to the IIS website is routed to the locally running web2py web server. To test this, just start web2py manually in interactive mode, open a browser and go to "http://<MyIISWebSiteName>/examples". This should show you the web2py-examples web page.

Install web2py as a service

This is perfectly described in an already existing AlterEgo entry:

=> http://mdp.cti.depaul.edu/AlterEgo/default/show/77

Configure MSSQL server access

For accessing a MSSQL server through python, download and install pymssql:

=> http://sourceforge.net/projects/pymssql

After successfully installing the module and restarting web2py, this driver is available.

In db.py change the connection string as needed:

db = SQLDB('mssql://<username>:<password>@<server>/<database>')

For example:

  1. db = SQLDB('mssql://username:password@localhost/web2py')
  2. db = SQLDB('mssql://username:password@(local)\SQLEXPRESS/web2py')

The second example is for accessing a named instance of a MSSQL server.

© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.