title: How to run a python script inside the cgi-bin of apache server?
body: <p>I put a simple python script inside the cgi-bin in apache2 and tried to execute it using the browser as follows,</p>
  
  <p>"http://www.example.com/cgi-bin/test.py"</p>
  
  <p>But it gives a 500 Internal sever error.</p>
  
  <p>Following is the error.log in apache2.</p>
  
  <p>[Sun Jul 29 22:07:51 2012] [error] (8)Exec format error: exec of '/usr/lib/cgi-bin/test.py' failed
  [Sun Jul 29 22:07:51 2012] [error] [client ::1] Premature end of script headers: test.py
  [Sun Jul 29 22:07:51 2012] [error] [client ::1] File does not exist: /var/www/favicon.ico</p>
  
  <p>can anyone help me on this?</p>