[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to make a port accessible out of the gear in online?

2015-01-13 2:03 GMT+08:00 Luke Meyer <lmeyer redhat com>:
Actually if you are getting a 404, that is still a response code from a listening server. Maybe it is redirecting wrongly with the external address? If you were getting a 502 or 503, that would be a good sign nothing was listening in the gear.

Hi, thanks for your reply.
But what I wonder is, while I try to access it by url, I there is no access log coming out from rhc tail. But I can see log if I access by the forwarded port. So I really wonder why this happened so strange.
----- Original Message -----
From: "Zamir SUN" <zsun fedoraproject org>
To: dev lists openshift redhat com
Sent: Saturday, January 10, 2015 10:01:56 PM
Subject: How to make a port accessible out of the gear in online?

Recently I am trying to run a python application on OpenShift. It uses
Redis and WSGIServer from gevent.wsgi. So I created a python app and
then followed the link [1] and link [2].
I just commented out the httpd = make_server('localhost', 8051,
application) and httpd.handle_request() in wsgi.py and make the app to
listen on port like this:
ip = os.environ['OPENSHIFT_PYTHON_IP']
port = int(os.environ['OPENSHIFT_PYTHON_PORT'])
http_server = WSGIServer((ip, port), app)

However, if I access directly from the browser using
I will always get 404. But if I use port-forward to make it accessible
by, it works well. So I wonder if this is a bug with
something or I missed some steps?

FYI, I pushed the whole app to github[3].


[1] https://blog.openshift.com/enabling-redis-for-your-app/
[2] https://developers.openshift.com/en/python-getting-started.html
[3] https://github.com/sztsian/gdanmaku-openshift
Zamir SUN
zsun fedoraproject org
zsun in #fedora-zh #openshift on freenode.net

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]