문제

I am writing a foosball ladder for my office in Python, to be served on my HostGator shared hosting. I am very new to the language (C# guy by trade), but have gotten simple scripts to run on the server.

I used the example found at https://wiki.python.org/moin/BaseHttpServer, modifying the server name to my domain and the port to a four digit number. I got HostGator support to open the corresponding outgoing port. I then chmodded the script with a+x and executed it. Success! The server ran and stayed up.

I tried to hit the server in various ways with no success.

  • http://mydomain.com/path/to/script
  • http://mydomain.com:port/path/to/script
  • http://mydomain.com:port
  • A GET request to the paths above.

What am I missing, server configuration-wise or code-wise, to successfully reach this BaseHTTPServer?

도움이 되었습니까?

해결책

You shall not bind your server to 127.0.0.1 which is visible only from localhost, but better to 0.0.0.0 or to an IP of network interface on your server.

Start with 0.0.0.0 which will bind to all network interfaces.

If it does not help, than you shall check, if firewall allows access to given port.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top