Indico on IIS
In this page we will cover how to have Indico installed on a Windows distribution and running on IIS.
Keep in mind that this brief guide has been written using a Virtual Machine running Microsoft Windows Server 2008 and Indico 1.2.
The actual installation steps may vary using different machines/indico distrubutions.
Dependencies
First of all we have to install all the necessary dependencies.
Since Indico has been developed mainly for Linux systems, and due to compatibility problems, not all the packets specified in requirements.txt are available for Windows machines.
Here follows all the original dependencies still compatible that can be installed with a simple pip command:
- Babel
- Mako
- MarkupSafe?
- ZConfig
- ZODB3
- argparse
- cssmin
- icalendar
- jsmin
- pojson
- polib
- py
- pyPdf
- pyatom
- pycountry
- pytest
- python-dateutil
- pytz
- reportlab
- simplejson
- termcolor
- transaction
- wsgiref
- zc.lockfile
- zc.queue
- zdaemon
- zope.event
- zope.index
- zope.interface
- ujson
- oauth2
- requests
- pyScss
- Werkzeug
- Flask
- beautifulsoup4
- Pillow
- qrcode
The two missing packages from the previous list are lxml and bcrypt.
lxml can be installed with this already compiled .exe file: https://pythonxy.googlecode.com/files/lxml-2.3.4_py27.exe.
To install bcrypt we can install, via pip, a fork for Windows of the original project, called py-bcrypt-32.
Once installed the required packages, we have to install the additional indico dependencies referenced from their repositories.
Since in Windows machines is a bit tricky to do so, an easy way to have it done is to clone the indico repository in a Linux machine, launch the fab setup_deps script and then copy the whole source directory into your Windows machine.
Installation
Now we can proceed with the actual installation of Indico.
First of all open setup.py and change bcrypt==1.0.2 into py-bcrypt-w32==0.2.2 (inside the _getInstallRequires() function).
Then open the file indico/MaKaC/consoleScripts/installBase.py and find the following line:
fdata = open(os.path.join(eggPath,'MaKaC','common','MaKaCConfig.py'), 'r').read()
Encapsulate that command into a try-except statement (with IOError as exception to be caught) and add the following lines inside the except branch:
print "Wrong EGG configuration!" continue
Doing so, we prevent the setup script from trying to configure bad indico eggs.
Now we can finally launch the installation script, with python setup.py install, and the initial setup script, with indico_initial_setup.
Just be sure to specify, during the setup script, absolute Windows paths (ie. including C: at the beginning). The use of normal slashes (/) is always recommended, since backslashes (\) have to be escaped in strings.
Once the setup script has finished all the configurations, go to the installation path you chose and remove the "read only" tick from the root folder (applying the change to all the files and subfolders).
Also, head to the etc directory, open all the configuration files there and check if the paths/urls there are correct.
Configuring IIS
Once we have correctly installed and configured Indico, we have to install a module, developed by Helicon Tech, that allows the IIS server and our WSGI application to communicate.
Just follow the guide from the Helizon Tech site: http://www.helicontech.com/articles/running-wsgi-on-iis/.
As you reach the project configuration step, choose New Web Site in the Web Site field.
Choose whatever you want for the project and web site names and for the project path.
Leave the IP address field as All unassigned.
At last, insert the http port you choose and the host name of the machine running Indico (for testing purposes you can just use "localhost").
Once the project installation finishes, head to the project folder and open the web.config file.
There, locate the WSGI_APP field and change the value in "indico.web.indico_wsgi.application". Also, append to the PYTHONPATH field the python library path (where indico is installed, basically).
You also have to locate the indico.wsgi file (usually inside indico/web/) and rename it to indico_wsgi.py.
Now open the Helicon Zoo Manager, select the Indico project and the static folder under it and click on enable, otherwise the module will manage all the static files inside the virtual environment.
Open also the IIS Manager, select the Indico web site you just created and then Bindings... (on the right). There add a new binding, specifying https as protocol and the corresponding port. As for the SSL certificate, you can either choose a personal certificate or a base certificate (usually for testing purposes).
Starting Indico
If nothing failed in the previous steps, we can now run the command to start the DB:
$ runzeo -C C:/opt/indico/etc/zodb.conf
Of course, if you installed Indico on a different path just change the command accordingly.
To be sure that all changes take effect, open the IIS Manager and click on Restart under Manage Server (or start if it was stopped).
Now we can finally access to Indico.
Just open your browser and head to the url you chose for the project.
Bugs
Indico running on IIS is still not fully working.
To check the reported bugs, take a look to the following list: