{"id":2229,"date":"2019-03-06T19:35:37","date_gmt":"2019-03-06T10:35:37","guid":{"rendered":"https:\/\/dona.dip.jp\/?p=2229"},"modified":"2020-03-22T11:56:04","modified_gmt":"2020-03-22T02:56:04","slug":"ubuntu16-04-nginx-%e3%81%a7%e3%81%ae-quoridorn%ef%bc%88%e3%82%b3%e3%83%aa%e3%83%89%e3%83%bc%e3%83%b3%ef%bc%89%e3%81%ae%e8%a8%ad%e7%bd%ae%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/dona-co.art\/?p=2229","title":{"rendered":"Quoridorn \u306e\u8a2d\u7f6e\u65b9\u6cd5 (Ubuntu 16.04 \/ Nginx)"},"content":{"rendered":"<p>Quoridorn (\u30b3\u30ea\u30c9\u30fc\u30f3) \u3092\u8a2d\u7f6e\u3057\u3066\u307f\u3088\u3046\uff01<br \/>\n\u3068\u601d\u3063\u305f\u3051\u3069\u3001\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u3066\u2026\u306b\u3083\u30fc\u3093\uff1f \u3068\u3044\u3046\u521d\u5fc3\u8005\u5411\u3051\u89e3\u8aac\u3067\u3059\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a\u8a2d\u7f6e\u3067\u304d\u305f\uff01\u7a0b\u5ea6\u306a\u306e\u3067\u3001\u9055\u3046\u3084\u308d\u2026\u3068\u601d\u3063\u305f\u3089\u4e00\u756a\u30a4\u30a4\u65b9\u6cd5\u3092\u6559\u3048\u3066\u3061\u3087\u3002<\/p>\n<p><strong>\u74b0\u5883\u3092\u78ba\u8a8d<\/strong><br \/>\nNginx\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\/\u52d5\u4f5c\u6e08\u307f\u3068\u3057\u3066\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre><code>nginx -v\nnginx version: nginx\/1.15.9<\/code><\/pre>\n<p><strong>Node.js\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\nNode.js\u3068\u3086\u30fc\u7269\u3092\u4f7f\u3046\u3089\u3057\u3044\u306e\u3067\u3001Node.js\u3068npm(\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre><code>sudo apt install -y nodejs npm<\/code><\/pre>\n<p>\u5f8c\u3067\u5fc5\u8981\u306b\u306a\u308b\uff08\u305f\u3076\u3093\uff09\u306e\u3067\u4f5c\u3063\u3066\u304a\u304f\u3002<\/p>\n<pre><code>mkdir \/home\/usr\/.node_modules_global\nnpm config set prefix=$HOME\/.node_modules_global\nnpm install npm --global<\/code><\/pre>\n<p><strong>\u30d1\u30b9\u3092\u901a\u3059<\/strong><br \/>\n\u518d\u8d77\u52d5\u3057\u3066\u3082\u5927\u4e08\u592b\u306b\u306a\u3088\u3046\u306b\u30d1\u30b9\u3092\u901a\u3059\u3002<br \/>\n.profile .bash_profile .bashrc \u306b\u305d\u308c\u305e\u308c\u3001\u4ee5\u4e0b\u306e\u4e00\u884c\u3092\u52a0\u3048\u3066\u304a\u304f\u3002<br \/>\n.profile \u3060\u3051\u3067\u826f\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<pre><code>export PATH=\"$HOME\/.node_modules_global\/bin:$PATH\"<\/code><\/pre>\n<p><strong>Quoridorn\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong><br \/>\n\u516c\u5f0f\u30b5\u30a4\u30c8\u306e&#8221;<a href=\"https:\/\/github.com\/HillTopTRPG\/quoridorn\" target=\"_blank\" rel=\"noopener noreferrer\"><strong><em>Clone or dowload<\/em><\/strong><\/a>&#8220;\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066DL\u3001\u4efb\u610f\u306e\u30d5\u30a9\u30eb\u30c0\u3078\u5c55\u958b\u3002<br \/>\n\u4eca\u56de\u306f\u4f8b\u3068\u3057\u3066 \/home\/usr \u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre><code>mv \/home\/usr\/quoridorn-master \/home\/usr\/quoridorn\u3000 #\u9069\u5f53\u306a\u540d\u524d\u306b\u30ea\u30cd\u30fc\u30e0\ncd \/home\/usr\/quoridorn\u3000\u3000\u3000\u3000\u3000 \u3000\u3000\u3000\u3000\u3000 \u3000\u3000 \u3000 #\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u79fb\u52d5\nnpm init\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000#\u95a2\u9023\u4ed8\u3051\uff1f \u5168\u90e8Enter\u3067OK<\/code><\/pre>\n<p><strong>\u74b0\u5883\u8a2d\u5b9a\u3092\u5909\u66f4<\/strong><br \/>\n\u30d3\u30eb\u30c9\u524d\u306b\u76f8\u5bfe\u30d1\u30b9\u306a\u3069\u306e\u8a2d\u5b9a index.js \u3092\u5909\u66f4\u3057\u307e\u3059\u3002<br \/>\n\/home\/usr\/quoridorn\/config\/index.js<\/p>\n<pre style=\"margin: 0; padding: 0;\"><code> \/\/ Various Dev Server settings\n -    host: 'localhost',\n +    host: '127.0.0.1',\u3000\u3000#localhost\u3060\u3068IPv6\u95a2\u9023\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u4e8b\u3082\u3042\u308b\u306e\u3067\u4e00\u5fdc\u5909\u66f4\n\n \/\/ Paths\n \u3000assetsRoot: path.resolve(__dirname, '..\/dist'),\n \u3000assetsSubDirectory: 'static',\n - assetsPublicPath: '\/quoridorn\/dev\/',\n + assetsPublicPath: '.\/',\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000#\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30ea\u30f3\u30af\u5207\u308c\u3068\u306a\u308b\u306e\u3067\u5909\u66f4<\/code><\/pre>\n<p><strong>Quoridorn\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/strong><br \/>\n\u5fc5\u8981\u306a\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u8272\u3005\u805e\u304b\u308c\u308b\u3051\u3069\u3001\u5168\u90e8Enter\u3067OK\u3002<br \/>\nfsevents@1.2.4\u95a2\u9023\u306e\u30a8\u30e9\u30fc\u306f\u7121\u8996\u3057\u3066\u826f\u3044\uff08\u30d0\u30b0\uff1f\u3089\u3057\u3044\uff09\u3002<br \/>\n\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u95a2\u9023\u3067\u30a8\u30e9\u30fc\u306f\u3001sudo \u304b\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u5909\u66f4\u3067\u56de\u907f\u3059\u308b\u3002<\/p>\n<pre><code>sudo npm install<\/code><\/pre>\n<p><strong>Quoridorn\u3092\u30d3\u30eb\u30c9<\/strong><br \/>\nbuild\u5f8c\u306b\u51fa\u308bbcdice-js\u95a2\u9023\u306e\u30a8\u30e9\u30fc\u3082\u7121\u8996\u3057\u3066\u826f\u3044\u305d\u3046\u3067\u3059\u3002<br \/>\nBuild complete. \u3068\u51fa\u308c\u3070\u5b8c\u6210\u3002<\/p>\n<pre><code>sudo npm run build<\/code><\/pre>\n<p><strong>\u30d3\u30eb\u30c9\u3055\u308c\u305f\u5185\u5bb9\u3092\u78ba\u8a8d\/\u79fb\u52d5<\/strong><br \/>\n\u51fa\u6765\u4e0a\u304c\u3063\u305f\u7269\u306f \/home\/usr\/quoridorn\/dist \u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\n\u5fc5\u8981\u3067\u3042\u308c\u3070\u79fb\u52d5\u3059\u308b\u3002<\/p>\n<pre><code>sudo cp -dfpvR \/home\/usr\/quoridorn\/dist \/www\/trpg\/quoridorn<\/code><\/pre>\n<p><strong>SKYWAY KEY\u3092\u7de8\u96c6<\/strong><br \/>\n\u4e8b\u524d\u306b\u53d6\u5f97\u3057\u305fkey\u3092\u5165\u529b\u3059\u308b\u3002\u53d6\u5f97\u65b9\u6cd5\u306f<a href=\"https:\/\/dona.dip.jp\/?p=1612\" target=\"_blank\" rel=\"noopener noreferrer\">\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u306e\u3053\u3068\u3002<br \/>\n\/home\/usr\/quoridorn\/dist\/static\/key.js<\/p>\n<pre style=\"margin: 0; padding: 0;\"><code> - window.__SKYWAY_KEY__ = '*****_*****_*****_*****_*****'\n + window.__SKYWAY_KEY__ = 'nakatyaN-kawaii-Idol-Korekaramo-4649Ne'<\/code><\/pre>\n<p><strong>Nginx\u306e\u8a2d\u5b9a<\/strong><br \/>\n\uff0a.conf\u3092\u8a2d\u5b9a\u3002location \u3068 alias \u3092\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n\/etc\/nginx\/hoge.d\/hoge.conf<\/p>\n<pre style=\"margin: 0; padding: 0;\"><code>server {\n    listen       80;\n    server_name  kancolle.idol.world;\n\n#TRPG_Quoridorn\n          location   \/quoridorn {\n          alias      \/home\/usr\/quoridorn\/dist;\n          index      index.php index.html;\n \n            location ~ \\.(php|html)$ {\n            ...\n            }\n          }\n}<\/code><\/pre>\n<p>\u516c\u958b\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4(\u30bf\u30d6\u30f3\u5fc5\u8981)\u3002<\/p>\n<pre><code>sudo chown nginx:nginx -R \/home\/usr\/quoridorn\/dist<\/code><\/pre>\n<p><strong>\u518d\u8d77\u52d5\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u78ba\u8a8d\u3002<\/strong><\/p>\n<pre><code>nginx -t\nsudo systemctl restart nginx<\/code><\/pre>\n<p><strong>\u5c0e\u5165\u4f8b<\/strong><br \/>\n<a href=\"https:\/\/dona-co.art\/qrdn\/\" target=\"_blank\" rel=\"noopener noreferrer\">Quoridorn \u82f1\u56fd\u30e1\u30a4\u30c9\u30b5\u30fc\u30d0\u30fc<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quoridorn (\u30b3\u30ea\u30c9\u30fc\u30f3) \u3092\u8a2d\u7f6e\u3057\u3066\u307f\u3088\u3046\uff01 \u3068\u601d\u3063\u305f\u3051\u3069\u3001\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u3066\u2026\u306b\u3083\u30fc\u3093\uff1f \u3068\u3044\u3046\u521d\u5fc3\u8005\u5411\u3051\u89e3\u8aac\u3067\u3059\u3002 \u3068\u308a\u3042\u3048\u305a\u8a2d\u7f6e\u3067\u304d\u305f\uff01\u7a0b\u5ea6\u306a\u306e\u3067\u3001\u9055\u3046\u3084\u308d\u2026\u3068\u601d\u3063\u305f\u3089\u4e00\u756a\u30a4\u30a4\u65b9\u6cd5\u3092\u6559\u3048\u3066\u3061\u3087\u3002 \u74b0\u5883\u3092\u78ba\u8a8d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,5],"tags":[],"class_list":["post-2229","post","type-post","status-publish","format-standard","hentry","category-10","category-memo"],"_links":{"self":[{"href":"https:\/\/dona-co.art\/index.php?rest_route=\/wp\/v2\/posts\/2229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dona-co.art\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dona-co.art\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dona-co.art\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dona-co.art\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2229"}],"version-history":[{"count":88,"href":"https:\/\/dona-co.art\/index.php?rest_route=\/wp\/v2\/posts\/2229\/revisions"}],"predecessor-version":[{"id":2773,"href":"https:\/\/dona-co.art\/index.php?rest_route=\/wp\/v2\/posts\/2229\/revisions\/2773"}],"wp:attachment":[{"href":"https:\/\/dona-co.art\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dona-co.art\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dona-co.art\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}