Python - CGI-BIN - Apache Timeout Problem

Sean Cavanaugh (scavanau) scavanau at
Fri Mar 2 21:09:16 CET 2012

Hello List,


Would appreciate some insight/help, ran out of ideas...




I am trying to create a simple webserver gui wrapper for a set of
scripts I developed to test some of our firewalls here at Cisco.  Being
that the total amount of engineer that will ever probably use this is 4
people and my limited python experience I just decided to do a quick
cgi-bin solution.  I control the machine with the webserver on em0 where
I do my fw testing on em1/em2.


Browser goes to http://webserver/    -> executes a
script-> -> imports my engine which is a
series of functions I wrote. kicks of whatever test




When I execute the scripts from the command line (#python it
generates it fine (albeit slowly), it prints all the html code out
including the script.  The 'core' part of the script dumbed down to the
lowest level is->


        proc = subprocess.Popen(['/usr/local/bin/python', ''],

        output =

        print output



When I open and execute the script it just hangs... it seems to
execute the script (I see pcap fires on the interface that I am testing
on the firewall) but its not executing correctly... or loading the
entire webpage...the webpage keeps chugging along and eventually gives
me an error timeout.


I know it's not a permissions issue or setup issue b/c I did a proof of
concept where I just fired one simple pcap and it works fine (reported
back just like it would if I ran it on the command line).. it has
something to do with either the amount of prints out the script is
doing, or the timing.  I see no problems except the timeout (nothing in
logs: /var/log/http-error.log).  My script takes about 8 secounds to
run.  It does use threading but I wouldn't think that would mess it up.


BTW: I posted here if this helps anyone:



Thanks in advance for any ideas.  I can include the whole if
that would help.



Sean Cavanaugh

Cisco Systems

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list