{"id":4874,"date":"2014-12-22T09:00:23","date_gmt":"2014-12-22T00:00:23","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=4874"},"modified":"2021-12-23T00:17:50","modified_gmt":"2021-12-22T15:17:50","slug":"centos5-nginxphp%e3%81%ae%e3%83%ac%e3%82%b7%e3%83%94%e3%82%92%e4%bd%9c%e3%82%8b%e3%82%be","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=4874","title":{"rendered":"CentOS5 Nginx+PHP de Cookbook\u306e\u30ec\u30b7\u30d4\u3092\u4f5c\u308b\u30be"},"content":{"rendered":"<p>CentOS6\u306e\u3001Docker+Chef-solo\u3067Ruby+rbenv\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u307e\u3067\u5b8c\u4e86\u3059\u308bCookbook\u306e\u30ec\u30b7\u30d4\u304c\u3042\u308a\u3001\u305d\u306e\u30ec\u30b7\u30d4\u3092Vagrant+Chef\u3068\u3044\u3046Knife solo\u3067\u30ea\u30e2\u30fc\u30c8\u5b9f\u884c\u3059\u308b\u8a66\u9a13\u3092\u3057\u3066OK\u3060\u3063\u305f\u3082\u3093\u304c\u3001Centos5\u3060\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\uff01\u3063\u3066\u3053\u3068\u3067<\/p>\n<p>\u4e00\u5fdc<a title=\"Vagrant+VirtualBox\u3068packer\u3067\u691c\u8a3c\u74b0\u5883\u3092\u4f5c\u308d\u3046\" href=\"http:\/\/www.vincentina.net\/?p=4861\" target=\"_blank\" rel=\"noopener noreferrer\">\u524d\u56de\u306e\u65e5\u8a18<\/a>\u306e\u7d9a\u304d\u3002<\/p>\n<p>\u30ec\u30b7\u30d4\u3092\u30ea\u30e2\u30fc\u30c8\u5b9f\u884c\u3059\u308b\u3068\u305d\u306e\u30ec\u30b7\u30d4\u306e\u72b6\u614b\u3068\u306a\u308b\u4e8b\u3092\u5229\u7528\u3057\u3066\u3001\u666e\u901a\u306bNginx\u3068PHP\u3092\u5165\u308c\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u5931\u6557\u3057\u305f\u3089\u307e\u305fknife\u3067\u30ec\u30b7\u30d4\u3092\u8aad\u307e\u305b\u305f\u3089\u3044\u3044\u306e\u3060\u3002\u306f\u3063\u306f\u30fc\u3002<\/p>\n<p>epel\u306f\u3059\u3067\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306a\u306e\u3067\u3001search\u3067\u898b\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@localhost ~]$ yum --enablerepo=epel search php-fpm\r\nLoaded plugins: fastestmirror, security\r\nWarning: No matches found for: php-fpm\r\nNo Matches found\r\n\r\n&#x5B;takeken@localhost ~]$ sudo yum --enablerepo=epel search php | grep fpm\r\n&#x5B;takeken@localhost ~]$<\/pre>\n<p>\u306a\u304b\u3063\u305f\u3002<br \/>\n\u3053\u308c\u3067\u7d42\u308f\u308b\u3088\u3046\u3067\u306f\u308f\u3056\u308f\u3056\u30cd\u30bf\u306b\u9078\u3093\u3060\u610f\u5473\u304c\u306a\u3044\u3068\u3044\u3046\u3082\u306e\u3060\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u305d\u3046\u305d\u3046\u3001PHP\u3058\u3083\u306a\u304f\u3066PHP-FPM\u304c\u306a\u305c\u8981\u308b\u306e\u304b\u3068\u3044\u3046\u3068Nginx\u3001MySQL\u3068\u9023\u52d5\u3055\u305b\u308b\u306b\u306f\u3053\u3044\u3064\u304c\u5fc5\u8981\u3089\u3057\u3044\u3002<\/p>\n<p>epel\u306b\u306f\u306a\u304b\u3063\u305f\u304c\u3001\u3069\u3046\u3084\u3089remi\u306b\u3042\u308b\u3089\u3057\u3044\u3002<\/p>\n<p>http:\/\/rpms.famillecollet.com\/<br \/>\n<a href=\"http:\/\/rpms.famillecollet.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Les RPM de Remi:<\/a><\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@localhost ~]$ sudo rpm --import http:\/\/rpms.famillecollet.com\/RPM-GPG-KEY-remi\r\n&#x5B;takeken@localhost ~]$\r\n&#x5B;takeken@localhost ~]$ sudo rpm -ivh remi-release-5.rpm\r\n\u6e96\u5099\u4e2d...\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### &#x5B;100%]\r\n1:remi-release\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ########################################### &#x5B;100%]\r\n&#x5B;takeken@localhost ~]$<\/pre>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u78ba\u8a8d\u3092\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001epel\u304cCentos6\u306b\u63d0\u4f9b\u3057\u3066\u3044\u308b\u306e\u304c<\/p>\n<pre>\r\nphp-fpm.x86_64\u00a05.3.3\u300040.el6_6\u00a0updates\r\n<\/pre>\n<p>\u306b\u5bfe\u3057\u3066<\/p>\n<p>remi\u304cCentos5\u306b\u63d0\u4f9b\u3057\u3066\u3044\u308b\u306e\u304c<\/p>\n<pre>php-fpm.x86_64 5.4.35-1.el5.remi\u00a0remi\r\n<\/pre>\n<p>\u3067\u3057\u305f\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u610f\u5916\u3002<\/p>\n<p>\u3067\u306f\u30db\u30b9\u30c8OS\u306b\u623b\u308a\u307e\u3057\u3066\u3001Cookbook\u3068Berksfile\u306b\u305d\u308c\u305e\u308c\u8ffd\u8a18\u3092\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vi Berksfile\r\ncookbook 'yum-epel'\r\n\r\n&#x5B;takeken@ubuntu]$ berks vendor cookbooks\r\nInstalling yum-remi (0.1.0)\r\n\r\n&#x5B;takeken@ubuntu]$ vi nodes\/docker.json\r\n&quot;recipe&#x5B;yum-remi]&quot;,<\/pre>\n<p>\u4eca\u306b\u306a\u3063\u3066\u6c17\u3065\u3044\u305f\u3093\u3060\u3051\u308c\u3069\u3001Vagrant+Chef\u306e\u5834\u5408\u306fVagrantfile\u306bJson\u3092\u66f8\u304f\u306e\u304c\u901a\u5e38\u306a\u3088\u3046\u3060\u3002\u305d\u308c\u3067\u3088\u3046\u3084\u304fvagrant provision\u304c\u4f7f\u3048\u308b\u3088\u3046\u3060\u3002<br \/>\n\u8d85\u3044\u307e\u3055\u3089\u306a\u3053\u3068\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001Docker+Chef\u306b\u8aad\u307f\u66ff\u3048\u3066\u3044\u305f\u306e\u3067\u8a31\u3057\u3066\u304f\u308a\u3002<br \/>\n\u3060\u3082\u3093\u3067\u3001\u3044\u307e\u306fknife-solo\u3067\u9032\u3081\u308b\u3088\uff5e\u3002<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ knife solo cook vagrant@centos5 nodes\/docker.json\r\n\r\nRecipe: php-env::default\r\n* yum_package&#x5B;php-fpm] action install\r\n- install version 5.4.35-1.el5.remi of package php-fpm\r\n* yum_package&#x5B;php-pecl-zendopcache] action install\r\n- install version 7.0.3-1.el5.remi of package php-pecl-zendopcache\r\n* service&#x5B;php-fpm] action enable\r\n- enable service service&#x5B;php-fpm]\r\n* service&#x5B;php-fpm] action start\r\n- start service service&#x5B;php-fpm]\r\n\r\n&#x5B;vagrant@localhost ~]$ php -v\r\nPHP 5.4.35 (cli) (built: Nov 14 2014 07:13:44)\r\nCopyright (c) 1997-2014 The PHP Group\r\nZend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies\r\nwith Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies<\/pre>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001remi\u306eCookbook\u3092\u8ffd\u52a0\u3068\u3044\u3046\u90e8\u5206\u3092\u5897\u3084\u3057\u305f\u3089\u89e3\u6c7a\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3059\u3093\u306a\u308a\u3044\u304f\u3068\u3001\u4f55\u3060\u304b\u6182\u9b31\u306a\u6c17\u5206\u306b\u306a\u308b\u306a\u3041\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u3067\u306f\u7de8\u96c6\u3092<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@localhost ~]$ vim \/etc\/nginx\/nginx.conf<\/pre>\n<p>\u3053\u3053\u3067\u6c17\u3065\u3044\u305f\u306e\u3067\u3059\u304c\u3001Centos6\u3060\u3068yum install vim\u3067\u901a\u308a\u307e\u3059\u304cCentos5\u3060\u3068vim-enhanced\u306a\u308a\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u305f\u306e\u3067\u3057\u305f\u3002<\/p>\n<p>\u3053\u3053\u3067\u7aef\u672b\u304b\u3089sudo yum install vim-enhanced\u3068\u3084\u3063\u3066\u3057\u307e\u3046\u3068\u3001code as infrastructure\u306b\u306a\u3089\u3093\u306e\u3067\u305d\u308c\u306f\u3054\u6cd5\u5ea6\u3060\u3002<br \/>\n\u305d\u3053\u306f\u5b88\u308b\u305e\u3002<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vi site-cookbooks\/base\/recipes\/default.rb\r\n\r\n%w{ ** ** vim-enhanced ** }.each do |p|<\/pre>\n<p>\u3068\u3001\u3053\u306e\u4e2d\u306b\u8ffd\u8a18\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u8a66\u3059\u3001\u4fee\u6b63\u3059\u308b\u3002\u3053\u308c\u306e\u7e70\u308a\u8fd4\u3057\u3067\u3059\u3060\u306d\u3002<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ knife solo cook vagrant@centos5 nodes\/docker.json\r\n\r\n&#x5B;takeken@localhost ~]$ vim --version\r\nVIM - Vi IMproved 7.0 (2006 May 7, compiled Jan\u00a0 8 2013 23:55:00)<\/pre>\n<p>\u5165\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3055\u3066\u3001Windows\u306e\u30d6\u30e9\u30a6\u30b6\u3067phpinfo();\u306e\u78ba\u8a8d\u3092\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\u30c8\u30f3\u30cd\u30ea\u30f3\u30b0\u3092\u4f5c\u308b\u3088\u308a\u697d\u306a\u306e\u306f\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u3001\u30db\u30b9\u30c8OS\u3067Vagrantfile\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<br \/>\nforwarded_port\u306e\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vi Vagrantfile\r\nconfig.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8080\r\n\r\n&#x5B;vagrant@localhost ~]$ sudo shutdown -h now\r\n&#x5B;takeken@ubuntu]$ vagrant halt\r\n&#x5B;takeken@ubuntu]$ vagrant up<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3061\u3083\u3093\u3068\u52d5\u3044\u305f\u3063\u307d\u3044\u306e\u3067192.168.24.58:8080\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/nginx001.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/nginx001.jpg\" alt=\"nginx001\" width=\"279\" height=\"144\" class=\"alignnone  wp-image-4875\" srcset=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/nginx001.jpg 470w, https:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/nginx001-300x155.jpg 300w\" sizes=\"auto, (max-width: 279px) 85vw, 279px\" \/><\/a><\/p>\n<p>OK\u3067\u3059\u3002<\/p>\n<p>\u30ec\u30b7\u30d4\u3092\u4f5c\u308b\u30be\u3068\u8a00\u3044\u306a\u304c\u3089\u3082\u3001remi\u306eCookbook\u3092\u8ffd\u52a0\u3057\u3066\u7d42\u308f\u3063\u305f\u3002<\/p>\n<p>\u6700\u8fd1\u306f\u3059\u3079\u3066\u4e88\u7d04\u6295\u7a3f\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u306a\u304b\u306a\u304b\u3086\u3068\u308a\u304c\u51fa\u6765\u3066\u3044\u3044\u306d\u3002<br \/>\n\u3060\u304c\u65e5\u8a18\u306a\u306e\u306b\u4e88\u7d04\u6295\u7a3f\u3063\u3066\u306e\u306f\u5c11\u3057\u77db\u76fe\u3057\u3066\u3044\u308b\u6c17\u304c\u3059\u308b\u3002<\/p>\n<p>\u307e\u3041\u307e\u3041\u3001\u6c17\u306b\u3057\u306a\u3044\u6c17\u306b\u3057\u306a\u3044\u3002<\/p>\n<p>\u4eca\u56de\u306e\u30cd\u30bf\u306f\u3001\u305d\u3082\u305d\u3082Centos5\u306e\u74b0\u5883\u304c\u3044\u307e\u5fc5\u8981\u306a\u306e\u304b\u3068\u3044\u3046\u3068\u5168\u7136\u305d\u3046\u3067\u3082\u306a\u304f\u3066\u3001\u5358\u306b\u3044\u3064\u3067\u3082\u89e6\u308c\u308b\u3088\u3046\u306b\u3068\u3044\u3046\u3060\u3051\u306e\u7406\u7531\u3067\u4f5c\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u3044\u307e\u3044\u3061\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u304c\u4e0a\u304c\u3089\u305a\u3001\u672c\u756a\u30b5\u30fc\u30d0\u30fc\u3001\u3059\u306a\u308f\u3061\u3053\u306e\u30d6\u30ed\u30b0\u304c\u3042\u308b\u30b5\u30fc\u30d0\u30fc\u306fCentos6\u306a\u306e\u3067\u3001\u6b63\u76f4\u8a00\u3046\u3068\u3001\u3053\u306e\u4ef6\u306b\u305d\u308c\u307b\u3069\u6642\u9593\u3092\u8cbb\u3084\u3059\u5fc5\u8981\u3082\u306a\u304f\u3066\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3084\u3063\u3061\u3083\u304a\u3046\u3063\u3066\u4e8b\u3067\u3002\u304a\u305d\u3089\u304f\u4e00\u7b4b\u7e04\u3067\u306f\u3044\u304b\u306a\u3044\u3060\u308d\u3046\u306a\u3041\u3068\u4e88\u6e2c\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u306f\u9762\u767d\u305d\u3046\u3063\u3066\u3053\u3068\u3067\u63a1\u7528\uff01<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=4874\" data-text=\"CentOS5 Nginx+PHP de Cookbook\u306e\u30ec\u30b7\u30d4\u3092\u4f5c\u308b\u30be\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>CentOS6\u306e\u3001Docker+Chef-solo\u3067Ruby+rbenv\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u307e\u3067\u5b8c\u4e86\u3059\u308bCookbook\u306e\u30ec\u30b7\u30d4\u304c\u3042\u308a\u3001\u305d\u306e\u30ec\u30b7\u30d4\u3092Vagrant+Chef\u3068\u3044\u3046Knife solo\u3067\u30ea\u30e2\u30fc\u30c8\u5b9f\u884c\u3059\u308b\u8a66\u9a13\u3092\u3057\u3066 &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=4874\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;CentOS5 Nginx+PHP de Cookbook\u306e\u30ec\u30b7\u30d4\u3092\u4f5c\u308b\u30be&#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":[106],"tags":[],"class_list":["post-4874","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4874"}],"version-history":[{"count":1,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4874\/revisions"}],"predecessor-version":[{"id":7754,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4874\/revisions\/7754"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}