title: Python as CGI web server
body: <p>I've got a terrible job to do. I have to revive some really old Python site/system until new one is written. Its a decade old, and relies on ancient way of doing things...CGI.</p>
  
  <p>The 'webpages' start like this:</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf-8 -*-
  
  import functions
  import datetime, time
  
  #Check if logged in
  if functions.verifyCookies() == False:
      print("Location: index.py")
  
  #send HTTP Headers
  print ("Content-Type: text/html\n")
  
  #Get Email from Cookies
  email = functions.getCookieValue('email')
  name = functions.getCookieValue('name')
  </code></pre>
  
  <p>I think I need Python 2.4, and the only dependency is some MySQL python driver (as far as I can tell from the imports). Any idea of how to set this thing up? </p>
  
  <p>I'm going for Centos 5 server. How do I set up the CGI serving tho? Do I just install Apache and than give <code>.py</code> files the <code>+x</code> permissions, or is there something more to it?</p>