{"id":287,"date":"2026-01-30T11:24:20","date_gmt":"2026-01-30T02:24:20","guid":{"rendered":"https:\/\/socialakiba.com\/?p=287"},"modified":"2026-01-30T11:32:39","modified_gmt":"2026-01-30T02:32:39","slug":"287","status":"publish","type":"post","link":"https:\/\/socialakiba.com\/?p=287","title":{"rendered":"venv"},"content":{"rendered":"\n<p>\u3084\u3063\u3068 venv \u304c\u308f\u304b\u3063\u3066\u304d\u305f\u3002<\/p>\n\n\n\n<p>python3 -m venv venv<br>venv\/bin\/pip install fastapi uvicorn ollama<\/p>\n\n\n\n<p>python3 \u3067 venv \u3057\u3066\u304b\u3089 venv\/bin \u306e\u30b3\u30de\u30f3\u30c9(pip\u3068\u304bpython3\u306a\u3069\u3082)\u3092\u4f7f\u3046\u3068\u3044\u3046\u3053\u3068\u3084\u306d\u3002\u308f\u304b\u308a\u306b\u304f\u3059\u304e\u308b\u3002<\/p>\n\n\n\n<p>bin\/uvicorn main:app &#8211;reload<\/p>\n\n\n\n<p>\u3053\u306e uvicorn \u3068\u3044\u3046\u306e\u304c python3 \u304b\u3089\u8d77\u52d5\u3059\u308b http\u30b5\u30fc\u30d0\u30fc\u3089\u3057\u3044\u3002main.py \u304b\u3089 fastapi \u3092\u547c\u3076\u3002<\/p>\n\n\n\n<p> uvicorn \u306f localhost (127.0.0.1) \u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304c\u5916\u306b\u516c\u958b\u3059\u308b\u306b\u306f apache2 \u306e ProxyPass \u3092\u4f7f\u3063\u305f\u65b9\u304c\u3088\u3055\u3052\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>a2enmod proxy<br>a2enmod proxy_http<br>systemctl restart apache2<br>journalctl -xeu apache2<\/p>\n\n\n\n<p>LoadModule proxy_module modules\/mod_proxy.so<br>LoadModule proxy_http_module modules\/mod_proxy_http.so<br>ProxyRequests Off<br>ProxyPass &#8220;\/api\/&#8221; &#8220;http:\/\/127.0.0.1:8000\/&#8221;<br>ProxyPassReverse &#8220;\/api\/&#8221; &#8220;http:\/\/127.0.0.1:8000\/&#8221;<\/p>\n\n\n\n<p>\u3084\u3063\u3068\u3053\u3053\u307e\u3067\u306f\u304d\u305f\u3002\u6b21\u306b api \u30b5\u30fc\u30d0\u30fc\u304b\u3089 ollama \u3092\u547c\u3076\u3068\u3053\u308d\u3060\u306a\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3084\u3063\u3068 venv \u304c\u308f\u304b\u3063\u3066\u304d\u305f\u3002 python3 -m venv venvvenv\/bin\/pip install fastapi uvicorn ollama python3 \u3067 venv \u3057\u3066\u304b\u3089 venv\/bin &hellip; <a href=\"https:\/\/socialakiba.com\/?p=287\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;venv&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-287","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287"}],"version-history":[{"count":3,"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions"}],"predecessor-version":[{"id":290,"href":"https:\/\/socialakiba.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions\/290"}],"wp:attachment":[{"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/socialakiba.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}