Thursday, February 17, 2011

Install and Configure Python in Windows Server 2008/2003 (IIS 6.0 or 7.0)? 1. Install Python

1. Install Python


Go to Python official website http://www.python.org/download/ and download the latest Windows installer (.msi). Follow the screen and install it.

2. Configure IIS Web Service Extensions


Open Start -> Administrative Tools > Internet Information Services (IIS) Manager. Click "Web Service Extensions" and add a new web service 'C:\Python25\python.exe -u "%s" "%s"'.





3. Configure Website to Enable Python


Go to website that you want to eanble Phyton. Right click the website and go to Properties > Home Directory > Configurations > Mappings. Add a new script mapping ".py" with 'C:\Python25\python.exe -u "%s" "%s"'.

4. Test Python


Write a test file test.py and test it out. Everything should work now.

print
        print 'Status: 200 OK'
        print 'Content-type: text/html'
        print
        print ''
        print '

This is a header

' print '' #this is a comment print 'See this is just like most other HTML' print ' ' print ''
 

5. Configure Control Panel (Optional)


If you have a control panel for your server, you may need to configure it as well. Below is a sample for Helm control panel.


    



 




No comments: