Server-Informationen

Mit diesem CGI-Skript erhältst du ein paar mehr Informationen zu dem Web Server:

   1 #!/usr/bin/env python
   2 # -*- coding: UTF-8 -*-
   3 import sys, os
   4 
   5 # Debugging für CGI-Skripte 'einschalten'
   6 import cgitb; cgitb.enable()
   7 
   8 print "Content-Type: text/html; charset=utf-8\n"
   9 print "<h1>Hello World!</h1>"
  10 print "<hr/>"
  11 
  12 print "<h3>Python %s</h3>" % sys.version
  13 
  14 print "<h3>os.uname():</h3>%s<br />" % " - ".join(os.uname())
  15 print "<h3>sys.path:</h3>"
  16 sys_path = sys.path[:]
  17 sys_path.sort()
  18 for p in sys_path:
  19     print "%s<br />" % p
  20 
  21 print "<h3>OS-Enviroment:</h3>"
  22 print '<dl id="environment">'
  23 keys = os.environ.keys()
  24 keys.sort()
  25 for key in keys:
  26     value = os.environ[key]
  27     print "<dt>%s</dt>" % key
  28     print "<dd>%s</dd>" % value
  29 print "</dl>"

Liste der installierten Module

Wenn du wissen willst, welche Module installiert sind, versuche dieses CGI-Skript.

Hier noch der dazu passende Thread aus dem Python-Forum.

Server-Informationen (last edited 2009-06-17 16:14:26 by localhost)