{"id":472,"date":"2014-11-22T15:46:30","date_gmt":"2014-11-22T06:46:30","guid":{"rendered":"http:\/\/gomocool.net\/gomokulog\/?p=472"},"modified":"2015-01-27T14:41:42","modified_gmt":"2015-01-27T05:41:42","slug":"windows-vagrant%e3%81%a7%e3%81%96%e3%81%a3%e3%81%8f%e3%82%8a%e3%81%a8%e4%bb%ae%e6%83%b3%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%892","status":"publish","type":"post","link":"https:\/\/gomokulog.gomocool.net\/?p=472","title":{"rendered":"[Windows] Vagrant\u3067\u3056\u3063\u304f\u308a\u3068\u4eee\u60f3\u74b0\u5883\u69cb\u7bc92"},"content":{"rendered":"<p><a title=\"[Windows] Vagrant\u3067\u3056\u3063\u304f\u308a\u3068\u4eee\u60f3\u74b0\u5883\u69cb\u7bc9\" href=\"http:\/\/gomocool.net\/gomokulog\/?p=435\" target=\"_blank\">\u524d\u56de<\/a>\u3001Vagrant\u3067\u4eee\u60f3\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3002<\/p>\n<p>\u6b21\u306f\u3001<strong>Chef<\/strong>\u3068\u547c\u3070\u308c\u308b\u74b0\u5883\u8a2d\u5b9a\u30c4\u30fc\u30eb\u3067LAMP\u3092\u4f5c\u308b\u3002<\/p>\n<p>\u524d\u56de\u306f\u7a7a\u306eCentOS\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3060\u3051\u306a\u306e\u3067\u3001\u4f55\u3082\u5165\u3063\u3066\u3044\u306a\u3044\u3002<br \/>\n\u305d\u3053\u3067\u3001Chef\u3068\u547c\u3070\u308c\u308b\u7269\u3067Apache\u3068MySQL\u3068PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u305b\u308b\u3002<\/p>\n<p>\u672c\u6765\u306f\u3001knife\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3067\u3001\u30db\u30b9\u30c8OS(\u81ea\u5206\u306eWindows)\u304b\u3089\u30b2\u30b9\u30c8OS(\u4eee\u60f3\u74b0\u5883\u306eCentOS)\u306echef\u3092\u52d5\u304b\u3057\u3066\u4f7f\u3046\u3002<br \/>\n\u3089\u3057\u3044\u306e\u3060\u304c\u3001\u4eca\u56de\u306fVagrant\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u3001<strong>\u3056\u3063\u304f\u308a<\/strong>\u3068\u4f5c\u308b\u3002<\/p>\n<p>\u307e\u305a\u3001PowerShell\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u3046\u3064\u3002<br \/>\n\u3053\u308c\u306f\u3001\u4eee\u60f3\u74b0\u5883\u306b\u5fc5\u8981\u306a\u7269\u304c\u306a\u304b\u3063\u305f\u3089\u81ea\u52d5\u7684\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3044\u3046\u30d7\u30e9\u30b0\u30a4\u30f3\u3002<\/p>\n<pre class=\"lang:sh decode:true\">vagrant plugin install vagrant-omnibus<\/pre>\n<p>\u6b21\u306b\u3001Chef\u304c\u8aad\u3080\u3001cookbooks\u3068recipe\u3068\u3044\u3046\u30e2\u30ce\u3092\u7528\u610f\u3059\u308b\u3002<\/p>\n<p>\u307e\u305a\u3001Vagrantfile\u30d5\u30a1\u30a4\u30eb\u3068\u3068\u540c\u3058\u968e\u5c64\u304b\u3089\u3001site-cookbooks &#8211; http &#8211; recipes \u3068\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308b\u3002<br \/>\n(\uff0ahttpd\u3068\u6700\u521d\u306f\u8a18\u8ff0\u3057\u3066\u3044\u305f\u304c\u3001httpd\u3060\u3068\u72b6\u6cc1\u306b\u3088\u3063\u3066\u4e0a\u624b\u304f\u3044\u304b\u306a\u3044\u73fe\u8c61\u304c\u8d77\u304d\u305f\u306e\u3067\u3001http\u306b\u3059\u308b)<br \/>\n<a href=\"http:\/\/gomocool.net\/gomokulog\/wp-content\/uploads\/2015\/01\/472-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-496 size-full\" src=\"http:\/\/gomocool.net\/gomokulog\/wp-content\/uploads\/2015\/01\/472-1.png\" alt=\"\" width=\"227\" height=\"219\" \/><\/a><br \/>\n\u305d\u3057\u3066\u3001recipes\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306b\u3001&#8221;default.rb&#8221;\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3002<\/p>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">yum_package \"httpd\" do\r\n    action :install\r\nend\r\n\r\nservice \"httpd\" do\r\n    action :start\r\nend\r\n<\/pre>\n<p>\u898b\u305f\u3089\u4f55\u3068\u306a\u304f\u308f\u304b\u308b\u3068\u601d\u3046\u304c\u3001yum\u3067httpd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001httpd\u306e\u8d77\u52d5\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u3055\u3066\u3001Vagrantfile\u3092\u7de8\u96c6\u3059\u308b\u3002<\/p>\n<p>\u6050\u3089\u304f\u3001Vagrantfile\u306b\u306f\u65e2\u306b\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u308b\u304cchef-solo\u306b\u95a2\u9023\u3059\u308b\u3059\u308b\u8a18\u8ff0\u304c\u3042\u308b\u3068\u601d\u3046\u306e\u3067\u3001\u305d\u3053\u3092\u4e0b\u8a18\u306e\u3088\u3046\u306b\u7de8\u96c6\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">  # vagrant-omnibus\r\n    config.omnibus.chef_version = :latest\r\n  \r\n  # Enable provisioning with chef solo, specifying a cookbooks path, roles\r\n  # path, and data_bags path (all relative to this Vagrantfile), and adding\r\n  # some recipes and\/or roles.\r\n  #\r\n    config.vm.provision \"chef_solo\" do |chef|\r\n     chef.cookbooks_path = \".\/site-cookbooks\"\r\n     chef.add_recipe \"http\"\r\n  #  chef.json = { mysql_password: \"foo\" }\r\n    end<\/pre>\n<p>\u3055\u304d\u307b\u3069\u3001\u5165\u308c\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3001chef\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<br \/>\nchef\u306bcookbooks\u306e\u30d1\u30b9\u3092\u6559\u3048\u3066\u3001\u3069\u306e\u30ec\u30b7\u30d4\u3092\u5b9f\u884c\u3059\u308b\u304b\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u3053\u307e\u3067\u6765\u305f\u3089\u3001\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre class=\"lang:sh decode:true\">vagrant reload --provision<\/pre>\n<p>\u3082\u3057\u304f\u306f\u3001\u4e8c\u56de\u306b\u5206\u3051\u3066\u3001reload\u30b3\u30de\u30f3\u30c9\u306e\u5f8c\u306b\u3001provision\u30b3\u30de\u30f3\u30c9\u3067\u3082\u3088\u3044\u3002<\/p>\n<pre class=\"lang:sh decode:true\">vagrant reload\r\nvagrant provision<\/pre>\n<p>\u3059\u3079\u3066\u304c\u3046\u307e\u304f\u3044\u304f\u3068\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u3001\u524d\u56de\u306eVagrantfile\u3067\u8a18\u8ff0\u3057\u305fIP\u30a2\u30c9\u30ec\u30b9(<span id=\"crayon-547021b8376ff443857959\" class=\"crayon-syntax crayon-syntax-inline  crayon-theme-classic crayon-theme-classic-inline crayon-font-monaco\" style=\"font-size: 12px !important; line-height: 15px !important;\"><span class=\"crayon-pre crayon-code\" style=\"font-size: 12px !important; line-height: 15px !important; -moz-tab-size: 4; -o-tab-size: 4; -webkit-tab-size: 4; tab-size: 4;\"><span class=\"crayon-s\">192.168.33.10<\/span><\/span><\/span>)\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001Apache\u306eTestPage\u304c\u898b\u308c\u308b\u306f\u305a\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\u4e0a\u624b\u304f\u52d5\u4f5c\u3057\u306a\u3044\u5834\u5408\u306f\u3001\u307b\u3068\u3093\u3069\u306f\u30b9\u30da\u30eb\u30df\u30b9\u304c\u591a\u3044\u3002\u81ea\u5206\u3082recipes\u30d5\u30a9\u30eb\u30c0\u306es\u304c\u7121\u304b\u3063\u305f\u308a\u3001defult.rb\u306b\u306a\u3063\u3066\u3044\u305f\u308a\u3068\u304b\u3042\u3063\u305f\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u3055\u3066\u3001\u3042\u3068\u306f\u3001php\u3068mysql\u306e\u5206\u3082\u4f3c\u305f\u3088\u3046\u306b\u4f5c\u308b\u3002<\/p>\n<p>mysql\\recipes\\default.rb<\/p>\n<pre class=\"lang:ruby decode:true\">yum_package \"mysql-server\" do\r\n     action :install\r\nend\r\n\r\nservice \"mysqld\" do\r\n     ction :start\r\nend\r\n<\/pre>\n<p>php\\recipes\\default.rb<\/p>\n<pre class=\"lang:ruby decode:true \">yum_package \"php\" do\r\n    action :install\r\nend<\/pre>\n<p>\u305d\u3057\u3066\u3001\u8ffd\u52a0\u3057\u305f\u6587\u306e\u30ec\u30b7\u30d4\u3092Vagrantfile\u306b\u8a18\u8ff0\u3057\u3066\u3001<\/p>\n<pre class=\"lang:ruby decode:true \">   config.vm.provision \"chef_solo\" do |chef|\r\n     chef.cookbooks_path = \".\/site-cookbooks\"\r\n     chef.add_recipe \"httpd\"\r\n     chef.add_recipe \"mysql\"\r\n     chef.add_recipe \"php\"\r\n  #  chef.json = { mysql_password: \"foo\" }\r\n   end<\/pre>\n<p>\u518d\u3073\u30b3\u30de\u30f3\u30c9\u3092\u3046\u3064\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3001\u65e2\u306b\u3001reload\u3057\u3066cher-solo\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u3089\u3001provsion\u3060\u3051\u3067\u3088\u3044\u3002<\/p>\n<pre class=\"lang:sh decode:true \">vagrant provision<\/pre>\n<p>&nbsp;<\/p>\n<p>provision\u304c\u7d42\u308f\u3063\u305f\u3089\u3001PuTTY\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3001\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<pre class=\"lang:sh decode:true \">php -v\r\nmysql --version<\/pre>\n<p><a href=\"http:\/\/gomocool.net\/gomokulog\/wp-content\/uploads\/2014\/11\/v-c-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-477\" src=\"http:\/\/gomocool.net\/gomokulog\/wp-content\/uploads\/2014\/11\/v-c-2.png\" alt=\"v-c-2\" width=\"678\" height=\"152\" \/><\/a><br \/>\n\u3053\u308c\u3067\u3001Apache\u3001PHP\u3001MySQL\u306e\u74b0\u5883\u304c\u6574\u3063\u305f\u3002<br \/>\n\u3082\u3057\u3001php-mbstring\u306a\u3069\u306e\u5fc5\u8981\u306a\u7269\u304c\u3042\u308c\u3070\u3001\u30ec\u30b7\u30d4\u306b\u8ffd\u8a18\u3057\u3066\u3001provision\u30b3\u30de\u30f3\u30c9\u6253\u3066\u3070\u826f\u3044\u3002<br \/>\n\u5e38\u306b\u3001chef\u306e\u30ec\u30b7\u30d4\u3092\u7de8\u96c6\u3059\u308b\u3053\u3068\u3067\u3001\u6700\u521d\u306f\u5c11\u3005\u9762\u5012\u3060\u304c\u3001\u4eca\u5f8c\u306f\u3053\u306e\u30ec\u30b7\u30d4\u3055\u3048\u3042\u308c\u3070\u3001\u4f55\u5ea6\u3067\u3082\u7c21\u5358\u306b\u4f5c\u308c\u308b\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u4eca\u56de\u306f\u3001httpd\u30d5\u30a9\u30eb\u30c0\u3001mysql\u30d5\u30a9\u30eb\u30c0\u7b49\u3068\u5225\u3005\u306b\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u3063\u305f\u3051\u3069\u3001init\u30d5\u30a9\u30eb\u30c0\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u4f5c\u3063\u3066\u3001\u5168\u90e8\u540c\u3058default.rb\u306b\u304b\u3051\u308b\u3002<br \/>\n\u305f\u3060\u3001\u5206\u3051\u305f\u307b\u3046\u304c\u3001MySQL\u3067\u306f\u306a\u304fPostgres\u5165\u308c\u305f\u5834\u5408\u306a\u3069\u306e\u72b6\u6cc1\u3054\u3068\u306b\u30ec\u30b7\u30d4\u3092\u9078\u3076\u3068\u3044\u3046\u9078\u629e\u304c\u3067\u304d\u308b\u5834\u9762\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u3053\u307e\u3067\u3067\u3001vagrant up \u3068\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3064\u3060\u3051\u3067OS\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001chef\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001Apache\u3001PHP\u3001MySQL\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u4eee\u60f3\u74b0\u5883\u304c\u4f5c\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<br \/>\n<span style=\"color: #008080;\">\uff0a\u5b9f\u969b\u306e\u3068\u3053\u308d\u3001vagrant up \u3067OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u3084\u3063\u3066\u308b\u3068\u4f55\u6545\u304b\u9014\u4e2d\u3067\u6b62\u307e\u308b\u5834\u5408\u304c\u3042\u308b(\u7b11) \u305d\u306e\u5834\u5408\u306f\u3001vagrant reload &#8211;provision \u3068\u6253\u3061\u76f4\u3059\u3053\u3068\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3001\u306a\u3093\u3068\u304b\u306a\u308b\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3042\u3068\u306f\u3001\u5404\u3005\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u3001Apache\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u306a\u308a\u3092\u8a2d\u5b9a\u3057\u3066\u3084\u308c\u3070\u3001\u691c\u8a3c\u7d50\u679c\u306b\u3082\u306a\u308b\u3057\u3001\u958b\u767a\u74b0\u5883\u7528\u306b\u3082\u4f7f\u3048\u308b\u3060\u308d\u3046\u3002<\/p>\n<p>\u304c\uff01<\/p>\n<p>\u305d\u308c\u3082\u3001\u81ea\u52d5\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u3068\u3042\u308a\u304c\u305f\u3044\u3002<\/p>\n<p><a title=\"[Windows] Vagrant\u3067\u3056\u3063\u304f\u308a\u3068\u4eee\u60f3\u74b0\u5883\u69cb\u7bc93\" href=\"http:\/\/gomocool.net\/gomokulog\/?p=488\">\u6b21<\/a>\u306f\u3001Apache\u306ehttpd.conf\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u3001Vagrant\u3067\u4eee\u60f3\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3002 \u6b21\u306f\u3001Chef\u3068\u547c\u3070\u308c\u308b\u74b0\u5883\u8a2d\u5b9a\u30c4\u30fc\u30eb\u3067LAMP\u3092\u4f5c\u308b\u3002 \u524d\u56de\u306f\u7a7a\u306eCentOS\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3060\u3051\u306a\u306e\u3067\u3001\u4f55\u3082\u5165\u3063\u3066\u3044\u306a\u3044\u3002 \u305d\u3053\u3067\u3001Chef\u3068\u547c\u3070\u308c\u308b\u7269\u3067Apache\u3068M&hellip;  <a href=\"https:\/\/gomokulog.gomocool.net\/?p=472\" class=\"more-link\">more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[49],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-69","tag-vagrant"],"_links":{"self":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=472"}],"version-history":[{"count":9,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":500,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions\/500"}],"wp:attachment":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}