OpenShift服务器中的错误503

时间:2013-05-19 22:18:16

标签: django openshift

这是我的第一个Django项目,我正在尝试将其部署到OpenShift,但我遇到了一个问题:当我尝试打开应用程序页面时,我看到“503:Service Temporarily Unavailable”消息。我认为应用程序没有启动,所以我尝试在ssh中启动'ctl_app start',我得到了这个:

python: can't open file 'app.py': [Errno 2] No such file or directory

我尝试以这种方式启动应用:rhc app start customerquiz并得到了这个:

RESULT:
customerquiz started

但它没有效果。好吧,我试着看看app的状态:

$ rhc app show --state customerquiz
Cartridge python-2.7, mysql-5.1, phpmyadmin-3.4 is started

这就是服务器日志中的内容:

$ rhc tail customerquiz
==> mysql-5.1/log/mysql_error.log <==
130519 17:32:54 [Note] /usr/libexec/mysqld: Shutdown complete

130519 17:32:54 mysqld_safe mysqld from pid file /var/lib/openshift/000005//mysql-5.1/pid/mysql.pid ended
130519 17:33:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/openshift/000005//mysql-5.1/data/
130519 17:33:04  InnoDB: Initializing buffer pool, size = 16.0M
130519 17:33:05  InnoDB: Completed initialization of buffer pool
130519 17:33:05  InnoDB: Started; log sequence number 0 44233
130519 17:33:05 [Note] Event Scheduler: Loaded 0 events
130519 17:33:05 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.69'  socket: '/var/lib/openshift/000005//mysql-5.1/socket/mysql.sock'  port: 3306  Source distribution

==> python-2.7/logs/appserver.log <==
python: can't open file 'app.py': [Errno 2] No such file or directory

==> phpmyadmin-3.4/logs/access_log-20130519-000000-EST <==
109.254.107.11 - - [19/May/2013:17:14:13 -0400] "GET /phpmyadmin/themes/pmahomme/img/error.ico HTTP/1.1" 200 5430 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/phpmyadmin.css.php?server=1&token=436aa&js_frame=right&nocache=5471357898" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
- - - [19/May/2013:17:14:13 -0400] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.15 (Red Hat) (internal dummy connection)"
109.254.107.11 - admin [19/May/2013:17:14:18 -0400] "GET /phpmyadmin/ HTTP/1.1" 200 2580 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - admin [19/May/2013:17:14:19 -0400] "GET /phpmyadmin/main.php?token=436aa HTTP/1.1" 200 35472 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - adminB [19/May/2013:17:14:21 -0400] "GET /phpmyadmin/version_check.php?&_nocache=1368998062197204658 HTTP/1.1" 200 44 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/main.php?token=436aa" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - admin [19/May/2013:17:14:19 -0400] "GET /phpmyadmin/navigation.php?token=436aa HTTP/1.1" 200 5029 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - admin [19/May/2013:17:20:49 -0400] "GET /phpmyadmin/ HTTP/1.1" 200 2580 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - admin [19/May/2013:17:20:50 -0400] "GET /phpmyadmin/navigation.php?token=436aa HTTP/1.1" 200 5029 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - admin [19/May/2013:17:20:50 -0400] "GET /phpmyadmin/main.php?token=436aa HTTP/1.1" 200 35472 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"
109.254.107.11 - admin [19/May/2013:17:20:52 -0400] "GET /phpmyadmin/version_check.php?&_nocache=1368998453881950766 HTTP/1.1" 200 44 "https://customerquiz-unclelem.rhcloud.com/phpmyadmin/main.php?token=8436aa" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0"

==> phpmyadmin-3.4/logs/error_log-20130519-000000-EST <==
[Sun May 19 17:12:56 2013] [notice] Digest: done
[Sun May 19 17:12:56 2013] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured -- resuming normal operations
[Sun May 19 17:28:00 2013] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c6,c356
[Sun May 19 17:28:00 2013] [notice] Digest: generating secret for digest authentication ...
[Sun May 19 17:28:00 2013] [notice] Digest: done
[
Sun May 19 17:28:00 2013] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured -- resuming normal operations
[Sun May 19 17:33:17 2013] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c6,c356
[Sun May 19 17:33:17 2013] [notice] Digest: generating secret for digest authentication ...
[Sun May 19 17:33:17 2013] [notice] Digest: done
[Sun May 19 17:33:17 2013] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured -- resuming normal operations

有没有人有任何想法可能出错?

P.S。如果需要,那就部署了项目源代码:https://github.com/uncleLem/CustomerQuiz(我刚刚更改了数据库连接参数)。

P.P.S。哦,顺便说一句,如果我直接打开https://customerquiz-unclelem.rhcloud.com/phpmyadmin/,我可以看到phpMyAdmin页面。

1 个答案:

答案 0 :(得分:2)

我们没有将mod_wsgi与这些新推车一起使用。 2.7使用gevent和3.3使用WebOb

看看我们如何在2.7购物车中设置app.py
https://github.com/openshift/openshift-community-cartridge-python-2.7/blob/master/template/app.py

和3.3 https://github.com/openshift/openshift-community-cartridge-python-3.3/blob/master/template/app.py

您可以查看以下博客文章,了解它是否有帮助? https://www.openshift.com/blogs/host-python-in-a-community-cart