{"id":477,"date":"2016-05-16T23:20:19","date_gmt":"2016-05-16T14:20:19","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2016\/05\/16\/django_centos7\/"},"modified":"2016-05-16T23:20:19","modified_gmt":"2016-05-16T14:20:19","slug":"django_centos7","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2016\/05\/16\/django_centos7\/","title":{"rendered":"Django \u3092 CentOS7\u3067\u52d5\u304b\u3059"},"content":{"rendered":"<p>Django \u3092 CentOS7 \u3067\u52d5\u304b\u3059\u6700\u4f4e\u9650\u30e1\u30e2<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/django\/\">\u3053\u308c\u307e\u3067\u3001CentOS6 \u3084\u3089\u3001AWS\u3084\u3089\u3067Django\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u304d\u305f<\/a> \u304c\u3001CentOS7\u4e0a\u306b\u3001\u306a\u308b\u3079\u304f\u7c21\u5358\u3001\u6700\u4f4e\u9650\u3067(\u624b\u629c\u304d)\u3067\u74b0\u5883\u3092\u4f5c\u308a\u305f\u3044\u3002<\/p>\n<p> <a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/B00P8DQZY4\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=B00P8DQZY4&amp;linkCode=as2&amp;tag=typea09-22\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=B00P8DQZY4&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\" \/><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=B00P8DQZY4\" width=\"1\" height=\"1\" \/>   <\/p>\n<h2>1.EPEL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3067\u3001\u6700\u65b0\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3001rpm \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p><a title=\"http:\/\/www.liquidweb.com\/kb\/how-to-install-pip-on-centos-7\/\" href=\"http:\/\/www.liquidweb.com\/kb\/how-to-install-pip-on-centos-7\/\">http:\/\/www.liquidweb.com\/kb\/how-to-install-pip-on-centos-7\/<\/a><\/p>\n<p><a href=\"http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/\">http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/<\/a> \u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d<\/p>\n<pre class=\"prettyprint linenums\">rpm -iUvh <a href=\"http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/epel-release-7-6.noarch.rpm\">http:\/\/dl.fedoraproject.org\/pub\/epel\/7\/x86_64\/e\/epel-release-7-6.noarch.rpm\r\n<\/a><\/pre>\n<p>yum \u3092\u66f4\u65b0\u3057\u3066\u304a\u304f<\/p>\n<pre class=\"prettyprint linenums\">yum -y update<\/pre>\n<h2>2.pip \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u3053\u308c\u3067\u3001pip \u304cyum\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002pip\u304c\u5c0e\u5165\u3067\u304d\u308c\u3070\u3001\u6700\u8fd1\u306ePython\u3060\u3068\u4f55\u3068\u304b\u306a\u308b\u611f\u3002<\/p>\n<pre class=\"prettyprint linenums\">yum install python-pip<\/pre>\n<h2>3.Django\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u30ed\u30fc\u30ab\u30eb\u3067\u306e\u52d5\u4f5c\u78ba\u8a8d\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5408\u308f\u305b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<p>CentOS6 \u306e\u3068\u304d\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306ePython\u304c\u30012.6 \u3060\u3063\u305f\u306e\u3067\u30012.7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u304b\u9762\u5012\u3060\u3063\u305f\u304c\u3001CentOS7 \u3067\u306f\u30012.7 \u306a\u306e\u3067\u305d\u306e\u307e\u307e\u5229\u7528\u3059\u308b\u3002<\/p>\n<p>VirtualEnv \u4f7f\u3063\u305f\u307b\u3046\u304c\u826f\u3044\u304b\u3082\u3060\u304c\u3001\u4eca\u56de\u306f\u7c21\u6613\u3002<\/p>\n<pre class=\"prettyprint linenums\">pip install Django==1.9.6<\/pre>\n<h2>4.mod_wsgi<\/h2>\n<p>apache \u3068 django \u3092\u3064\u306a\u3050\u305f\u3081\u306e mod_wsgi \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p><a title=\"http:\/\/www.unixmen.com\/configure-django-with-apache-centos-7\/\" href=\"http:\/\/www.unixmen.com\/configure-django-with-apache-centos-7\/\">http:\/\/www.unixmen.com\/configure-django-with-apache-centos-7\/<\/a><\/p>\n<pre class=\"prettyprint linenums\">yum install mod_wsgi<\/pre>\n<p>django \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b<\/p>\n<pre class=\"prettyprint linenums\"> vi \/etc\/httpd\/conf.d\/django.conf<\/pre>\n<p>WSGIScriptAlias \u306b\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3055\u308c\u305f\u30d1\u30b9&quot;\/&quot; \u3092\u8ee2\u9001\u3059\u308b\u30d1\u30b9 &quot;&#8230;wsgi.py&quot; \u3092\u6307\u5b9a\u3002<\/p>\n<p>WSGIPythonPath \u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u3092\u6307\u5b9a<\/p>\n<p><a title=\"https:\/\/docs.djangoproject.com\/ja\/1.9\/howto\/deployment\/wsgi\/modwsgi\/\" href=\"https:\/\/docs.djangoproject.com\/ja\/1.9\/howto\/deployment\/wsgi\/modwsgi\/\">https:\/\/docs.djangoproject.com\/ja\/1.9\/howto\/deployment\/wsgi\/modwsgi\/<\/a><\/p>\n<pre class=\"prettyprint linenums\"><p>WSGIScriptAlias \/ \/path\/to\/mysite.com\/mysite\/wsgi.py<br \/>WSGIPythonPath \/path\/to\/mysite.com<\/p><p>&lt;Directory \/path\/to\/mysite.com\/mysite&gt;<br \/>&lt;Files wsgi.py&gt;<br \/>Require all granted<br \/>&lt;\/Files&gt;<br \/>&lt;\/Directory&gt;<\/p><\/pre>\n<h2>5.\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3059\u308b\u5834\u5408\u3001\u6709\u52b9\u5316<\/h2>\n<p>\u3053\u3053\u307e\u3067\u3067\u3001\u5b9f\u884c\u3057\u3066\u3082\u3001\u305a\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u3068 permission \u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n<p>\u7d50\u5c40\u3001\u81ea\u5206\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3001git \u304b\u3089 pull \u3057\u305fDjango\u30a2\u30d7\u30ea\u3092\u7f6e\u3044\u3066\u3044\u305f\u306e\u3060\u304c\u3001<\/p>\n<p>\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u7de8\u96c6\u3057\u3001apache \u306e UserDir \u3092\u6709\u52b9\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002<\/p>\n<p>\/etc\/httpd\/conf.d\/userdir.conf<\/p>\n<pre class=\"prettyprint linenums\">&lt;IfModule mod_userdir.c&gt;\r\n    #\r\n    # UserDir is disabled by default since it can confirm the presence\r\n    # of a username on the system (depending on home directory\r\n    # permissions).\r\n    #\r\n    UserDir enable\r\n    #\r\n    # To enable requests to \/~user\/ to serve the user's public_html\r\n    # directory, remove the &quot;UserDir disabled&quot; line above, and uncomment\r\n    # the following line instead:\r\n    #\r\n    #UserDir public_html\r\n&lt;\/IfModule&gt;<\/pre>\n<h2>6.Web\u30b5\u30fc\u30d0\u30fc\u306e\u518d\u8d77\u52d5<\/h2>\n<pre class=\"prettyprint linenums\">systemctl restart httpd.service<\/pre>\n<p>\u4ee5\u4e0a\u3002<\/p>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u3068\u308c\u305f\u3002<\/p>\n<p>\u6570\u6642\u9593\u3001\u4e0a\u8a185.\u3067\u306f\u307e\u3063\u305f\u304c\u3001\u524d\u306b\u6bd4\u3079\u308c\u3070\u7c21\u5358\u306b\u306a\u3063\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Django \u3092 CentOS7 \u3067\u52d5\u304b\u3059\u6700\u4f4e\u9650\u30e1\u30e2 \u3053\u308c\u307e\u3067\u3001CentOS6 \u3084\u3089\u3001AWS\u3084\u3089\u3067Django\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u304d\u305f \u304c\u3001CentOS7\u4e0a\u306b\u3001\u306a\u308b\u3079\u304f\u7c21\u5358\u3001\u6700\u4f4e\u9650\u3067(\u624b\u629c\u304d)\u3067\u74b0\u5883\u3092\u4f5c\u308a\u305f\u3044\u3002 1.EPEL  [&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":[64,29],"tags":[],"class_list":["post-477","post","type-post","status-publish","format-standard","hentry","category-centos","category-django"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/477","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=477"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/477\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}