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.
I assume, that you are logged into your windows server with an administrator account.
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
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.
This is perfectly described in an already existing AlterEgo entry:
=> http://mdp.cti.depaul.edu/AlterEgo/default/show/77
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:
The second example is for accessing a named instance of a MSSQL server.