Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 OpenShift错误在此服务器上找不到请求的URL/_Python 2.7_Flask_Openshift - Fatal编程技术网

Python 2.7 OpenShift错误在此服务器上找不到请求的URL/

Python 2.7 OpenShift错误在此服务器上找不到请求的URL/,python-2.7,flask,openshift,Python 2.7,Flask,Openshift,我一直在尝试在openshift上部署flask应用程序。我测试了该网站,它在开发服务器上运行良好(通过键入python app.py和manage.py runserver),我将该项目上传到终端,并使用以下命令创建了该应用程序: rhc create-app marcsantiago python-2.7 --from-code=https://github.com/marcsantiago/personalwebsite.git 该应用程序似乎创建时没有问题。当我尝试访问创建的url时,

我一直在尝试在openshift上部署flask应用程序。我测试了该网站,它在开发服务器上运行良好(通过键入python app.py和manage.py runserver),我将该项目上传到终端,并使用以下命令创建了该应用程序:

rhc create-app marcsantiago python-2.7 --from-code=https://github.com/marcsantiago/personalwebsite.git
该应用程序似乎创建时没有问题。当我尝试访问创建的url时,会出现此问题:

我收到一个找不到的错误,请求的URL/在此服务器上找不到

我不知道我做错了什么,也不知道如何修复它,使网站得以生存。这是一个简单的网站,不使用数据库

有人能帮我解决这个问题吗

这是postgresql.log信息,尽管我不确定它有多重要,因为我不使用数据库,python.log在下面

2015-07-22 02:05:44 GMT LOG:  could not bind socket for statistics collector: Permission denied
2015-07-22 02:05:44 GMT LOG:  trying another address for the statistics collector
2015-07-22 02:05:44 GMT LOG:  could not bind socket for statistics collector: Cannot assign requested address
2015-07-22 02:05:44 GMT LOG:  disabling statistics collector for lack of working socket
2015-07-22 02:05:44 GMT WARNING:  autovacuum not started because of misconfiguration
2015-07-22 02:05:44 GMT HINT:  Enable the "track_counts" option.
2015-07-22 02:05:44 GMT LOG:  database system was shut down at 2013-05-21 05:07:11 GMT
2015-07-22 02:05:44 GMT LOG:  database system is ready to accept connections
2015-07-22 02:05:48 GMT LOG:  received smart shutdown request
2015-07-22 02:05:48 GMT LOG:  shutting down
2015-07-22 02:05:48 GMT LOG:  database system is shut down
2015-07-22 02:06:04 GMT LOG:  could not bind socket for statistics collector: Permission denied
2015-07-22 02:06:04 GMT LOG:  trying another address for the statistics collector
2015-07-22 02:06:04 GMT LOG:  could not bind socket for statistics collector: Cannot assign requested address
2015-07-22 02:06:04 GMT LOG:  disabling statistics collector for lack of working socket
2015-07-22 02:06:04 GMT WARNING:  autovacuum not started because of misconfiguration
2015-07-22 02:06:04 GMT HINT:  Enable the "track_counts" option.
2015-07-22 02:06:04 GMT LOG:  database system was shut down at 2015-07-22 02:05:48 GMT
2015-07-22 02:06:04 GMT LOG:  database system is ready to accept connections
python.log

[Tue Jul 21 22:06:07 2015] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c6,c294
[Tue Jul 21 22:06:07 2015] [notice] Digest: generating secret for digest authentication ...
[Tue Jul 21 22:06:07 2015] [notice] Digest: done
[Tue Jul 21 22:06:07 2015] [notice] Apache/2.2.15 (Unix) mod_wsgi/3.4 Python/2.7.8 configured -- resuming normal operations
(98)Address already in use: make_sock: could not bind to address 127.12.133.129:8080
no listening sockets available, shutting down
Unable to open logs
[Tue Jul 21 22:07:01 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667
67.84.182.205 - - [21/Jul/2015:22:07:01 -0400] "GET / HTTP/1.1" 404 304 "http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3"
[Tue Jul 21 22:08:49 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667?noredirect=1
124.32.215.10 - - [21/Jul/2015:22:08:49 -0400] "GET / HTTP/1.1" 404 304 "http://stackoverflow.com/questions/31551797/openshift-error-the-requested-url-was-not-found-on-this-server/31552667?noredirect=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
[Tue Jul 21 22:08:50 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi, referer: http://marcsantiago-mywebappsflask.rhcloud.com/
124.32.215.10 - - [21/Jul/2015:22:08:50 -0400] "GET /favicon.ico HTTP/1.1" 404 315 "http://marcsantiago-mywebappsflask.rhcloud.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12"
[Tue Jul 21 22:10:25 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi
10.99.163.186 - - [21/Jul/2015:22:10:25 -0400] "HEAD / HTTP/1.1" 404 - "-" "Ruby"
10.99.163.186 - - [21/Jul/2015:22:10:25 -0400] "HEAD / HTTP/1.1" 404 - "-" "Ruby"
[Tue Jul 21 22:10:25 2015] [error] [client 127.12.133.129] Target WSGI script not found or unable to stat: /var/lib/openshift/55aefa434382ecece2000001/app-root/runtime/repo/wsgi

很抱歉,它看起来很混乱,除了粘贴日志之外,想不出更好的方法来共享日志。

域没有指向任何服务器

这很可能是您在Openshift上的配置中的问题、服务器配置中的错误或您这边的URL键入错误

联系Openshift或检查他们的日志

编辑:
查看新的日志,很明显服务器找不到您的WSGI应用程序。您提到它名为app.py,但服务器可能正在查找其他内容。更常见的文件名是application.py。在OpenShift上检查您的配置,并相应地调整WSGI应用程序文件名。

您是否阅读过开发人员门户网站中有关在OpenShift Online上使用Flask的部分


我刚刚删除了应用程序,我会将其放回,请共享您的日志消息。目前,我们无法弄清楚到底发生了什么。我将名称改为application.py,然后重新上传了应用程序。没什么,同一个问题,而且我对openshift非常陌生,比如12小时新的,所以我现在不知道如何编辑配置。无论如何,我想这是我在github上的烧瓶结构。我将按照此链接为openshift设置我的flask项目。WSGI脚本文件必须在顶级目录中名为“WSGI.py”,如果使用Apache/mod_WSGI,则必须名为“WSGI/application”。你好像两个都没用过。如果不想使用Apache/mod_wsgi,而是提供一个启动自己HTTP服务器的Python脚本,则需要将其称为“app.py”。您似乎已经在实例上运行了Apache。您可能希望重新启动该实例,如果这没有帮助,您可能必须使用ssh连接到该实例中并杀死Apache实例,因为您可能会以某种方式使其处于混乱状态。您可以提供一些代码吗?