{"id":4283,"date":"2024-01-24T14:26:30","date_gmt":"2024-01-24T05:26:30","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=4283"},"modified":"2024-08-24T12:51:12","modified_gmt":"2024-08-24T03:51:12","slug":"post-4283","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/4283","title":{"rendered":"AlmaLinux8.6\u306bLAMP\u74b0\u5883&#038;WordPress\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3060\u3044\u3076\u524d\u306b<a href=\"https:\/\/taitan916.info\/blog\/archives\/3418\" target=\"_blank\" rel=\"noopener\">CentOS6\u7cfb\u304b\u30897\u7cfb\u306b\u79fb\u884c<\/a>\u3057\u305f\u304c\u3001<a href=\"https:\/\/www.redhat.com\/ja\/topics\/linux\/centos-linux-eol\" target=\"_blank\" rel=\"noopener\">7\u7cfb\u30822024\/6\/30\u306b\u30b5\u30dd\u30fc\u30c8\u7d42\u4e86<\/a>\u3068\u306a\u308b\u3002\u4eca\u306e\u3046\u3061\u306bCentOS\u5f8c\u7d99\u3068\u8a00\u308f\u308c\u308b<a href=\"https:\/\/almalinux.org\/ja\/\" target=\"_blank\" rel=\"noopener\">AlmaLinux<\/a>\u306e\u69cb\u7bc9\u65b9\u6cd5\u3092\u52c9\u5f37\u3057\u3066\u304a\u304d\u305f\u3044\u3002\u4eca\u56de\u306fWebARENA Indigo&amp;AlmaLinux8.6\u306bLAMP\u74b0\u5883&amp;Wordpress\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5\u3092\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u74b0\u5883\u306b\u3064\u3044\u3066<\/h2>\n<p><a href=\"https:\/\/web.arena.ne.jp\/indigo\/\" target=\"_blank\" rel=\"noopener\">WebARENA Indigo<\/a>\u306e\u30e1\u30e2\u30ea1GB\u30d7\u30e9\u30f3\u3067\u69cb\u7bc9\u4f5c\u696d\u3092\u884c\u3046\u3002\u6700\u521d\u306f768MB\u30d7\u30e9\u30f3\u3067\u8a66\u305d\u3046\u3068\u3057\u305f\u304cSSH\u63a5\u7d9a\u90e8\u5206\u3067\u8a70\u307e\u3063\u305f\u305f\u30811GB\u306b\u5207\u308a\u66ff\u3048\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u3084\u308a\u305f\u3044\u3053\u3068<\/h2>\n<p>\u57fa\u672c\u7684\u306b\u306f\u300cLAMP\u74b0\u5883&amp;Wordpress\u300d\u5c0e\u5165\u304c\u76ee\u7684\u3060\u304c\u4ee5\u4e0b\u3082\u884c\u3044\u305f\u3044\u3002<\/p>\n<ul>\n<li>PHP\u306f8\u7cfb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044(<a href=\"https:\/\/qiita.com\/heimaru1231\/items\/e48d7acd96411d2414f7\" target=\"_blank\" rel=\"noopener\">AlmaLinux8\u7cfb\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u30687.2\u7cfb\u306b\u306a\u308b<\/a>\u305f\u3081)<\/li>\n<li>FTP\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044<\/li>\n<li>Let's Encrypt\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057HTTPS\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><span id=\"Indigo\">Indigo\u306b\u95a2\u3059\u308b\u6ce8\u610f\u70b9<\/span><\/h2>\n<h3><span id=\"SSH\">SSH\u63a5\u7d9a\u306b\u95a2\u3057\u3066<\/span><\/h3>\n<p>SSH\u63a5\u7d9a\u3059\u308b\u306b\u306f<a href=\"https:\/\/help.arena.ne.jp\/hc\/ja\/articles\/360049807634-SSH%E6%8E%A5%E7%B6%9A%E3%81%A7%E3%82%A4%E3%83%B3%E3%82%B9%E3%82%BF%E3%83%B3%E3%82%B9%E3%81%AB%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%99%E3%82%8B-Indigo-\" target=\"_blank\" rel=\"noopener\">\u516c\u5f0f\u6848\u5185<\/a>\u306e\u901a\u308a\u30e6\u30fc\u30b6\u540d\u306f\u300calma\u300d\u3001\u30dd\u30fc\u30c8\u306f\u300c22\u300d\u306b\u306a\u308b\u3002<\/p>\n<h3>root\u6a29\u9650\u306b\u306a\u308b\u306b\u306f<\/h3>\n<p>\u3053\u3061\u3089\u3082\u516c\u5f0f\u6848\u5185\u306e\u901a\u308a\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067root\u6a29\u9650\u306b\u6607\u683c\u3059\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo su -<\/pre>\n<p>\u74b0\u5883\u69cb\u7bc9\u306e\u969b\u306f\u57fa\u672c\u7684\u306b\u4e0a\u8a18\u30b3\u30de\u30f3\u30c9\u3067root\u6a29\u9650\u306b\u306a\u3063\u3066\u304b\u3089\u4f5c\u696d\u3059\u308b\u3053\u3068\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-2\">\u4f5c\u696d\u5185\u5bb9<\/span><\/h2>\n<h3><span id=\"i-3\">\u30b9\u30ef\u30c3\u30d7\u9818\u57df\u306e\u4f5c\u6210<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#swap\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\r\ndd if=\/dev\/zero of=\/swapfile bs=1M count=1024\r\n\r\n#\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092swap\u9818\u57df\u306b\u6307\u5b9a\r\nmkswap \/swapfile\r\n \r\n#\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\r\nvi \/etc\/fstab\r\n \r\n#\u518d\u8d77\u52d5\u6642\u306bswap\u9818\u57df\u304c\u8a8d\u8b58\u3055\u308c\u308b\u3088\u3046\u4ee5\u4e0b\u3092\u8ffd\u8a18\r\n\/swapfile               swap                   swap    defaults        0 0\r\n \r\n#\u518d\u8d77\u52d5\r\nreboot\r\n \r\n#\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\r\ntop<\/pre>\n<p>\u3061\u306a\u307f\u306btop\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3059\u308b\u3068\u5909\u66f4\u524d\u5f8c\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5185\u5bb9(Swap\u90e8\u5206)\u304c\u7570\u306a\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u5909\u66f4\u524d\r\nMiB Mem :    964.8 total,     66.1 free,    121.7 used,    777.1 buff\/cache\r\nMiB Swap:      0.0 total,      0.0 free,      0.0 used.    696.6 avail Mem \r\n\r\n#\u5909\u66f4\u5f8c\r\nMiB Mem :    964.8 total,    674.4 free,    123.5 used,    166.9 buff\/cache\r\nMiB Swap:   1024.0 total,   1024.0 free,      0.0 used.    696.5 avail Mem<\/pre>\n<h3><span id=\"selinux\">selinux\u306e\u505c\u6b62<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#selinux\u306e\u72b6\u614b\u3092\u78ba\u8a8d\r\ngetenforce\r\n\r\n#\u4ee5\u4e0b\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3068\u6709\u52b9\u72b6\u614b\r\nEnforcing\r\n\r\n#\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u66f8\u304d\u63db\u3048\r\nvi \/etc\/selinux\/config\r\n\r\n#\u5909\u66f4\u524d\r\nSELINUX=enforcing\r\n\r\n#\u5909\u66f4\u5f8c\r\nSELINUX=disabled\r\n\r\n#\u518d\u8d77\u52d5\r\nreboot<\/pre>\n<h3><span id=\"SSH-2\">SSH\u306e\u8a2d\u5b9a<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\r\nvi \/etc\/ssh\/sshd_config\r\n\r\n#\u66f8\u304d\u63db\u3048\u524d\r\n#Port 22\r\n\r\n#\u66f8\u304d\u63db\u3048\u5f8c\r\nPort 7777\r\n\r\n#:wq\u3067\u4e0a\u66f8\u304d\u4fdd\u5b58\u3057\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067SSH\u518d\u8d77\u52d5\r\nsystemctl restart sshd<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u306722\u30dd\u30fc\u30c8\u304b\u3089\u306fSSH\u63a5\u7d9a\u4e0d\u53ef\u3068\u306a\u308a\u30017777\u30dd\u30fc\u30c8\u304b\u3089\u306f\u63a5\u7d9a\u53ef\u80fd\u306b\u306a\u308b\u3002\u5c1a\u30017777\u306e\u90e8\u5206\u306f\u9069\u5b9c\u5909\u66f4\u3059\u308b\u3053\u3068\u3002<\/p>\n<h3><span id=\"i-4\">\u65e5\u6642\u8a2d\u5b9a<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u65e5\u6642\u8a2d\u5b9a\r\ntimedatectl set-timezone Asia\/Tokyo\r\n\r\n#\u65e5\u6642\u78ba\u8a8d\r\ndate<\/pre>\n<h3><span class=\"enlighter-c0\">yum\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum -y update<\/pre>\n<h3><span id=\"apache\">apache\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nyum -y install httpd\r\n\r\n#apache\u306e\u8d77\u52d5\r\nsystemctl start httpd\r\n\r\n#\u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\r\nsystemctl status httpd\r\n\r\n#\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\r\nsystemctl enable httpd\r\n\r\n#\u81ea\u52d5\u8d77\u52d5\u78ba\u8a8d\r\nsystemctl list-unit-files -t service | grep httpd<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067\u30d7\u30e9\u30a6\u30b6\u304b\u3089IP\u30a2\u30c9\u30ec\u30b9\u3067\u30da\u30fc\u30b8\u3092\u958b\u304f\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u7b48\u3002<\/p>\n<p><a href=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/001-5.jpg\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4286\" src=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/001-5-300x229.jpg\" alt=\"\" width=\"300\" height=\"229\" srcset=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/001-5-300x229.jpg 300w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/001-5-768x586.jpg 768w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/001-5.jpg 960w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3>PHP\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#epel\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\r\ndnf -y install epel-release\r\n\r\n#remi\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\r\ndnf -y install https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm\r\n\r\n#dnf\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\r\ndnf clean all &amp;&amp; dnf -y makecache\r\n\r\n\uff03\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u53ef\u80fd\u306aPHP\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\r\ndnf module list php\r\n\r\n#\u4ee5\u4e0b\u5b9f\u884c\u7d50\u679c\r\nAlmaLinux 8 - AppStream\r\nName        Stream          Profiles                         Summary                     \r\nphp         7.2 [d]         common [d], devel, minimal       PHP scripting language      \r\nphp         7.3             common [d], devel, minimal       PHP scripting language      \r\nphp         7.4             common [d], devel, minimal       PHP scripting language      \r\nphp         8.0             common [d], devel, minimal       PHP scripting language      \r\n\r\nRemi's Modular repository for Enterprise Linux 8 - x86_64\r\nName        Stream          Profiles                         Summary                     \r\nphp         remi-7.2        common [d], devel, minimal       PHP scripting language      \r\nphp         remi-7.3        common [d], devel, minimal       PHP scripting language      \r\nphp         remi-7.4        common [d], devel, minimal       PHP scripting language      \r\nphp         remi-8.0        common [d], devel, minimal       PHP scripting language      \r\nphp         remi-8.1        common [d], devel, minimal       PHP scripting language      \r\nphp         remi-8.2        common [d], devel, minimal       PHP scripting language      \r\nphp         remi-8.3        common [d], devel, minimal       PHP scripting language\r\n\r\n#PHP8.3\u3092\u6307\u5b9a\r\ndnf -y module reset php &amp;&amp; dnf -y module enable php:remi-8.3\r\n\r\n#\u518d\u5ea6\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u53ef\u80fd\u306aPHP\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\r\ndnf module list php\r\n\r\n#\u4ee5\u4e0b\u5b9f\u884c\u7d50\u679c\u3068\u306a\u308aremi-8.3\u306b[e]\u304c\u3064\u3044\u3066\u3044\u308b(enabled\u306b\u306a\u3063\u3066\u3044\u308b)\u70b9\u304c\u78ba\u8a8d\u3067\u304d\u308b\r\nAlmaLinux 8 - AppStream\r\nName       Stream             Profiles                        Summary                    \r\nphp        7.2 [d]            common [d], devel, minimal      PHP scripting language     \r\nphp        7.3                common [d], devel, minimal      PHP scripting language     \r\nphp        7.4                common [d], devel, minimal      PHP scripting language     \r\nphp        8.0                common [d], devel, minimal      PHP scripting language     \r\n\r\nRemi's Modular repository for Enterprise Linux 8 - x86_64\r\nName       Stream             Profiles                        Summary                    \r\nphp        remi-7.2           common [d], devel, minimal      PHP scripting language     \r\nphp        remi-7.3           common [d], devel, minimal      PHP scripting language     \r\nphp        remi-7.4           common [d], devel, minimal      PHP scripting language     \r\nphp        remi-8.0           common [d], devel, minimal      PHP scripting language     \r\nphp        remi-8.1           common [d], devel, minimal      PHP scripting language     \r\nphp        remi-8.2           common [d], devel, minimal      PHP scripting language     \r\nphp        remi-8.3 [e]       common [d], devel, minimal      PHP scripting language\r\n\r\n#PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\ndnf -y install php php-cli php-fpm php-devel php-pear php-curl php-mysqlnd php-gd php-opcache php-zip php-intl php-common php-bcmath php-imagick php-xmlrpc php-json php-readline php-memcached php-redis php-mbstring php-apcu php-xml php-dom php-redis php-memcached php-memcache php-process\r\n\r\n#\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305fPHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\r\nphp -v\r\n\r\n#\u5b9f\u884c\u7d50\u679c\r\nPHP 8.3.2 (cli) (built: Jan 16 2024 13:46:41) (NTS gcc x86_64)\r\n\r\n#apache\u306e\u518d\u8d77\u52d5\r\nsystemctl restart httpd\r\n\r\n#PHP\u306e\u52d5\u4f5c\u78ba\u8a8d\r\necho \"&lt;?php phpinfo(); ?&gt;\" &gt; \/var\/www\/html\/info.php<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u300cIP\u30a2\u30c9\u30ec\u30b9\/info.php\u300d\u3092\u958b\u304f\u3068\u4ee5\u4e0b\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u7b48\u3002<\/p>\n<p><a href=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/002-2.jpg\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4287\" src=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/002-2-300x240.jpg\" alt=\"\" width=\"300\" height=\"240\" srcset=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/002-2-300x240.jpg 300w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/002-2-768x615.jpg 768w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/002-2.jpg 916w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h3><span id=\"MySQL\">MySQL\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#MariaDB\u524a\u9664\r\nyum -y remove mariadb-libs\r\n\r\n#MySQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\ndnf -y install mysql-server mysql\r\n\r\n#\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\r\nmysqld --version\r\n\r\n\uff03\u4ee5\u4e0b\u5b9f\u884c\u7d50\u679c\r\n\/usr\/libexec\/mysqld  Ver 8.0.32 for Linux on x86_64 (Source distribution)\r\n\r\n#MySQL\u306e\u8d77\u52d5\r\nsystemctl start mysqld\r\n\r\n#\u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\r\nsystemctl status mysqld\r\n\r\n#\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\r\nsystemctl enable mysqld\r\n\r\n#\u81ea\u52d5\u8d77\u52d5\u78ba\u8a8d\r\nsystemctl list-unit-files -t service | grep mysqld\r\n\r\n#MySQL\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\r\nmysql_secure_installation<\/pre>\n<p>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u306f\u57fa\u672c\u7684\u306b\u300cy\u300d\u3067\u9032\u3093\u3067\u3044\u304f\u3068\u3044\u3044\u304c\u4ee5\u4e0b\u306e2\u70b9\u3060\u3051\u6ce8\u610f\u3002<\/p>\n<p>\u4ee5\u4e0b\u3092\u805e\u304b\u308c\u305f\u3068\u304d\u306froot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3059\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Please set the password for root here.\r\n\r\nNew password: \r\n\r\nRe-enter new password:<\/pre>\n<p>\u4ee5\u4e0b\u304c\u805e\u304b\u308c\u305f\u3068\u304d\u306f0 \/ 1 \/ 2\u3092\u5165\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u4ee5\u524d<a href=\"https:\/\/taitan916.info\/blog\/archives\/3418#MySQL-2\" target=\"_blank\" rel=\"noopener\">CentOS6\u304b\u30897\u306b\u79fb\u884c\u3057\u305f\u969b\u306bMySQL\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5909\u66f4\u3067\u304d\u306a\u3044<\/a>\u3068\u3044\u3046\u30c8\u30e9\u30d6\u30eb\u304c\u3042\u3063\u305f\u305f\u3081\u4eca\u56de\u306f0\u306b\u3057\u305f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">There are three levels of password validation policy:\r\n\r\nLOW    Length &gt;= 8\r\nMEDIUM Length &gt;= 8, numeric, mixed case, and special characters\r\nSTRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary                  file\r\n\r\nPlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:<\/pre>\n<p>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u5b8c\u4e86\u5f8c\u306f\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mysql -u root -p<\/pre>\n<h3><span id=\"FTP\">FTP\u30b5\u30fc\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u30e6\u30fc\u30b6\u30fc\u4f5c\u6210\r\nuseradd test_user\r\n\r\n#\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u304b\u3051\u308b\r\npasswd test_user\r\n \r\n#\u30e6\u30fc\u30b6\u30fc\u3092apache\u30b0\u30eb\u30fc\u30d7\u306b\u5165\u308c\u308b\r\nusermod -g apache test_user\r\n#\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u8a2d\u5b9a\r\nchmod 775 \/ver\/www\/html\r\n\r\n#FTP\u30b5\u30fc\u30d0\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nyum -y install vsftpd\r\n\r\n#\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\r\nvi \/etc\/vsftpd\/vsftpd.conf<\/pre>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3082\u3057\u304f\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3059\r\nchroot_local_user=YES\r\nchroot_list_enable=YES\r\nallow_writeable_chroot=YES\r\n\r\n#\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3059\r\nchroot_list_file=\/etc\/vsftpd\/chroot_list\r\nls_recurse_enable=YES \r\n\r\n#\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057:wq\u3067\u4e0a\u66f8\u304d\u4fdd\u5b58\r\nlocal_root=public_html\r\nuse_localtime=YES\r\nlocal_root=\/var\/www\/html\r\nforce_dot_files=YES<\/pre>\n<p>\u4e0a\u66f8\u304d\u4fdd\u5b58\u5f8c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u9032\u3081\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u4e0a\u5c64\u3078\u306ecd\u3092\u8a31\u53ef\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u8a2d\u5b9a\u3059\u308b\r\nvi \/etc\/vsftpd\/chroot_list \r\n\r\n#\u30d5\u30a1\u30a4\u30eb\u304c\u958b\u304f\u306e\u3067\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u8ffd\u8a18\u3057\u3066:wq\u3067\u4e0a\u66f8\u304d\u4fdd\u5b58\r\ntest_user\r\n\r\n#FTP\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\r\nsystemctl start vsftpd\r\n\r\n#\u30b9\u30c6\u30fc\u30bf\u30b9\u78ba\u8a8d\r\nsystemctl status vsftpd\r\n\r\n#\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\r\nsystemctl enable vsftpd\r\n\r\n#\u81ea\u52d5\u8d77\u52d5\u78ba\u8a8d\r\nsystemctl list-unit-files -t service | grep vsftpd<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067FFFTP\u7b49\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30bd\u30d5\u30c8\u3067\u63a5\u7d9a\u3067\u304d\u308b\u7b48\u3002\u5c1a\u3001\u6b63\u5e38\u306b\u63a5\u7d9a\u3067\u304d\u306a\u3044\u5834\u5408\u306fselinux\u304c\u505c\u6b62\u3057\u3066\u3044\u308b\u304b\u8981\u78ba\u8a8d(\u79c1\u306e\u74b0\u5883\u3060\u3068\u6b63\u5e38\u306b\u505c\u6b62\u3067\u304d\u3066\u304a\u3089\u305a\u63a5\u7d9a\u3067\u304d\u306a\u304b\u3063\u305f)\u3002<\/p>\n<h3><span id=\"Lets_Encrypt\">Let's Encrypt\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#SSL\u95a2\u9023\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3068certbot\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nyum -y install openssl mod_ssl epel-release certbot\r\n\r\n#\u8a3c\u660e\u66f8\u3092\u4f5c\u6210(xxxxx.com\u306f\u9069\u5b9c\u5909\u66f4\u3059\u308b\u3002\u307e\u305f\u3001\u30c6\u30b9\u30c8\u3057\u305f\u3044\u5834\u5408\u306f\u5f8c\u308d\u306b--dry-run\u3092\u3064\u3051\u308b)\r\ncertbot certonly --webroot -w \/var\/www\/html\/xxxxxxx -d xxxxx.com\r\n\r\n#\u305d\u306e\u5f8c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3059\u308b\r\n\r\n#\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u8a2d\u5b9a\r\nvi \/etc\/httpd\/conf.d\/virtual.conf\r\n\r\n#\u4ee5\u4e0b\u3092\u8ffd\u8a18(xxxx.com\u90e8\u5206\u306f\u9069\u5b9c\u5909\u66f4\u3059\u308b)\r\n&lt;VirtualHost *:80&gt;\r\n    ServerAdmin xxxx.com\r\n    DocumentRoot \/var\/www\/html\/xxxx.com\r\n    ServerName xxxx.com\r\n    ErrorLog logs\/error_log\r\n    CustomLog logs\/access_log common\r\n&lt;\/VirtualHost&gt;\r\n\r\n&lt;VirtualHost *:443&gt;\r\n    ServerAdmin xxxx.com\r\n    DocumentRoot \/var\/www\/html\/xxxx.com\r\n    ServerName xxxx.com\r\n    ErrorLog logs\/error_log\r\n    CustomLog logs\/access_log common\r\n \r\n    SSLEngine on\r\n    SSLCertificateFile \/etc\/letsencrypt\/live\/xxxx.com\/fullchain.pem\r\n    SSLCertificateKeyFile \/etc\/letsencrypt\/live\/xxxx.com\/privkey.pem\r\n    NameVirtualhost *:443\r\n&lt;\/VirtualHost&gt;\r\n\r\n#apache\u306e\u518d\u8d77\u52d5\r\nsystemctl restart httpd<\/pre>\n<p>\u30c9\u30e1\u30a4\u30f3\u3092\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u308c\u3070\u3053\u306e\u6642\u70b9\u3067HTTPS\u63a5\u7d9a\u3067\u304d\u308b\u7b48\u3002\u5c1a\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066SSL\u8a3c\u660e\u66f8\u306e\u81ea\u52d5\u66f4\u65b0\u8a2d\u5b9a\u3092\u4ee5\u4e0b\u306e\u5f62\u3067\u767b\u9332\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Cron\u3092root\u3067\u8a2d\u5b9a\r\ncrontab -u root -e\r\n\r\n#\u4ee5\u4e0b\u3092\u8a18\u8ff0\u3059\u308b\r\n00 04 01 * * certbot renew &amp;&amp; systemctl restart httpd<\/pre>\n<p>\u3053\u3053\u307e\u3067\u3067LAMP\u74b0\u5883\u306e\u69cb\u7bc9\u306f\u5b8c\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>WordPress\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u79fb\u52d5\r\ncd \/var\/www\/html\r\n\r\n#wget\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nyum -y install wget\r\n\r\n#WordPress\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\r\nwget https:\/\/ja.wordpress.org\/latest-ja.tar.gz\r\n\r\n#\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\r\ntar zxvf latest-ja.tar.gz\r\n\r\n#\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6240\u6709\u8005\u3092\u5909\u66f4\r\nchown -R apache:apache wordpress\r\n\r\n#WordPress\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\r\nrm latest-ja.tar.gz\r\n\r\n#mysql\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\nmysql -u root -p\r\n\r\n#\u30d1\u30b9\u30ef\u30fc\u30c9\u30dd\u30ea\u30b7\u30fc\u3092LOW\u306b\u5909\u66f4\u3059\u308b\r\nset global validate_password.policy=LOW;\r\n\r\n#\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\r\nCREATE USER 'test_user' IDENTIFIED BY 'test_pass';\r\n\r\n#\u6a29\u9650\u306e\u5909\u66f4\r\nGRANT ALL ON *.* TO test_user;\r\n\r\n#\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210\r\nCREATE DATABASE wordpress;<\/pre>\n<p>\u5148\u307b\u3069MySQL\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u5b9a\u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u691c\u8a3c\u30dd\u30ea\u30b7\u30fc\u30920\u306b\u3057\u305f\u3051\u3069\u3001\u6539\u3081\u3066\u300cset global validate_password.policy=LOW;\u300d\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002<\/p>\n<p>\u5c1a\u3001\u3053\u306e\u6642\u70b9\u3067\u300c\u30c9\u30e1\u30a4\u30f3\/wordpress\u300d\u3092\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u958b\u304f\u3068\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u7b48\u3002<\/p>\n<p><a href=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/003.jpg\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4293\" src=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/003-300x210.jpg\" alt=\"\" width=\"300\" height=\"210\" srcset=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/003-300x210.jpg 300w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/003-768x538.jpg 768w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/003.jpg 960w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u6848\u5185\u306e\u901a\u308a\u9032\u3081\u3066\u3044\u304f\u3068\u4ee5\u4e0bWordPress\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n<p><a href=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/004.jpg\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4294\" src=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/004-300x231.jpg\" alt=\"\" width=\"300\" height=\"231\" srcset=\"https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/004-300x231.jpg 300w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/004-768x591.jpg 768w, https:\/\/taitan916.info\/blog\/wp-content\/uploads\/2024\/01\/004.jpg 935w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>\u6240\u898b<\/h2>\n<p>CentOS\u5f8c\u7d99\u3068\u8a00\u308f\u308c\u308b\u3060\u3051\u3042\u3063\u3066\u57fa\u672c\u7684\u306b\u306f<a href=\"https:\/\/taitan916.info\/blog\/archives\/3418#MySQL\" target=\"_blank\" rel=\"noopener\">CentOS7\u306e\u74b0\u5883\u69cb\u7bc9\u3068\u540c\u3058\u3088\u3046<\/a>\u306b\u4f5c\u696d\u3067\u304d\u305f\u3002\u3057\u3070\u3089\u304f\u89e6\u3063\u3066\u307f\u3066\u554f\u984c\u7121\u3055\u305d\u3046\u306a\u3089\u79fb\u884c\u3057\u3088\u3046\u3068\u601d\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3060\u3044\u3076\u524d\u306bCentOS6\u7cfb\u304b\u30897\u7cfb\u306b\u79fb\u884c\u3057\u305f\u304c\u30017\u7cfb\u30822024\/6\/30\u306b\u30b5\u30dd\u30fc ... <\/p>\n","protected":false},"author":1,"featured_media":4342,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[46,7],"tags":[99],"class_list":["post-4283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps","category-server","tag-lets-encrypt"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/4283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=4283"}],"version-history":[{"count":5,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/4283\/revisions"}],"predecessor-version":[{"id":6680,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/4283\/revisions\/6680"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/4342"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=4283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=4283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=4283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}