{"id":4878,"date":"2023-11-07T20:00:00","date_gmt":"2023-11-07T11:00:00","guid":{"rendered":"https:\/\/www.wetch.co.jp\/note\/?p=4878"},"modified":"2023-11-07T19:54:01","modified_gmt":"2023-11-07T10:54:01","slug":"%e9%81%85%e3%81%be%e3%81%8d%e3%81%aa%e3%81%8c%e3%82%89%e3%80%81vagrant%ef%bc%88virtualbox%ef%bc%89%e3%81%a7ruby-on-rails%e3%81%ae%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e7%92%b0%e5%a2%83%e3%82%92-2","status":"publish","type":"post","link":"https:\/\/www.wetch.co.jp\/note\/%e9%81%85%e3%81%be%e3%81%8d%e3%81%aa%e3%81%8c%e3%82%89%e3%80%81vagrant%ef%bc%88virtualbox%ef%bc%89%e3%81%a7ruby-on-rails%e3%81%ae%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e7%92%b0%e5%a2%83%e3%82%92-2\/","title":{"rendered":"\u9045\u307e\u304d\u306a\u304c\u3089\u3001Vagrant\uff08Virtualbox\uff09\u3067Ruby on Rails\u306e\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f\u306e\u5dfb\uff08\u305d\u306e\uff12\uff09"},"content":{"rendered":"<p>Vagrant\uff08VirtualBox\uff09\u3067\u306eRuby on Rails\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u69cb\u7bc9\u3067\u3059\u304c\u3001\u524d\u56de\u306f\u4ee5\u4e0b\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>Webmin + Virtualmin\uff08LEMP\uff09\u74b0\u5883\u4f5c\u6210<\/li>\n<li>rbenv,ruby-build,Ruby,Bundler,Rails\u3092\u4eee\u60f3\u30db\u30b9\u30c8\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30e6\u30fc\u30b6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\/home\/rails-test\uff09\u914d\u4e0b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<\/ul>\n<p>\u4eca\u56de\u306f\u4ee5\u4e0b\u3092\u884c\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30c6\u30b9\u30c8\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/li>\n<li>Welcome\u30da\u30fc\u30b8\u8868\u793a\n<ul>\n<li>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408<\/li>\n<li>UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u3066Nginx\u306e\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\uff08Nginx &#8211; puma\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u307e\u305a\u3001\u30c6\u30b9\u30c8\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092test_app\u3068\u3057\u307e\u3059\uff09\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002SSH\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u30e6\u30fc\u30b6\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>$ su - rails-test\n$ cd \/home\/rails-test\n$ mkdir test_app<\/pre>\n<p>\u4e00\u65e6SSH\u3092\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u3001Vagrant\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u5f8c\u3001\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>vagrant halt<\/pre>\n<pre>\u3010Vagrantfile\u306e\u629c\u7c8b\u3011\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\nconfig.vm.synced_folder \".\", \"\/vagrant\", disabled: true\nconfig.vm.synced_folder \"\u30db\u30b9\u30c8\u306e\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30d1\u30b9\", \"\/home\/rails-test\/test_app\",\n:owner =&gt; \"rails-test\",\n:group =&gt; \"rails-test\",\ntype: \"virtualbox\", create: true\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb<\/pre>\n<p>Vagrant\u3092\u8d77\u52d5\u3055\u305b\u3001\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u5f8c\u3001SSH\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u30e6\u30fc\u30b6\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>$ su - rails-test\n$ cd \/home\/rails-test\n$ rails new test_app<\/pre>\n<p>\u30c6\u30b9\u30c8\u7528\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08test_app\uff09\u306bRails\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u5c55\u958b\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u3067Rails\u306eWelcome\u30da\u30fc\u30b8\u3092\u8868\u793a\u3055\u305b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nRails\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30dd\u30fc\u30c8\u756a\u53f7\u306f3000\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u4e00\u6642\u7684\u306b\u30dd\u30fc\u30c8\u3092\u958b\u653e\u3057\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\nWebmin &gt; \u30cd\u30c3\u30c8\u30ef\u30fc\u30ad\u30f3\u30b0 &gt; FirewallD \u304b\u3089\u3001\u300c\u8a31\u53ef\u3055\u308c\u305f\u30dd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u3001<br \/>\n\u30dd\u30fc\u30c8\uff1a3000<br \/>\n\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d7\u30ed\u30c8\u30b3\u30eb\uff1aTCP<br \/>\n\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\n\u8ffd\u52a0\u3057\u305f\u3089\u3001\u300cFirewallD\u3092\u30ea\u30ed\u30fc\u30c9\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u3066\u5909\u66f4\u3092\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30dd\u30fc\u30c8\u304c\u958b\u653e\u3067\u304d\u305f\u3089\u3001\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre>$ cd \/home\/rails-test\/test_app\n$ rails s -b 0.0.0.0\n\u203b--binding=0.0.0.0 \u3068\u3059\u308b\u3053\u3068\u3067\u30db\u30b9\u30c8\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3092\u53ef\u80fd\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/pre>\n<p>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u304c\u8d77\u52d5\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>$ rails s -b 0.0.0.0\n=&gt; Booting Puma\n=&gt; Rails 7.1.1 application starting in development \n=&gt; Run `bin\/rails server --help` for more startup options\nPuma starting in single mode...\n* Puma version: 6.4.0 (ruby 3.2.2-p53) (\"The Eagle of Durango\")\n* Min threads: 5\n* Max threads: 5\n* Environment: development\n* PID: 11246\n* Listening on http:\/\/0.0.0.0:3000\nUse Ctrl-C to stop<\/pre>\n<p>\u3053\u306e\u72b6\u614b\u3067\u3001\u4eee\u60f3\u30db\u30b9\u30c8\u306eIP\u30a2\u30c9\u30ec\u30b9\u306e\u30dd\u30fc\u30c8\u756a\u53f73000\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<br \/>\nhttp:\/\/XXX.XXX.XXX.XXX:3000\/<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4879\" src=\"https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30.png\" alt=\"\" width=\"1583\" height=\"885\" srcset=\"https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30.png 1583w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-300x168.png 300w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1024x572.png 1024w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-768x429.png 768w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1536x859.png 1536w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-150x84.png 150w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-696x389.png 696w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1068x597.png 1068w\" sizes=\"auto, (max-width: 1583px) 100vw, 1583px\" \/><\/p>\n<p>\u8868\u793a\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u3067\u306e\u8868\u793a\u78ba\u8a8d\u304c\u3067\u304d\u307e\u3057\u305f\u3089\u3001Ctrl-C\u3067\u505c\u6b62\u3057\u307e\u3059\u3002<br \/>\n\u78ba\u8a8d\u304c\u3067\u304d\u305f\u306e\u3067\u3001firewallD\u3067\u958b\u653e\u3057\u305f\u30dd\u30fc\u30c8\u3092\u9589\u3058\u307e\u3059\u3002<br \/>\nWebmin &gt; \u30cd\u30c3\u30c8\u30ef\u30fc\u30ad\u30f3\u30b0 &gt; FirewallD \u304b\u3089\u3001\u8ffd\u52a0\u3057\u305f\u30dd\u30fc\u30c83000\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u3001\u300c\u9078\u629e\u3057\u305f\u30eb\u30fc\u30eb\u3092\u524a\u9664\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u3066\u524a\u9664\u3057\u307e\u3059\u3002\u524a\u9664\u3057\u305f\u3089\u3001\u300cFirewallD\u3092\u30ea\u30ed\u30fc\u30c9\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u3066\u5909\u66f4\u3092\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u3067\u306e\u8868\u793a\u78ba\u8a8d\u306f\u3067\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306e\u904b\u7528\u306e\u5834\u5408\u306b\u90fd\u5ea6\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\uff08\u4ee5\u964d\u306fpuma\u3068\u8a18\u8f09\uff09\u3092\u8d77\u52d5\u3055\u305b\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u306e\u306f\u4e0d\u4fbf\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u3066Nginx\u306e\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3092\u4f7f\u7528\u3057\u305f\u5f62\u306b\u5909\u66f4\u3092\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>LEMP\u74b0\u5883\u3067Nginx\u30b5\u30fc\u30d0\u306f\u6e96\u5099\u304c\u3067\u304d\u3066\u3044\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5f62\u3078\u306e\u5909\u66f4\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre style=\"text-align: center;\">Nginx\u3067\u53d7\u3051\u305fHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092puma\u306b\u6e21\u3057\u307e\u3059\u3002\n\u2193\npuma\u306f\u53d7\u3051\u53d6\u3063\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u3092Rack\uff08Rails\u3068\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\uff09\u304c\u5206\u304b\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u6e21\u3057\u307e\u3059\u3002\n\u2193\nRack\u306f\u30eb\u30fc\u30eb\u306b\u57fa\u3065\u3044\u3066Rails\u3092\u547c\u3073\u51fa\u3057\u307e\u3059<\/pre>\n<p>\u307e\u305a\u3001UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\/home\/rails-test\/test_app\/config\u3000\u306b\u3042\u308b\u3001puma.rb \u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre>\u3010\/home\/rails-test\/test_app\/config\/puma.rb\u306e\u629c\u7c8b\u3011\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n# Specifies the `port` that Puma will listen on to receive requests; default is 3000.\n#port ENV.fetch(\"PORT\") { 3000 }\nshared_dir = \"\/home\/rails-test\/puma_shared\"\nbind \"unix:\/\/#{shared_dir}\/sockets\/puma.sock\"\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30fb<\/pre>\n<p>puma\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30dd\u30fc\u30c8\uff1a3000\u3067listen\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6b21\u306e\u884c\u3067UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u3066bind\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u6ce8\u610f\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n<span style=\"background-color: #ccffcc;\">\u3082\u3068\u3082\u3068\u306f\u3001\u30db\u30b9\u30c8\u3068\u306e\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306bUNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5b9f\u884c\u6a29\u9650\u306e\u305b\u3044\u304b\u3089\u304b\u3046\u307e\u304f\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u305d\u306e\u305f\u3081\u3001\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5916\u306b\u30bd\u30b1\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002<\/span><\/p>\n<p>\u5909\u66f4\u524d\uff1a\/home\/rails-test\/test_app\/tmp\/sockets\/puma.sock\uff08\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\uff09<br \/>\n\u5909\u66f4\u5f8c\uff1a\/home\/rails-test\/puma_shared\/sockets\/puma.sock\uff08\u5171\u6709\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5916\uff09<\/p>\n<p>\u6b21\u306b\u3001Nginx\u306e\u8a2d\u5b9a\u306bUNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u3092\u8ffd\u8a18\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre># For more information on configuration, see:\n#   * Official English Documentation: http:\/\/nginx.org\/en\/docs\/\n#   * Official Russian Documentation: http:\/\/nginx.org\/ru\/docs\/\n\nuser nginx;\n\nworker_processes auto;\nerror_log \/var\/log\/nginx\/error.log;\npid \/run\/nginx.pid;\n\n# Load dynamic modules. See \/usr\/share\/doc\/nginx\/README.dynamic.\ninclude \/usr\/share\/nginx\/modules\/*.conf;\n\nevents {\n    worker_connections 1024;\n}\n\nhttp {\n    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '\n                      '$status $body_bytes_sent \"$http_referer\" '\n                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n    access_log  \/var\/log\/nginx\/access.log  main;\n\n    sendfile            on;\n    tcp_nopush          on;\n    tcp_nodelay         on;\n    keepalive_timeout   65;\n    types_hash_max_size 4096;\n\n    include             \/etc\/nginx\/mime.types;\n    default_type        application\/octet-stream;\n\n    # Load modular configuration files from the \/etc\/nginx\/conf.d directory.\n    # See http:\/\/nginx.org\/en\/docs\/ngx_core_module.html#include\n    # for more information.\n    include \/etc\/nginx\/conf.d\/*.conf;\n\n    server {\n        listen       80;\n        listen       [::]:80;\n        server_name  _;\n        root         \/usr\/share\/nginx\/html;\n\n        # Load configuration files for the default server block.\n        include \/etc\/nginx\/default.d\/*.conf;\n\n        error_page 404 \/404.html;\n        location = \/404.html {\n        }\n\n        error_page 500 502 503 504 \/50x.html;\n        location = \/50x.html {\n        }\n    }\n\n# Settings for a TLS enabled server.\n#\n#    server {\n#        listen       443 ssl http2;\n#        listen       [::]:443 ssl http2;\n#        server_name  _;\n#        root         \/usr\/share\/nginx\/html;\n#\n#        ssl_certificate \"\/etc\/pki\/nginx\/server.crt\";\n#        ssl_certificate_key \"\/etc\/pki\/nginx\/private\/server.key\";\n#        ssl_session_cache shared:SSL:1m;\n#        ssl_session_timeout  10m;\n#        ssl_ciphers HIGH:!aNULL:!MD5;\n#        ssl_prefer_server_ciphers on;\n#\n#        # Load configuration files for the default server block.\n#        include \/etc\/nginx\/default.d\/*.conf;\n#\n#        error_page 404 \/404.html;\n#            location = \/40x.html {\n#        }\n#\n#        error_page 500 502 503 504 \/50x.html;\n#            location = \/50x.html {\n#        }\n#    }\n\n     server_names_hash_bucket_size 128;\n     #\u3053\u3053\u304b\u3089\u8ffd\u52a0\u2460\n     upstream backend {\n  \tserver unix:\/home\/rails-test\/puma_shared\/sockets\/puma.sock;\n     }\n     #\u3053\u3053\u307e\u3067\n\n     server {\n\tserver_name rails-test.com www.rails-test.com mail.rails-test.com;\n\tlisten XXX.XXX.XXX.XXX;\n\troot \/home\/rails-test\/test_app\/public;\n\tindex index.php index.htm index.html;\n\taccess_log \/var\/log\/virtualmin\/rails-test.com_access_log;\n\terror_log \/var\/log\/virtualmin\/rails-test.com_error_log;\n\tfastcgi_param GATEWAY_INTERFACE CGI\/1.1;\n\tfastcgi_param SERVER_SOFTWARE nginx;\n\tfastcgi_param QUERY_STRING $query_string;\n\tfastcgi_param REQUEST_METHOD $request_method;\n\tfastcgi_param CONTENT_TYPE $content_type;\n\tfastcgi_param CONTENT_LENGTH $content_length;\n\tfastcgi_param SCRIPT_FILENAME \"\/home\/rails-test\/public_html$fastcgi_script_name\";\n\tfastcgi_param SCRIPT_NAME $fastcgi_script_name;\n\tfastcgi_param REQUEST_URI $request_uri;\n\tfastcgi_param DOCUMENT_URI $document_uri;\n\tfastcgi_param DOCUMENT_ROOT \/home\/rails-test\/public_html;\n\tfastcgi_param SERVER_PROTOCOL $server_protocol;\n\tfastcgi_param REMOTE_ADDR $remote_addr;\n\tfastcgi_param REMOTE_PORT $remote_port;\n\tfastcgi_param SERVER_ADDR $server_addr;\n\tfastcgi_param SERVER_PORT $server_port;\n\tfastcgi_param SERVER_NAME $server_name;\n\tfastcgi_param PATH_INFO $fastcgi_path_info;\n\tfastcgi_param HTTPS $https;\n\tlocation ^~ \/.well-known\/ {\n\t\ttry_files $uri \/;\n\t}\n\tlocation ~ \"\\.php(\/|$)\" {\n\t\ttry_files $uri $fastcgi_script_name =404;\n\t\tdefault_type application\/x-httpd-php;\n\t\tfastcgi_pass unix:\/var\/php-fpm\/169865842526435.sock;\n\t}\n\n        #\u3053\u3053\u304b\u3089\u8ffd\u52a0\u2461\n  \tlocation \/ {\n    \t\ttry_files $uri @app;\n  \t}\n\n\tlocation @app {\n    \t\tproxy_set_header    Host                $http_host;\n    \t\tproxy_set_header    X-Real-IP           $remote_addr;\n    \t\tproxy_set_header    X-Forwarded-Host    $host;\n    \t\tproxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;\n    \t\tproxy_set_header    X-Forwarded-Proto   $scheme;\n    \t\tproxy_pass http:\/\/backend;\n  \t}\n        #\u3053\u3053\u307e\u3067\n\n\tfastcgi_split_path_info \"^(.+\\.php)(\/.+)$\";\n\tlocation \/cgi-bin\/ {\n\t\tgzip off;\n\t\troot \/home\/rails-test\/cgi-bin;\n\t\tfastcgi_pass unix:\/var\/fcgiwrap\/169865842526435.sock\/socket;\n\t\tfastcgi_param SCRIPT_FILENAME \"\/home\/rails-test$fastcgi_script_name\";\n\t\tfastcgi_param GATEWAY_INTERFACE CGI\/1.1;\n\t\tfastcgi_param SERVER_SOFTWARE nginx;\n\t\tfastcgi_param QUERY_STRING $query_string;\n\t\tfastcgi_param REQUEST_METHOD $request_method;\n\t\tfastcgi_param CONTENT_TYPE $content_type;\n\t\tfastcgi_param CONTENT_LENGTH $content_length;\n\t\tfastcgi_param SCRIPT_NAME $fastcgi_script_name;\n\t\tfastcgi_param REQUEST_URI $request_uri;\n\t\tfastcgi_param DOCUMENT_URI $document_uri;\n\t\tfastcgi_param DOCUMENT_ROOT \/home\/rails-test\/public_html;\n\t\tfastcgi_param SERVER_PROTOCOL $server_protocol;\n\t\tfastcgi_param REMOTE_ADDR $remote_addr;\n\t\tfastcgi_param REMOTE_PORT $remote_port;\n\t\tfastcgi_param SERVER_ADDR $server_addr;\n\t\tfastcgi_param SERVER_PORT $server_port;\n\t\tfastcgi_param SERVER_NAME $server_name;\n\t\tfastcgi_param PATH_INFO $fastcgi_path_info;\n\t\tfastcgi_param HTTPS $https;\n\t}\n\tlisten XXX.XXX.XXX.XXX:443 ssl;\n\tssl_certificate \/home\/rails-test\/ssl.cert;\n\tssl_certificate_key \/home\/rails-test\/ssl.key;\n\t}\n}\n\n<\/pre>\n<p>\u2460\u304cUNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u306b\u4fc2\u308b\u8a2d\u5b9a\u3001\u2461\u304c\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306b\u4fc2\u308b\u8a2d\u5b9a\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u8a2d\u5b9a\u304c\u3067\u304d\u305f\u3089\u3001Nginx\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bpuma\u3092\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre>$ cd \/home\/rails-test\/test_app\n$ bundle exec puma\nPuma starting in single mode...\n* Puma version: 6.4.0 (ruby 2.7.8-p225) (\"The Eagle of Durango\")\n* Min threads: 5\n* Max threads: 5\n* Environment: development\n* PID: 21401\n* Listening on unix:\/\/\/home\/rails-test\/puma_shared\/sockets\/puma.sock\nUse Ctrl-C to stop<\/pre>\n<p>\u5148\u307b\u3069\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u8d77\u52d5\u306e\u6642\u3068\u7570\u306a\u308a\u3001UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3067Listen\u3057\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3059\u3002<br \/>\n\u30bd\u30b1\u30c3\u30c8\u4f5c\u6210\u5834\u6240\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre>$ cd \/home\/rails-test\/puma_shared\/sockets\n$ ls -l\nsrwxrwxrwx 1 rails-test rails-test 0 Nov 1 11:52 puma.sock<\/pre>\n<p>\u3067\u304d\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<p>http:\/\/XXX.XXX.XXX.XXX\/ \u3067Welcome\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4879\" src=\"https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30.png\" alt=\"\" width=\"1583\" height=\"885\" srcset=\"https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30.png 1583w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-300x168.png 300w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1024x572.png 1024w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-768x429.png 768w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1536x859.png 1536w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-150x84.png 150w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-696x389.png 696w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1068x597.png 1068w\" sizes=\"auto, (max-width: 1583px) 100vw, 1583px\" \/><\/p>\n<p>UNIX\u30c9\u30e1\u30a4\u30f3\u30bd\u30b1\u30c3\u30c8\u3067Listen\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3089\u3001\u4e00\u65e6puma\u3092Ctrl-C\u3067\u505c\u6b62\u3057\u307e\u3059\u3002<br \/>\n\u6b21\u306bpuma\u3092\u5e38\u6642\u8d77\u52d5\u3055\u305b\u308b\u305f\u3081\u306b\u3001systemd\u306b\u30e6\u30fc\u30b6\u30fc\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u767b\u9332\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\nWebmin &gt; \u30b7\u30b9\u30c6\u30e0 &gt; \u8d77\u52d5\u3068\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3000\u3067\u30b5\u30fc\u30d3\u30b9\u306e\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u300c\u65b0\u3057\u3044systemd\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u300d\u3092\u62bc\u4e0b\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d3\u30b9\u540d\uff1apuma<br \/>\n\u30b5\u30fc\u30d3\u30b9\u306e\u8aac\u660e\uff1aRails APP Server<br \/>\n\u8d77\u52d5\u6642\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\uff1a\/home\/rails-test\/.rbenv\/shims\/bundle exec puma<br \/>\n\u8d77\u52d5\u6642\u306b\u8d77\u52d5\u3057\u307e\u3059\u304b\uff1f\uff1a\u306f\u3044<\/p>\n<p>\u4e0a\u8a18\u3092\u8a2d\u5b9a\u3001\u5165\u529b\u3057\u300c\u4f5c\u6210\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3059\u308b\u3068 puma.service\u3000\u3068\u3044\u3046\u30e6\u30fc\u30b6\u30fc\u30b5\u30fc\u30d3\u30b9\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u3053\u306e\u307e\u307e\u3067\u306fpuma\u3092\u8d77\u52d5\u3057\u3066\u3082\u8d77\u52d5\u3055\u308c\u307e\u305b\u3093\u306e\u3067\u3001\u8a2d\u5b9a\u306e\u8ffd\u8a18\u3092\u3057\u307e\u3059\u3002<br \/>\n\u4e00\u89a7\u306epuma.service\u3000\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30b7\u30b9\u30c6\u30e0\u69cb\u6210\u3068\u3057\u3066\u8a2d\u5b9a\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre>[\/usr\/lib\/systemd\/system\/puma.service\uff08\u5909\u66f4\u524d\uff09]\n[Unit]\nDescription=Rails APP Server\n[Service]\nExecStart=\/home\/rails-test\/.rbenv\/shims\/bundle exec puma\n[Install]\nWantedBy=multi-user.target<\/pre>\n<p>\u3053\u308c\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>[\/usr\/lib\/systemd\/system\/puma.service\uff08\u5909\u66f4\u5f8c\uff09]\n[Unit]\nDescription=Rails APP Server\nAfter=network.target\u3000\u2190\u3000network\u95a2\u9023\u30b5\u30fc\u30d3\u30b9\u8d77\u52d5\u5f8c\u306b\u5b9f\u884c\n[Service]\nUser=rails-test\u3000\u2190\u3000\u4eee\u60f3\u30db\u30b9\u30c8\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30e6\u30fc\u30b6\u6a29\u9650\u3067\u5b9f\u884c\u3059\u308b\nWorkingDirectory=\/home\/rails-test\/test_app\u3000\u2190\u3000\u5b9f\u884c\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6307\u5b9a\nExecStart=\/home\/rails-test\/.rbenv\/shims\/bundle exec puma\nRestart=always\u3000\u2190\u3000\u30b7\u30b9\u30c6\u30e0\u8d77\u52d5\u6642\u306b\u5e38\u6642\u5b9f\u884c\u3059\u308b\n[Install]\nWantedBy=multi-user.target<\/pre>\n<p>\u300c\u4eca\u3059\u3050\u958b\u59cb\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u3066\u5b9f\u884c\u3055\u308c\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u53f3\u4e0b\u306b\u8868\u793a\u3055\u308c\u308b\u3001\u73fe\u5728\u306e\u72b6\u614b\u304c\u5b9f\u884c\u4e2d\u306b\u306a\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002<br \/>\n\u88dc\u8db3\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30b5\u30fc\u30d3\u30b9\u306e\u4f9d\u5b58\u95a2\u4fc2\u304c\u4e00\u89a7\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre># systemctl list-dependencies<\/pre>\n<p>\u30e6\u30fc\u30b6\u30fc\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066puma\u304c\u8d77\u52d5\u3067\u304d\u305f\u3089\u3001\u518d\u5ea6<br \/>\nhttp:\/\/XXX.XXX.XXX.XXX\/ \u3067Welcome\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4879\" src=\"https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30.png\" alt=\"\" width=\"1583\" height=\"885\" srcset=\"https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30.png 1583w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-300x168.png 300w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1024x572.png 1024w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-768x429.png 768w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1536x859.png 1536w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-150x84.png 150w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-696x389.png 696w, https:\/\/www.wetch.co.jp\/note\/wp-content\/uploads\/2023\/11\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2023-11-01-11.52.30-1068x597.png 1068w\" sizes=\"auto, (max-width: 1583px) 100vw, 1583px\" \/><\/p>\n<p>\u305f\u3060\u3001\u4e0a\u8a18\u30b5\u30fc\u30d3\u30b9\u8a2d\u5b9a\u306e\u5834\u5408\u3001puma\u306fdevelopment\u30e2\u30fc\u30c9\u3067\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u56de\u306f<\/p>\n<p>\u30fbURL\u3092IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u4eee\u60f3\u30db\u30b9\u30c8\u306e\u30c9\u30e1\u30a4\u30f3\u8868\u793a\u306b\u5909\u66f4<br \/>\n\u30fb\u74b0\u5883\u5207\u308a\u66ff\u3048\u306b\u3064\u3044\u3066\uff08\u3055\u308f\u308a\u3067\u3059\u304c\uff09<\/p>\n<p>\u3092\u884c\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vagrant\uff08VirtualBox\uff09\u3067\u306eRuby on Rails\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u69cb\u7bc9\u3067\u3059\u304c\u3001\u524d\u56de\u306f\u4ee5\u4e0b\u3092\u884c\u3044\u307e\u3057\u305f\u3002 Webmin + Virtualmin\uff08LEMP\uff09\u74b0\u5883\u4f5c\u6210 rbenv,ruby-build,Ruby [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":4884,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[210,213],"tags":[],"class_list":["post-4878","post","type-post","status-publish","format-standard","has-post-thumbnail","category-210","category-213"],"_links":{"self":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/4878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/comments?post=4878"}],"version-history":[{"count":0,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/4878\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media\/4884"}],"wp:attachment":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media?parent=4878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/categories?post=4878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/tags?post=4878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}