{"id":404,"date":"2017-01-26T19:13:43","date_gmt":"2017-01-26T10:13:43","guid":{"rendered":"https:\/\/knowhow.hirohiro716.com\/?p=404"},"modified":"2022-03-08T16:53:27","modified_gmt":"2022-03-08T07:53:27","slug":"centos7%e3%81%b8php%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/weblog.hirohiro716.com\/?p=404","title":{"rendered":"CentOS7\u3078Apache\u3068PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p>Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# yum install httpd\r\n<\/pre>\n<p>\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u6bce\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u6700\u4e0b\u90e8\u306b\u4e0b\u8a18\u3092\u8ffd\u8a18\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: \/etc\/httpd\/conf\/httpd.conf; notranslate\" title=\"\/etc\/httpd\/conf\/httpd.conf\">\r\n&lt;VirtualHost *:80&gt;\r\n    ServerName test.example.com\r\n    DocumentRoot &quot;\/var\/www\/html\/test\/&quot;\r\n    &lt;Directory &quot;\/var\/www\/html\/test\/&quot;&gt;\r\n        AllowOverride All\r\n    &lt;\/Directory&gt;\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>SELinux\u306e\u30e9\u30d9\u30eb\u4ed8\u3051\u3092\u884c\u3046\u305f\u3081\u306e\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# yum install policycoreutils-python\r\n<\/pre>\n<p>\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u3092httpd\u3067\u8aad\u307f\u66f8\u304d\u53ef\u80fd\u306b\u3059\u308bSELinux\u306e\u30e9\u30d9\u30eb\u4ed8\u3051\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# semanage fcontext -a -t httpd_sys_rw_content_t &quot;\/var\/www\/html\/test(\/.*)?&quot;\r\n# restorecon -RF \/var\/www\/html\/test\/\r\n<\/pre>\n<p>httpd\u304c\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u63a5\u7d9a\u3059\u308b\u3053\u3068\u3092\u8a31\u53ef\u3059\u308bSELinux\u306e\u8a2d\u5b9a\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# setsebool -P httpd_can_network_connect true\r\n<\/pre>\n<p>PHP\u3068\u4f7f\u7528\u3059\u308b\u62e1\u5f35\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# yum install php\r\n# yum install php-mbstring\r\n# yum install php-json\r\n# yum install php-mysqlnd\r\n# yum install php-xml\r\n# yum install php-gd\r\n<\/pre>\n<p>Apache\u3092\u6709\u52b9\u5316\u3057\u3066\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# systemctl enable httpd\r\n# systemctl start httpd\r\n<\/pre>\n<p>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306b\u4f8b\u5916\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# firewall-cmd --add-service=http --permanent\r\n# firewall-cmd --add-service=https --permanent\r\n<\/pre>\n<p>\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u307f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# firewall-cmd --reload\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 # yum install httpd \u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u6bce\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8a2d\u5b9a\u3059\u308b\u3002 \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u6700\u4e0b\u90e8\u306b\u4e0b\u8a18\u3092\u8ffd\u8a18\u3059\u308b\u3002 &lt;VirtualHost *:80&gt; Serve [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-centos"],"views":1137,"_links":{"self":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=404"}],"version-history":[{"count":8,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions"}],"predecessor-version":[{"id":1957,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions\/1957"}],"wp:attachment":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}