{"id":369,"date":"2018-03-18T17:30:41","date_gmt":"2018-03-18T08:30:41","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=369"},"modified":"2018-03-19T23:34:07","modified_gmt":"2018-03-19T14:34:07","slug":"mod_wsgi%e3%81%a8httpd%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%a7%e6%b0%97%e3%82%92%e3%81%a4%e3%81%91%e3%82%8b%e3%81%b9%e3%81%8d%e4%ba%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=369","title":{"rendered":"mod_wsgi\u3068httpd\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u6c17\u3092\u3064\u3051\u308b\u3079\u304d\u4e8b"},"content":{"rendered":"<p>\u73fe\u5728\u3001\u500b\u4eba\u7684\u306a\u958b\u767a\u3067python\u306e<strong>Flask<\/strong>\u3092\u4f7f\u3063\u305f\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u69cb\u7bc9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3068\u3082\u3068<strong>dlib<\/strong>\u3092\u4f7f\u3046\u305f\u3081\u306bpython\u306b\u3057\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u5b9f\u306f\u3053\u308c\u3002\u30a6\u30a7\u30d6\u306b\u8a2d\u7f6e\u3059\u308b\u306e\u306b\u3081\u3061\u3083\u304f\u3061\u3083\u624b\u9593\u53d6\u3063\u3066\u3057\u307e\u3063\u305f\u3093\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u4eca\u56de\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">mod_wsgi\u3001httpd\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u6c17\u3092\u3064\u3051\u308b\u3079\u304d\u3053\u3068<\/strong><\/p>\n<p>\u3092\u5b9f\u4f53\u9a13\u306e\u6d41\u308c\u3067\u307e\u3068\u3081\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u524d\u63d0\u3068\u3057\u3066<\/p>\n<p><strong style=\"font-size: 35px;\">mode_wsgi\u3068httpd\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u81ea\u4f53\u306f\u3068\u3066\u3082\u7c21\u5358<\/strong><\/p>\n<p>\u3067\u3059\u3002\u50d5\u306e\u74b0\u5883\uff08CentOS 7\uff09\u3060\u3068\u3001<strong>yum\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u3051\u3070\u3001mod_wsgi\u3068httpd\uff08apache2\uff09\u304c\u697d\u301c\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3067\u3082\u3001\u5f8c\u304b\u3089\u8003\u3048\u308b\u3068\u554f\u984c\u70b9\u306f\u3053\u3053\u306b\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u306f\u3058\u3081\u3001dlib\u3092pip\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3059\u3054\u304f\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3046\uff08\u2190dlib\u3092\u30bc\u30ed\u304b\u3089\u30d3\u30eb\u30c9\u3059\u308b\uff09\u306e\u3067\u3001\u3059\u3050\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b<strong>anaconda\u3092\u4f7f\u3046<\/strong>\u3053\u3068\u306b\u3057\u305f\u3093\u3067\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u3053\u306eanaconda\u3002\u3082\u3061\u308d\u3093\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u76f4\u63a5\u300cpython test.py\u300d\u3068\u5b9f\u884c\u3057\u305f\u3089\u3046\u307e\u304f\u52d5\u304f\u3093\u3067\u3059\u3051\u3069\u3001mod_wsgi\u3092\u901a\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">no module named dlib\uff08dlib\u30e2\u30b8\u30e5\u30fc\u30eb\u306a\u3093\u304b\u306d\u301c\u3088\uff01\uff09<\/strong><\/p>\n<p>\u3068\u30a8\u30e9\u30fc\u3092\u51fa\u3059\u3093\u3067\u3059\u3002<br \/>\n\u3057\u304b\u3082\u3001flask\u306e\u958b\u767a\u30e2\u30fc\u30c9\u3067\u300chttp:\/\/*****:5000\u300d\u3067\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3089\u3046\u307e\u304f\u3044\u304f\u3068\u3044\u3046\u30fb\u30fb\u30fbmod_wsgi\u3060\u3051\u304c\u554f\u984c\u306a\u306e\u304b\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u3057\u304b\u305f\u304c\u306a\u3044\u306e\u3067\u3001\u30a6\u30a7\u30d6\u4e0a\u3092\u63a2\u3063\u3066\u307f\u308b\u3068\u3001\u8ab0\u304b\u304c<\/p>\n<p><strong style=\"font-size: 35px;\">Python3\u4f7f\u3044\u306a\u3088\u30022\u306f\u30d0\u30b0\u3042\u308b\u3088\uff01\uff08\u30ad\u30e9\u301c\u30f3\u3001\u9aea\u306e\u6bdb\u30b5\u30e9\u301c\uff09<\/strong><\/p>\n<p>\u3068\u8a00\u3063\u3066\u308b\u306e\u3092\u307f\u305f\u306e\u3067\u3001<strong>pyenv<\/strong>\u3092\u4f7f\u3063\u3066<strong>python 3<\/strong>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u306b\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u518d\u5ea6\u30a6\u30a7\u30d6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u305f\u3082\u306e\u306e\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">no module named dlib\uff08\u3060\u304b\u3089dlib\u306a\u3093\u304b\u306d\u3047\u3093\u3060\u3088\u3063\uff01\uff01\uff09<\/strong><\/p>\n<p>\u3068\u4f55\u3082\u5909\u308f\u3089\u305a\u3002<br \/>\n\u305d\u3053\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306b<strong>sys.path<\/strong>\u3092\u4fdd\u5b58\u3057\u3066\u307f\u308b\u3068\u3001\u307e\u3063\u305f\u304f\u5225\u306ePython\u3092\u53c2\u7167\u3057\u3066\u308b\u3053\u3068\u304c\u5224\u660e\u3002<\/p>\n<p>\u305d\u3063\u304b\u3001conda\u3068\u304bpyenv\u3092\u4f7f\u3063\u3066\u3044\u3066\u3082\u3001<strong>mod_wsgi\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u304d\u306b\u30b7\u30b9\u30c6\u30e0\u4e0apython\u3092\u53c2\u7167\u3057\u3084\u304c\u308b<\/strong>\u306e\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\uff08\u6c57\uff09<\/p>\n<p>\u305d\u3053\u3067\u3001\u30bd\u30fc\u30b9\u304b\u3089\u30d3\u30eb\u30c9\u3057\u3088\u3046\u3068\u3057\u305f\u308a\uff08\u2190python\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3067\u304d\u308b\u3089\u3057\u3044\uff09\u3001WSGIPythonHome\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306a\u3069\u3092\u4f7f\u3063\u305f\u308a\u3057\u307e\u3057\u305f\u3051\u3069\u3001\u4eca\u5ea6\u306f\u300cno module named site\u300d\u3068\u6839\u672c\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u307e\u3067\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u3093\u3067\u3001\u3082\u3046\u4e00\u756a\u6700\u521d\u306e\u30a2\u30a4\u30c7\u30a2\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">pip\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/strong><\/p>\n<p>\u3068\u3044\u3046\u65b9\u6cd5\u306b\u5207\u308a\u66ff\u3048\u307e\u3057\u305f\u3002\uff08\u3081\u3093\u3069\u3046\u306a\u306e\u3067\u3001VPS\u3067OS\u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5f8c\uff09pip\u3067dlib\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b9f\u884c\u3057\u3001<strong>\u300c\u304a\u3044\u304a\u3044\u3001\u3053\u308c\u3082\u3046\u6b62\u307e\u3063\u3066\u3093\u3058\u3083\u306d\uff01\uff1f\u300d<\/strong>\u3068\u3044\u3046\u6050\u6016\u306b\u8010\u3048\u306a\u304c\u3089\u6c17\u9577\u306b\u5f85\u3064\u3053\u3068\u5341\u6570\u5206\u3002<\/p>\n<p>\u3084\u308c\u6a29\u9650\u304c\u306a\u3044\u3001\u3068\u304b\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u306a\u3044\u3001\u3068\u304b\u306e\u30a8\u30e9\u30fc\u3092\u5bfe\u51e6\u3057\u3064\u3064\u3084\u3063\u3068dlib\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001httpd\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306aconf\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3042\u3052\u3066\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f<\/p>\n<pre><strong>&lt;VirtualHost example.com&gt;<\/strong>\r\n\u00a0 <strong>ServerNameexample.com<\/strong>\r\n<strong>  WSGIScriptAlias \/ \/var\/www\/html\/*****\/your.wsgi<\/strong>\r\n<strong>&lt;\/VirtualHost&gt;<\/strong><\/pre>\n<p><strong style=\"font-size: 35px;\">\u3084\u3063\u3068\u3001\u3046\u307e\u304f\u8d77\u52d5\u3067\u304d\u307e\u3057\u305f\uff01<\/strong><\/p>\n<p>\u30db\u30f3\u30c8\u3001\u9014\u4e2d\u3069\u308c\u3060\u3051<strong>stack overflow<\/strong>\u306e\u30da\u30fc\u30b8\u3092\u898b\u306b\u884c\u3063\u305f\u3053\u3068\u304b\u30fb\u30fb\u30fb\uff08\u6c57\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3042\u307e\u308amod_wsgi\u306b\u8a73\u3057\u304f\u306a\u3044\u5834\u5408\u306fpip\u4e00\u629e\u3067\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3057\u3087\u3046\u3001\u3068\u3044\u3046\u304a\u8a71\u3067\u3057\u305f\uff08\u7b11\uff09<\/p>\n<p>\u306b\u3057\u3066\u3082\u3001mod_wsgi\u3001\u30de\u30b8\u3084\u3063\u304b\u3044\u3067\u3059\u306d\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>&nbsp;<\/p>\n<p>\u3010\u8ffd\u8a18\uff1a2018\/03\/19\u3011<\/p>\n<p>\u30a6\u30a7\u30d6\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u5f8c\u3001python\u306epip\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fopencv\u3068dlib\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u3069\u3046\u3044\u3046\u308f\u3051\u304b\u3046\u307e\u304f\u3044\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\uff08python ****.py\u306a\u3089\u3046\u307e\u304f\u3044\u304f\u306e\u306b\u30fb\u30fb\u30fb\uff09<\/p>\n<p>\u3044\u308d\u3044\u308d\u3068\u8abf\u67fb\u3057\u305f\u7d50\u679c\u3001httpd\u306econf\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u8ffd\u52a0\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3069\u3046\u3084\u3089\u6a29\u9650\u304c\u8db3\u308a\u3066\u306a\u304b\u3063\u305f\u3088\u3046\u3067\u3059\u3002<\/p>\n<pre><strong>WSGIApplicationGroup %{GLOBAL}<\/strong><\/pre>\n<h1>\u3061\u306a\u307f\u306b<\/h1>\n<p>\u9014\u4e2d\u3001\u300capxs\u304c\u306d\u30fc\u305e\uff01\u300d\u3068\u8a00\u308f\u308c\u305f\u3089\u3001<strong>httpd-devel<\/strong>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3042\u3068\u3001\u306f\u3058\u3081\u3066flask\u3092\u89e6\u3063\u3066\u307f\u305f\u611f\u60f3\u3068\u3057\u3066\u306f\u3001<strong>\u300cpython\u3092\u4f7f\u3063\u3066\u3053\u3053\u307e\u3067\u7c21\u5358\u306b\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3092\u958b\u767a\u3067\u304d\u308b\u3063\u3066\u30de\u30b8\u3044\u3044\u306d\uff01\u300d<\/strong>\u3067\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u3084\u3063\u3071\u308a\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306e\u69cb\u7bc9\u306fLaravel\u306e\u65b9\u304c\u4e0a\u304b\u306a\u30fc\u3068\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u4f8b\u3048\u3070flask\u306e\u5834\u5408\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u81ea\u5206\u3067\u5b9f\u88c5\u3057\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u3067\u3059\u3057\u3001\u305d\u306e\u4ed6\u306e\u6a5f\u80fd\u3082Laravel\u306e\u65b9\u304c\u81f3\u308c\u308a\u5c3d\u304f\u305b\u308a\u3068\u3044\u3063\u305f\u5370\u8c61\u3067\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u4eca\u56de\u306e\u3088\u3046\u306bdlib\u3084opencv\u3092\u4f7f\u3063\u305f\u30b5\u30a4\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u5834\u5408\u4ee5\u5916\u306f\u3001Laravel\u3067\u306e\u958b\u767a\u306b\u306a\u308a\u305d\u3046\u3067\u3059\u3002\uff08\u3082\u3057\u304f\u306f\u3001\u30e1\u30a4\u30f3\u306fLaravel\u3067\u3001\u5fc5\u8981\u306a\u30da\u30fc\u30b8\u3060\u3051flask\u3067\u4f5c\u3063\u3066\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3067\u516c\u958b\u3059\u308b\u307f\u305f\u3044\u306a\u300c\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u5f62\u5f0f\u300d\u304c\u3044\u3044\u3067\u3059\u306d\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u4ee5\u4e0a\u3067\u3059\u3002<br \/>\n\u3067\u306f\u3067\u306f\u301c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u5728\u3001\u500b\u4eba\u7684\u306a\u958b\u767a\u3067python\u306eFlask\u3092\u4f7f\u3063\u305f\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u69cb\u7bc9\u3057\u3066\u3044\u307e\u3059\u3002 \u3082\u3068\u3082\u3068dlib\u3092\u4f7f\u3046\u305f\u3081\u306bpython\u306b\u3057\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u5b9f\u306f\u3053\u308c\u3002\u30a6\u30a7\u30d6 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=369\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;mod_wsgi\u3068httpd\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u6c17\u3092\u3064\u3051\u308b\u3079\u304d\u4e8b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":370,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,39],"tags":[51,53,52],"class_list":["post-369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-python","tag-flask","tag-httpd","tag-mode_wsgi"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369"}],"version-history":[{"count":3,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":373,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions\/373"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/370"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}