title: Can't open port 8080 on Google Compute Engine running Debian
body: <p>I am trying to run a simple Python http server that displays "hello world" on port 8080 using a micro instance. I also have 4 instances of Tornado running behind Nginx. Connecting to Nginx/Tornado on port 80 is not a problem.</p>
  
  <p>I have added port 8080 to my firewall settings, and ensured port 8080 is open and listening on the server but no matter what I do, my connection is always refused. I have tried connecting using browsers, telnet and wget and every single connection is refused.</p>
  
  <p>Here is the output of <code>netstat -an | grep "LISTEN "</code></p>
  
  <pre><code>tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:8002            0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:8003            0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
  tcp6       0      0 :::8000                 :::*                    LISTEN
  tcp6       0      0 :::8001                 :::*                    LISTEN
  tcp6       0      0 :::8002                 :::*                    LISTEN
  tcp6       0      0 :::8003                 :::*                    LISTEN
  tcp6       0      0 :::22                   :::*                    LISTEN
  </code></pre>
  
  <p>Here is my iptables list</p>
  
  <pre><code>Chain INPUT (policy ACCEPT)
  target     prot opt source               destination
  ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http-alt
  
  Chain FORWARD (policy ACCEPT)
  target     prot opt source               destination
  
  Chain OUTPUT (policy ACCEPT)
  target     prot opt source               destination
  </code></pre>
  
  <p>Here is the Python script I am using:</p>
  
  <pre><code>#!/usr/bin/python
  from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
  
  PORT_NUMBER = 8080
  
  #This class will handles any incoming request from
  #the browser
  class myHandler(BaseHTTPRequestHandler):
  
     #Handler for the GET requests
     def do_GET(self):
        self.send_response(200)
        self.send_header('Content-type','text/html')
        self.end_headers()
        # Send the html message
        self.wfile.write("Hello World!")
        return
  
  try:
     #Create a web server and define the handler to manage the
     #incoming request
     server = HTTPServer(('', PORT_NUMBER), myHandler)
     print 'Started httpserver on port ' , PORT_NUMBER
  
     #Wait forever for incoming htto requests
     server.serve_forever()
  
  except KeyboardInterrupt:
     print '^C received, shutting down the web server'
     server.socket.close()
  </code></pre>