{"id":1932,"date":"2022-03-07T15:53:25","date_gmt":"2022-03-07T06:53:25","guid":{"rendered":"https:\/\/weblog.hirohiro716.com\/?p=1932"},"modified":"2024-11-19T00:12:08","modified_gmt":"2024-11-18T15:12:08","slug":"almalinux8%e3%81%abapachephp%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%e3%80%82","status":"publish","type":"post","link":"https:\/\/weblog.hirohiro716.com\/?p=1932","title":{"rendered":"AlmaLinux8\u306bApache+PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<pre class=\"brush: plain; title: \u74b0\u5883; notranslate\" title=\"\u74b0\u5883\">\r\nAlmaLinux release 8.5 (Arctic Sphynx)\r\nApache 2.4.37\r\nPHP 7.2.24\r\n<\/pre>\n<p>Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# dnf install httpd\r\n<\/pre>\n<p>Apache\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u300cIndexes\u300d\u3092\u524a\u9664\u3057\u3066\u3001index.php\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306e\u4e00\u89a7\u8868\u793a\u6a5f\u80fd\u3092\u7121\u52b9\u306b\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;Directory &quot;\/var\/www\/html&quot;&gt;\r\n    #Options Indexes FollowSymLinks\r\n    Options FollowSymLinks\r\n<\/pre>\n<p>\u7d9a\u3051\u3066\u30c9\u30e1\u30a4\u30f3\u3054\u3068\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u6307\u5b9a\u3092\u884c\u3046\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: \/etc\/httpd\/conf.d\/test.example.com.conf; notranslate\" title=\"\/etc\/httpd\/conf.d\/test.example.com.conf\">\r\n#\r\n# test.example.com Subdomain configuration\r\n#\r\n&lt;VirtualHost *:80&gt;\r\n        ServerName test.example.com\r\n        DocumentRoot \/var\/www\/html\/test\/\r\n        &lt;Directory \/var\/www\/html\/test\/&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# dnf install policycoreutils-python-utils\r\n<\/pre>\n<p>\/var\/www\/html\/test\/\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092httpd\u304b\u3089\u5909\u66f4\u3067\u304d\u308b\u3088\u3046SELinux\u306e\u30e9\u30d9\u30eb\u3092\u4ed8\u4e0e\u3059\u308b\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\u308b\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\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# dnf install php\r\n# dnf install php-mbstring\r\n# dnf install php-json\r\n# dnf install php-mysqlnd\r\n# dnf install php-xml\r\n# dnf install php-gd\r\n<\/pre>\n<p>8MB\u7a0b\u5ea6\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u3001\u4e0b\u8a18\u306e\u7b87\u6240\u3092\u8a2d\u5b9a\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: \/etc\/php.ini; notranslate\" title=\"\/etc\/php.ini\">\r\npost_max_size = 10M\r\nupload_max_filesize = 10M\r\n<\/pre>\n<p>WEB\u30b5\u30a4\u30c8\u304b\u3089E-mail\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u3001sendmail\u3068postfix\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# dnf install sendmail postfix\r\n<\/pre>\n<p>IPv4\u306e\u307f\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: \/etc\/postfix\/main.cf; notranslate\" title=\"\/etc\/postfix\/main.cf\">\r\n\u2026\r\n#inet_protocols = all\r\ninet_protocols = ipv4\r\n\u2026\r\n<\/pre>\n<p>\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u5316\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# systemctl enable --now postfix\r\n<\/pre>\n<p>httpd\u304b\u3089E-mail\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046SELinux\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# setsebool -P httpd_can_sendmail true\r\n<\/pre>\n<p>Apache\u3092\u8d77\u52d5\u3057\u3066\u6709\u52b9\u5316\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# systemctl enable --now httpd\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AlmaLinux release 8.5 (Arctic Sphynx) Apache 2.4.37 PHP 7.2.24 Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002 # dnf install httpd Apache\u306e\u8a2d\u5b9a\u30d5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-1932","post","type-post","status-publish","format-standard","hentry","category-almalinux"],"views":3892,"_links":{"self":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/1932","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=1932"}],"version-history":[{"count":12,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/1932\/revisions"}],"predecessor-version":[{"id":2884,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=\/wp\/v2\/posts\/1932\/revisions\/2884"}],"wp:attachment":[{"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weblog.hirohiro716.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}