{"id":439,"date":"2015-01-05T21:28:57","date_gmt":"2015-01-05T12:28:57","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev4\/"},"modified":"2015-01-05T21:28:57","modified_gmt":"2015-01-05T12:28:57","slug":"aws_elastic_beanstalk_django_centos65_pydev4","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev4\/","title":{"rendered":"AWS Elastic Beanstalk Django \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u74b0\u5883\u3092 CentOS6.5 \u4e0a\u306b PyDev\u3092\u4f7f\u3063\u3066\u69cb\u7bc9\u3059\u308b(4) \u3044\u304f\u3064\u304b\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev1_django\" target=\"_blank\">(1) Django\u8d77\u52d5\u307e\u3067<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev2_tips_sshrds\" target=\"_blank\">(2) (TIPS) SSH\u3001RDS\u3078\u306e\u63a5\u7d9a<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev3_tips\" target=\"_blank\">(3) (TIPS) \u30ed\u30b0\u306e\u78ba\u8a8d\u3068\u30c7\u30d7\u30ed\u30a4\u7d50\u679c\u306e\u78ba\u8a8d<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev4\" target=\"_blank\">(4) \u3044\u304f\u3064\u304b\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev5\" target=\"_blank\">(5) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/06\/aws_elastic_beanstalk_django_centos65_pydev6_createadmin\" target=\"_blank\">(6) createadmin \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/31\/aws_elastic_beanstalk_django_7_ipdns\" target=\"_blank\">(7) \u9759\u7684IP\u30a2\u30c9\u30ec\u30b9\u306e\u8a2d\u5b9a\u3068\u30c9\u30e1\u30a4\u30f3\u306e\u53d6\u5f97\u3068DNS\u306e\u8a2d\u5b9a<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/05\/20\/aws_elastic_beanstalk_rds_utf-8\" target=\"_blank\">AWS Elastic Beanstalk RDS \u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092utf-8\u306b\u8a2d\u5b9a\u3057\u306a\u304a\u3059<\/a><\/li>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/07\/02\/djangoaws_elasticbeanstalk\" target=\"_blank\">Django\u3067\u30d0\u30c3\u30c1\u51e6\u7406\u3092\u884c\u3046(AWS Elasticbeanstalk)<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev1_django\">AWS Elastic Beanstalk Django \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u74b0\u5883\u3092 CentOS6.5 \u4e0a\u306b PyDev\u3092\u4f7f\u3063\u3066\u69cb\u7bc9\u3059\u308b(1) Django\u8d77\u52d5\u307e\u3067<\/a><\/p>\n<p>\u3067\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3002<\/p>\n<p>\u3044\u304f\u3064\u304b\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8\u3092\u4ee5\u4e0b\u306b\u5099\u5fd8\u3002<\/p>\n<h2>1.SignatureDoesNotMatch \u30a8\u30e9\u30fc<\/h2>\n<h3>1.1 \u73fe\u8c61<\/h3>\n<p>eb start \u3057\u305f\u3068\u304d\u306a\u3069\u3001\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">SignatureDoesNotMatch. Signature expired: 20150102T071152Z is now earlier than 20150102T133521Z (20150102T134021Z - 5 min.)<\/pre>\n<h3>1.2 \u539f\u56e0\u3068\u5bfe\u5fdc<\/h3>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8PC\u306e\u6642\u9593\u304c\u95be\u5024\u3092\u3053\u3048\u3066\u305a\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u6642\u9593\u3092\u3042\u308f\u305b\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3002<\/p>\n<p>\u307e\u305f\u306f\u3001\u30bf\u30a4\u30e0\u30b5\u30fc\u30d3\u30b9\u3092\u69cb\u6210\u3059\u308b\u3002NTP\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3002\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u3001<\/p>\n<p>yum insetall ntp<\/p>\n<pre class=\"prettyprint linenums\">[root@localhost ~]# rpm -qa ntp\r\nntp-4.2.6p5-1.el6.centos.i686<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5<\/p>\n<pre class=\"prettyprint linenums\">[root@localhost ~]# service ntpd start                                                                            \r\nntpd \u3092\u8d77\u52d5\u4e2d: <\/pre>\n<p>Level3\u304a\u3088\u30735\u3067\u81ea\u52d5\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u69cb\u6210<\/p>\n<pre class=\"prettyprint linenums\">[root@localhost ~]# chkconfig --level 3 --level 5 ntpd on\r\n[root@localhost ~]# chkconfig --list ntpd                                                                         \r\nntpd            0:off   1:off   2:off   3:on    4:off   5:on    6:off<\/pre>\n<h2>2.Target WSGI script not found or unable to stat \u30a8\u30e9\u30fc\u3068\u306a\u308b<\/h2>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/20910461\/django-elastic-beanstalk-deploy-showing-404\">http:\/\/stackoverflow.com\/questions\/20910461\/django-elastic-beanstalk-deploy-showing-404<\/a> <br \/><a href=\"http:\/\/stackoverflow.com\/questions\/17713871\/target-wsgi-script-not-found-or-unable-\">http:\/\/stackoverflow.com\/questions\/17713871\/target-wsgi-script-not-found-or-unable-<\/a> <\/p>\n<h3>2.1 \u73fe\u8c61<\/h3>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068Not Found \u30a8\u30e9\u30fc\u3068\u306a\u308a\u3001<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/AWS-Elastic-Beans.5--PyDev4-Troubleshoot_12541\/not_found_err.png\"><img loading=\"lazy\" decoding=\"async\" title=\"not_found_err\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" border=\"0\" alt=\"not_found_err\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/AWS-Elastic-Beans.5--PyDev4-Troubleshoot_12541\/not_found_err_thumb.png\" width=\"361\" height=\"150\" \/><\/a><\/p>\n<\/p>\n<p>\u30a8\u30e9\u30fc\u30ed\u30b0\u306b\u306f\u3001Target WSGI script not found or unable to stat \u304c\u8a18\u9332\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">-------------------------------------\r\n\/var\/log\/httpd\/error_log\r\n-------------------------------------\r\n[Sat Jan 03 01:31:28.312782 2015] [:error] [pid 2297] [client 127.0.0.1:35123] Target WSGI script not found or unable to stat: \/opt\/python\/current\/app\/application.py\r\n[Sat Jan 03 01:31:57.774374 2015] [:error] [pid 2300] [client 172.31.8.41:64447] Target WSGI script not found or unable to stat: \/opt\/python\/current\/app\/application.py<\/pre>\n<\/p>\n<h3>2.2 \u539f\u56e0\u3068\u5bfe\u5fdc<\/h3>\n<p>\u3053\u308c\u304c\u7d50\u69cb\u3084\u3063\u304b\u3044\u3002\u3002\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev1_django\">\u3053\u306e\u624b\u9806\u3067\u74b0\u5883\u69cb\u7bc9\u3059\u308b\u3068\u767a\u751f\u3057\u306a\u304b\u3063\u305f\u3002<\/a><\/p>\n<p>\u539f\u56e0\u3068\u3057\u3066\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u5024 WSGI Path \u306e\u8a2d\u5b9a\u5024\u306f\u3001\/application.py  \u306e\u3088\u3046\u306a\u306e\u3060\u3002<\/p>\n<p><a href=\"http:\/\/docs.aws.amazon.com\/ja_jp\/elasticbeanstalk\/latest\/dg\/create_deploy_Python_django.html\">\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u624b\u9806\u901a\u308a\u5b9f\u65bd\u3057\u305f\u5834\u5408<\/a>\u3001Elastic Beanstalk \u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u8a2d\u5b9a\u304b\u3089Software Configuration \u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001WSGIPath : application.py) \u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/AWS-Elastic-Beans.5--PyDev4-Troubleshoot_12541\/wsgi_config_default.png\"><img loading=\"lazy\" decoding=\"async\" title=\"wsgi_config_default\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" border=\"0\" alt=\"wsgi_config_default\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/AWS-Elastic-Beans.5--PyDev4-Troubleshoot_12541\/wsgi_config_default_thumb.png\" width=\"293\" height=\"186\" \/><\/a><\/p>\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u6210\u306f\u3001\/myapplication\/wsgi.py \u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">[root@localhost phrase]# tree\r\n.\r\n\u251c\u2500\u2500 manage.py\r\n\u251c\u2500\u2500 phrase\r\n\u2502   \u251c\u2500\u2500 __init__.py\r\n\u2502   \u251c\u2500\u2500 __init__.pyc\r\n\u2502   \u251c\u2500\u2500 settings.py\r\n\u2502   \u251c\u2500\u2500 settings.pyc\r\n\u2502   \u251c\u2500\u2500 urls.py\r\n\u2502   \u251c\u2500\u2500 urls.pyc\r\n\u2502   \u251c\u2500\u2500 wsgi.py\r\n\u2502   \u2514\u2500\u2500 wsgi.pyc\r\n\u2514\u2500\u2500 requirements.txt<\/pre>\n<p>\u3057\u304b\u3057\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067.ebextensiions\/xxxx.config\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3059\u308b\u306e\u306f\u3001\u3001\/myapplication\/wsgi.py<\/p>\n<pre class=\"prettyprint linenums\">[root@localhost phrase]# cat .ebextensions\/phrase.config                                                          \r\ncontainer_commands:\r\n  01_syncdb:    \r\n    command: \"django-admin.py syncdb --noinput\"\r\n    leader_only: true\r\n\r\noption_settings:\r\n  - namespace: aws:elasticbeanstalk:container:python\r\n    option_name: WSGIPath\r\n    value: phrase\/wsgi.py\r\n  - option_name: DJANGO_SETTINGS_MODULE\r\n    value: phrase.settings<\/pre>\n<p>\u3055\u3089\u306b\u3001.elasticbeanstalk \u4ee5\u4e0b\u306b\u81ea\u52d5\u4f5c\u6210\u3055\u308c\u308b\u8a2d\u5b9a\u5024\u3082\u3042\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">[root@localhost phrase]# cat .elasticbeanstalk\/optionsettings.phrase-env \r\n  :(\u7565)\r\n[aws:elasticbeanstalk:container:python]\r\nNumProcesses=1\r\nNumThreads=15\r\nStaticFiles=\/static\/=static\/\r\nWSGIPath=phrase\/wsgi.py<\/pre>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/01\/05\/aws_elastic_beanstalk_django_centos65_pydev1_django\">\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068\u306f\u7570\u306a\u308b\u624b\u9806\u3067\u8a2d\u5b9a<\/a>\u3092\u884c\u3063\u305f\u306e\u3067\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u3001WSGIPath=phrase\/wsgi.py \u3068\u306a\u3063\u3066\u3044\u308b\u304c\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068\u540c\u69d8\u306e\u624b\u9806\u3067\u5b9f\u65bd\u3059\u308b\u3068\u3001\u3053\u3053\u306f WSGIPath=application.py \u3068\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n<blockquote>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u5b9f\u969b\u306f\u89e3\u6c7a\u7b56\u3092\u5b9f\u65bd\u3057\u305f\u308f\u3051\u3067\u306f\u306a\u3044\u304c\u3001\u304a\u305d\u3089\u304f\u4e0a\u8a18\u306e2\u30d5\u30a1\u30a4\u30eb( .ebextensions\/xxxx.config,.elasticbeanstalk\/optionsettings.phrase-env ) \u306e WSGIPath\u306e\u8a2d\u5b9a\u3092\u4fee\u6b63\u3057\u305f\u4e0a\u3067\u3001git commit -a \u3092\u5b9f\u65bd(.ebextensions\/xxxx.config \u306f git \u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u5bfe\u8c61)\u3057\u305f\u4e0a\u3067\u3001\u74b0\u5883\u306e\u66f4\u65b0\u3068Git\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30c7\u30d7\u30ed\u30a4\u3092\u5b9f\u65bd\u3059\u308c\u3070\u89e3\u6c7a\u3059\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u63a8\u6e2c\u3067\u304d\u308b\u3002<\/p>\n<\/blockquote>\n<pre class=\"prettyprint linenums\">(virtualenv)[piroto@localhost phrase]$ eb update\r\n(virtualenv)[piroto@localhost phrase]$ git aws.push<\/pre>\n<p>\n<iframe loading=\"lazy\" width=\"320\" height=\"240\" style=\"height: 240px; width: 120px;\" marginheight=\"0\" src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4839953554\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(1) Django\u8d77\u52d5\u307e\u3067 (2) (TIPS) SSH\u3001RDS\u3078\u306e\u63a5\u7d9a (3) (TIPS) \u30ed\u30b0\u306e\u78ba\u8a8d\u3068\u30c7\u30d7\u30ed\u30a4\u7d50\u679c\u306e\u78ba\u8a8d (4) \u3044\u304f\u3064\u304b\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8 (5) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210 (6) createa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[79,80],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-aws-ec2","category-aws-elastic-beanstalk"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=439"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/439\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}