But first, what kind of CGI script or program do you want to run? It makes a difference! If your CGI programs are written in Perl, you need to install the ActivePerl software - the Perl "interpreter" that runs Perl programs. Installing ActivePerl will also take care of telling IIS what to do with .pl files. If your programs are written in Python, you'll have to install the Python interpreter and then do a little bit more work to tell IIS what to do with .py files.
If your CGI programs are compiled .exe files, written in C or C++ or any other language that produces .exe files, then you'll just need to configure IIS to allow executables to be run... and make very sure you don't leave any non-CGI .exe files in your web space!
Adding Support For Python, Perl, and .EXE CGI ProgramsSure this is what you want? OK, enough talk - let's do it!
1. To support Python scripts, install the Python interpreter. Fetch and run the latest Windows Python installer from the official Python download page.
2. To support Perl scripts, install the Perl interpreter. Fetch and run the latest ActivePerl (Perl for Windows) installer from the official ActivePerl download page.
3. All done with both installs? Great! Configuration for Perl CGI programs (with a .pl extension) should be completely finished at this point. The rest of tutorial assumes you also want to support compiled .exe CGI programs and interpreted Python .py CGI scripts. To enable these, Locate the IIS control panel:
Start -> Control Panel -> Administrative Tools -> Internet Information Services
Start -> Control Panel -> Performance and Maintenance -> Administrative Tools -> Internet Information Services
We recommend the "Classic View" for those who are running websites on their PCs.
5. A menu appears. Select "Properties."
6. Select the "Home Directory" tab.
7. From the "Execute Permissions:" menu, select "Scripts and Executables" to allow compiled .exe CGI programs (if desired) as well as Python and Perl CGI scripts.
8. If you want to run Python-based CGI programs, see Microsoft Knowledge Base article #276494, Using Python Scripts with IIS.
You should now be ready to roll with Perl CGI scripts, Python CGI scripts, and compiled executable CGI programs under Internet Information Server. Just remember that scripts "imported" from the Unix/Linux world will usually need some modifications, especially if they assume that Unix programs like sendmail are installed. In many cases, it's better to start over and do it the Windows way... or set up a Linux server!
Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!