我正在尝试为应用程序引擎开发设置一个服务器。 我无法想象如何从外部访问生成的Web服务器。 我正在运行Debian镜像,Python GAE。
我有以下的防火墙规则,应该让所有的HTTPstream量通过。 我已经重新启动服务器,因为它被设置,但我不知道这是必要的。
Source Ranges: 0.0.0.0/0 Allowed Protocols or Ports: tcp:1-65535
当我启动应用程序引擎时,我没有得到任何错误:
admin@dev:~$ sudo google_appengine/dev_appserver.py --port 80 appfiles WARNING 2014-08-21 18:19:18,080 api_server.py:383] Could not initialize images API; you are likely missing the Python "PIL" module. INFO 2014-08-21 18:19:18,083 api_server.py:171] Starting API server at: http://localhost:45536 INFO 2014-08-21 18:19:18,086 dispatcher.py:183] Starting module "default" running at: http://localhost INFO 2014-08-21 18:19:18,086 admin_server.py:117] Starting admin server at: http://localhost:8000
我无法使用外部临时IP访问服务器 – 我只是获得了500的状态。 我可以通过内部访问网站。
admin@dev:~$ curl http://localhost/register/ > test.htm % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 815 100 815 0 0 2285 0 --:--:-- --:--:-- --:--:-- 2295 admin@dev:~$ tail test.htm Email: <input type='email' id='email' name='email' /><br /> Password: <input type='password' id='password' /><br /> <input id='submit' type="submit" value="Register" /> </form> </section> <footer><small>Website Footer</small></footer> </body> </html>
我知道外部IP是正确的,因为我用它来SSH进入。任何想法我可能会失踪?
我安装了Apache,我可以在80端口上没有问题的情况下进入默认页面。那么,为什么GAE不能处理外部请求呢?
默认情况下,它仅侦听localhost上的请求。 你需要设置--host参数:
sudo google_appengine/dev_appserver.py --port 80 --host 0.0.0.0 appfiles