{"id":13535,"date":"2023-08-05T13:12:43","date_gmt":"2023-08-05T04:12:43","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=13535"},"modified":"2024-01-03T12:22:43","modified_gmt":"2024-01-03T03:22:43","slug":"wordpress%e7%94%a8%e3%81%ae%e3%82%b5%e3%83%bc%e3%83%90%e3%82%92%e6%a7%8b%e7%af%89%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88centos-7%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/13535","title":{"rendered":"WordPress\u7528\u306e\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\uff01\uff08CentOS 7\uff09"},"content":{"rendered":"<p>\u516c\u958b\u7528\u306eWordPress\u30b5\u30fc\u30d0\u3092CentOS 7 + Apache 2.4 + PHP 7.1 + MariaDB 5.5\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d0\u306f\u3001\u8a2d\u5b9a\u3084\u64cd\u4f5c\u306e\u81ea\u7531\u5ea6\u306e\u9ad8\u3044VPS\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002VPS\u306f\u300cConoHa\u300d\u3001DNS\u306f\u300cSakura Internet\u300d\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>VPS\u3068\u30c9\u30e1\u30a4\u30f3\u540d\u306e\u6e96\u5099<\/h2>\n<p>\u4f5c\u696d\u958b\u59cb\u524d\u306b\u3001VPS\u306e\u5951\u7d04\u3068\u30c9\u30e1\u30a4\u30f3\u540d\u3092\u53d6\u5f97\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u672c\u30b5\u30a4\u30c8\u3067\u306f\u3001\u4ee5\u4e0b\u306eVPS\u3068DNS\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>VPS\u306e\u5951\u7d04\uff08ConoHa\uff09<\/li>\n<li>\u30c9\u30e1\u30a4\u30f3\u540d\u306e\u53d6\u5f97\uff08Sakura Internet\uff09<\/li>\n<\/ul>\n<h2>\u8a2d\u5b9a\u9805\u76ee\u3068\u8a2d\u5b9a\u5024\u306e\u6e96\u5099<\/h2>\n<p>\u4e3b\u8981\u306a\u8a2d\u5b9a\u9805\u76ee\u306e\u8a2d\u5b9a\u5024\u3092\u6c7a\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30b5\u30a4\u30c8\u306eURL<\/li>\n<li>\u30b5\u30fc\u30d0\u8a2d\u5b9a\u7528\u306e\u30d1\u30e9\u30e1\u30fc\u30bf<\/li>\n<li>WordPress\u306eDB\u63a5\u7d9a\u8a2d\u5b9a\u7528\u30d1\u30e9\u30e1\u30fc\u30bf<\/li>\n<li>WordPress\u306e\u30b5\u30a4\u30c8\u8a2d\u5b9a\u7528\u30d1\u30e9\u30e1\u30fc\u30bf<\/li>\n<\/ul>\n<h3>\u30b5\u30a4\u30c8\u306eURL\uff08\u4f8b\uff09<\/h3>\n<p>\u30de\u30eb\u30c1\u30b5\u30a4\u30c8\u3092\u8003\u616e\u3057\u3066\u3001\u30b5\u30a4\u30c8\u5168\u4f53\u306eURL\u3068\u30b5\u30a4\u30c8\u500b\u5225\u306eURL\u3092\u6c7a\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u8a2d\u5b9a\u9805\u76ee<\/th>\n<th>\u8a2d\u5b9a\u5024<\/th>\n<\/tr>\n<tr>\n<td>\u30b5\u30a4\u30c8\u5168\u4f53\u306eURL<\/td>\n<td>https:\/\/lab4ict.com\/<\/td>\n<\/tr>\n<tr>\n<td>\u30b5\u30a4\u30c8\u500b\u5225\u306eURL<\/td>\n<td>https:\/\/lab4ict.com\/system\/<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u30b5\u30fc\u30d0\u8a2d\u5b9a\u7528\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\uff08\u4f8b\uff09<\/h3>\n<p>\u30b5\u30fc\u30d0\u540d\u3092\u6c7a\u3081\u3066\u304a\u304d\u307e\u3059\u3002IP\u30a2\u30c9\u30ec\u30b9\u306f\u3001\u30b5\u30fc\u30d0\u4f5c\u6210\u5f8c\u306b\u78ba\u8a8d\u3057\u3066\u63a7\u3048\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u8a2d\u5b9a\u9805\u76ee<\/th>\n<th>\u8a2d\u5b9a\u5024<\/th>\n<\/tr>\n<tr>\n<td>\u30db\u30b9\u30c8\u540d<\/td>\n<td>server001<\/td>\n<\/tr>\n<tr>\n<td>IP\u30a2\u30c9\u30ec\u30b9<\/td>\n<td>133.130.127.128\uff08VPS\u3067\u30b5\u30fc\u30d0\u4f5c\u6210\u5f8c\u306b\u78ba\u8a8d\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>WordPress\u306eDB\u63a5\u7d9a\u8a2d\u5b9a\u7528\u306e\u8a2d\u5b9a\u5024\uff08\u4f8b\uff09<\/h3>\n<p>DB\u4f5c\u6210\u7528\u304a\u3088\u3073\u63a5\u7d9a\u7528\u306e\u60c5\u5831\u3092\u6c7a\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u8a2d\u5b9a\u9805\u76ee<\/th>\n<th>\u8a2d\u5b9a\u5024<\/th>\n<\/tr>\n<tr>\n<td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d<\/td>\n<td>db01<\/td>\n<\/tr>\n<tr>\n<td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30e6\u30fc\u30b6\u30fc\u540d<\/td>\n<td>db01admin<\/td>\n<\/tr>\n<tr>\n<td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d1\u30b9\u30ef\u30fc\u30c9<\/td>\n<td>**********<\/td>\n<\/tr>\n<tr>\n<td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30db\u30b9\u30c8<\/td>\n<td>localhost<\/td>\n<\/tr>\n<tr>\n<td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u63a5\u982d\u8f9e<\/td>\n<td>wp_<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>WordPress\u306e\u30b5\u30a4\u30c8\u8a2d\u5b9a\u7528\u306e\u8a2d\u5b9a\u5024\uff08\u4f8b\uff09<\/h3>\n<p>WordPress\u30b5\u30a4\u30c8\u4f5c\u6210\u7528\u306e\u60c5\u5831\u3092\u6c7a\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u8a2d\u5b9a\u9805\u76ee<\/th>\n<th>\u8a2d\u5b9a\u5024<\/th>\n<\/tr>\n<tr>\n<td>\u30b5\u30a4\u30c8\u306e\u30bf\u30a4\u30c8\u30eb<\/td>\n<td>Laboratory for Personal ICT<\/td>\n<\/tr>\n<tr>\n<td>\u30b5\u30a4\u30c8\u306e\u30e6\u30fc\u30b6\u30fc\u540d<\/td>\n<td>admin001<\/td>\n<\/tr>\n<tr>\n<td>\u30b5\u30a4\u30c8\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9<\/td>\n<td>**********<\/td>\n<\/tr>\n<tr>\n<td>\u30b5\u30a4\u30c8\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/td>\n<td>admin001@lab4ict.com<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>VPS\u3067CentOS 7\u30b5\u30fc\u30d0\u3092\u4f5c\u6210<\/h2>\n<p>VPS\u3067CentOS 7\u306e\u30b5\u30fc\u30d0\u306e\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002\u672c\u7a3f\u3067\u306f\u3001VPS\u3068\u3057\u3066\u300cConoHa\u300d\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>VPS\u3067SSH\u9375\u751f\u6210<\/h3>\n<p>VPS\u306e\u30e1\u30cb\u30e5\u30fc\u304b\u3089root\u30e6\u30fc\u30b6\u7528\u306eSSH\u306e\u9375\u751f\u6210\u3092\u884c\u3044\u3001\u79d8\u5bc6\u9375\u3092\u30b5\u30a4\u30c8\u7ba1\u7406\u7528\u306ePC\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002Linux\u306e\u5834\u5408\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u9375\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u6a29\u9650\u306f\u3001600\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ chmod 600 ~\/.ssh\/id_rsa_root.pem\r\n<\/pre>\n<h3>VPS\u3067\u30b5\u30fc\u30d0\u4f5c\u6210<\/h3>\n<p>VPS\u306e\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u3001\u4f5c\u6210\u3057\u305fSSH\u7528\u306e\u9375\u3092\u4f7f\u7528\u53ef\u306b\u8a2d\u5b9a\u3057\u3066\u3001CentOS 7\u306e\u30b5\u30fc\u30d0\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f5c\u6210\u5b8c\u4e86\u5f8c\u3001SSH\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u3001Linux\u306e\u4f8b\u3067\u3059\u304c\u3001Windows\u306e\u5834\u5408\u306f\u3001Tera Term Pro\u7b49\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ ssh -l root -i ~\/.ssh\/id_rsa_root.pem 133.130.127.128\r\n<\/pre>\n<h3>\u7ba1\u7406\u8005\u30e6\u30fc\u30b6\u306e\u8ffd\u52a0<\/h3>\n<p>root\u30e6\u30fc\u30b6\u3092\u30ea\u30e2\u30fc\u30c8\u30ed\u30b0\u30a4\u30f3\u4e0d\u53ef\u306b\u3059\u308b\u305f\u3081\u3001\u4f5c\u696d\u7528\u306e\u7ba1\u7406\u8005\u30e6\u30fc\u30b6\u30922\u30e6\u30fc\u30b6\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4]; title: ; notranslate\" title=\"\">\r\n# useradd -u 1001 -g wheel admin001\r\n# passwd admin001\r\n# useradd -u 1002 -g wheel admin002\r\n# passwd admin002\r\n<\/pre>\n<h3>\u30b5\u30a4\u30c8\u7ba1\u7406\u7528\u306eSSH\u63a5\u7d9a\u8a2d\u5b9a<\/h3>\n<p>\u30b5\u30a4\u30c8\u7ba1\u7406\u7528\u306ePC\u4e0a\u3067\u3001SSH\u63a5\u7d9a\u306e\u305f\u3081\u306e\u9375\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u3001Linux\u306e\u4f8b\u3067\u3059\u304c\u3001Windows\u306e\u5834\u5408\u306f\u3001Tera Term Pro\u7b49\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4,5,6]; title: ; notranslate\" title=\"\">\r\n$ ssh-keygen -t rsa -b 2048 -C &quot;admin001@server001 serialno=1&quot;\r\n$ mv id_rsa id_rsa_admin001\r\n$ mv id_rsa.pub id_rsa_admin001.pub\r\n$ ssh-keygen -t rsa -b 2048 -C &quot;admin002@server001 susralno=1&quot;\r\n$ mv id_rsa id_rsa_admin002\r\n$ mv id_rsa.pub id_rsa_admin002.pub\r\n<\/pre>\n<p>\u7ba1\u7406\u8005\u30e6\u30fc\u30b6\u305d\u308c\u305e\u308c\u306b\u3064\u3044\u3066\u3001\u516c\u958b\u9375\u3092SSH\u3067\u30b5\u30fc\u30d0\u306b\u8ee2\u9001\u3057\u3001\u5404\u30e6\u30fc\u30b6\u7528\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002\uff08admin001\u306e\u4f8b\uff09<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4,5]; title: ; notranslate\" title=\"\">\r\n# mkdir \/home\/admin001\/.ssh\r\n# chown admin001:wheel \/home\/admin001\/.ssh\r\n# chmod 700 \/home\/admin001\/.ssh\r\n# mv \/root\/id_rsa.pub_admin001 \/home\/admin001\/.ssh\/authorized_keys\r\n# chmod 600 \/home\/admin001\/.ssh\/authorized_keys\r\n<\/pre>\n<p>SSH\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a4\u5bfe\u7b56\u3092\u884c\u3044\u307e\u3059\u3002root\u30e6\u30fc\u30b6\u306e\u30ed\u30b0\u30a4\u30f3\u3092\u7981\u6b62\u3057\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u3092\u4e0d\u53ef\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# vi \/etc\/ssh\/sshd_config\r\n...\r\nPermitRootLogin no\r\n...\r\nPasswordAuthentication no\r\n...\r\n<\/pre>\n<p>SSH\u306e\u8a2d\u5b9a\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3001\u9375\u8a8d\u8a3c\u306e\u307f\u3067\u30ed\u30b0\u30a4\u30f3\u53ef\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n# systemctl reload sshd\r\n<\/pre>\n<p>SSH\u3067\u63a5\u7d9a\u3092\u8a66\u307f\u308b\u3068\u3001\u30b5\u30fc\u30d0\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u7121\u3057\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ ssh -l admin001 -i 133.130.127.128\r\n<\/pre>\n<h3>VPS\u306e\u901a\u4fe1\u8a31\u53ef\u30dd\u30fc\u30c8\u306e\u8a2d\u5b9a<\/h3>\n<p>\u901a\u4fe1\u5236\u5fa1\u306f\u3001CentOS\u3067\u884c\u3046\u305f\u3081\u3001VPS\u306e\u901a\u4fe1\u8a31\u53ef\u30dd\u30fc\u30c8\u306e\u8a2d\u5b9a\u306f\u3001\u5168\u3066\u8a31\u53ef\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h2>CentOS 7\u306e\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>\u30b5\u30fc\u30d0\u3078\u306e\u30ed\u30b0\u30a4\u30f3\u74b0\u5883\u304c\u6574\u3063\u305f\u3068\u3053\u308d\u3067\u3001CentOS 7\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<h3>CentOS 7\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<\/h3>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bCentOS 7\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cat \/etc\/redhat-release\r\nCentOS Linux release 7.4.1708 (Core)\r\n<\/pre>\n<h3>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a2d\u5b9a<\/h3>\n<p>\u30db\u30b9\u30c8\u540d\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo hostnamectl set-hostname server001\r\n<\/pre>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c7\u30d0\u30a4\u30b9\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ nmcli device\r\nDEVICE TYPE STATE CONNECTION\r\neth0 ethernet connected eth0\r\nlo loopback unmanaged --\r\n<\/pre>\n<p>IP\u30a2\u30c9\u30ec\u30b9\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ ip a\r\n1: lo: ...\r\n2: eth0: ...\r\n<\/pre>\n<h3>SELinux\u306e\u8a2d\u5b9a<\/h3>\n<p>SELinux\u306b\u3088\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306f\u8a2d\u5b9a\u3092\u898b\u6975\u3081\u308b\u307e\u3067\u7121\u52b9\u5316\u3057\u307e\u3059\u304c\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u9055\u53cd\u304c\u3042\u3063\u305f\u3053\u3068\u3092\u30ed\u30b0\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u306b\"Permissive\"\u30e2\u30fc\u30c9\u3067\u52d5\u4f5c\u3055\u305b\u307e\u3059\u3002\u518d\u8d77\u52d5\u3057\u3066\u5909\u66f4\u304c\u6709\u52b9\u3067\u3042\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/selinux\/config\r\n...\r\nSELINUX=permissive\r\n...\r\n<\/pre>\n<p>\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl reboot\r\n<\/pre>\n<p>\u518d\u8d77\u52d5\u5f8c\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3001\"Permissive\"\u30e2\u30fc\u30c9\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ getenforce\r\nPermissive\r\n<\/pre>\n<h2>\u30c9\u30e1\u30a4\u30f3\u540d\u306e\u53d6\u5f97\u3068DNS\u306e\u8a2d\u5b9a<\/h2>\n<p>ConoHa\u306eVPS\u3067\u4f5c\u6210\u3057\u305f\u30b5\u30fc\u30d0\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3057\u3001Sakura Internet\u306eDNS\u8a2d\u5b9a\u30da\u30fc\u30b8\u3067\u3001\u53d6\u5f97\u3057\u305f\u30c9\u30e1\u30a4\u30f3\u306b\u5bfe\u3057\u3066\u4ee5\u4e0b\u306e\u30ec\u30b3\u30fc\u30c9\uff08\u4f8b\uff09\u306e\u8ffd\u52a0\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u30a8\u30f3\u30c8\u30ea\u540d<\/th>\n<th>\u30bf\u30a4\u30d7<\/th>\n<th>\u30c7\u30fc\u30bf<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>A<\/td>\n<td>133.130.127.128<\/td>\n<td>\u540d\u524d\u89e3\u6c7a\u7528<\/td>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>MX<\/td>\n<td>10 mail.lab4ict.com.<\/td>\n<td>\u30e1\u30fc\u30eb\u53d7\u4fe1\u7528<\/td>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>TXT<\/td>\n<td>\"v=spf1 ip4:133.130.127.128 -all\"<\/td>\n<td>SPF\u7528<\/td>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>CAA<\/td>\n<td>0 issue \"letsencrypt.org\"<\/td>\n<td>DNS CAA\u7528<\/td>\n<\/tr>\n<tr>\n<td>@<\/td>\n<td>CAA<\/td>\n<td>0 iodef \"admin001@lab4ict.com\"<\/td>\n<td>DNS CAA\u7528<\/td>\n<\/tr>\n<tr>\n<td>mail<\/td>\n<td>A<\/td>\n<td>133.130.127.128<\/td>\n<td>\u540d\u524d\u89e3\u6c7a\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>CentOS 7\u306e\u5916\u90e8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u767b\u9332<\/h2>\n<p>PHP\u7b49\u3001\u6a19\u6e96\u30ea\u30dd\u30b8\u30c8\u30ea\u3088\u308a\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u3001\u5916\u90e8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<h3>yum-priorities\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u9593\u306e\u512a\u5148\u9806\u4f4d\u3092\u8a2d\u5b9a\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install yum-priorities\r\n<\/pre>\n<h3>EPEL\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u767b\u9332<\/h3>\n<p>EPEL\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install epel-release\r\n<\/pre>\n<p>\u4e00\u6642\u5229\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/yum.repos.d\/epel.repo\r\n&#x5B;epel]\r\n...\r\nenabled=0\r\n<\/pre>\n<h3>Remi's RPM repository\u306e\u767b\u9332<\/h3>\n<p>Remi's RPM repository\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-7.rpm\r\n<\/pre>\n<p>\u4e00\u6642\u5229\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/yum.repos.d\/remi-safe.repo\r\n&#x5B;remi-safe]\r\n...\r\nenabled=0\r\n<\/pre>\n<h2>CentOS 7\u306e\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u4ee5\u5f8c\u306e\u4f5c\u696d\u7b49\u3067\u5fc5\u8981\u306b\u306a\u308b\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h3>wget\u30b3\u30de\u30f3\u30c9\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>WordPress\u7b49\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u3001wget\u30b3\u30de\u30f3\u30c9\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install wget\r\n<\/pre>\n<h2>Apache\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002SSL\u304c\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306bmod_ssl\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install httpd mod_ssl\r\n$ httpd -version\r\n#Listen 80\r\nListen 133.130.127.128:80\r\n#ServerName www.example.com:80\r\nServerName lab4ict.com:80\r\n#ServerAdmin root@localhost\r\nServerAdmin root@lab4ict.com\r\n<\/pre>\n<p>Apache\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo cp -p \/etc\/httpd\/conf\/httpd.conf ~\/httpd.conf_org\r\n$ sudo vi \/etc\/httpd\/conf\/httpd.conf\r\n&lt;ifModule mod_rewrite.c&gt;\r\nRewriteEngine On\r\nRewriteCond %{HTTPS} off\r\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} &#x5B;R,L]\r\n&lt;\/ifModule&gt;\r\n<\/pre>\n<p>\".htaccess\"\u3092\u4f7f\u7528\u53ef\u306b\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/httpd\/conf.d\/htmldir.conf\r\n&lt;Directory &quot;\/var\/www\/html&quot;&gt;\r\nAllowOverride All\r\n&lt;\/Directory&gt;\r\n<\/pre>\n<p>\u901a\u4fe1\u5236\u5fa1\u306e\u8a2d\u5b9a\u5909\u66f4\u3092\u884c\u3044\u300180\/tcp\u3068443\/tcp\u306e\u901a\u4fe1\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4]; title: ; notranslate\" title=\"\">\r\n$ sudo firewall-cmd --add-port=80\/tcp --zone=public --permanent\r\n$ sudo firewall-cmd --add-port=443\/tcp --zone=public --permanent\r\n$ sudo firewall-cmd --reload\r\n$ sudo firewall-cmd --list-all --zone=public | grep tcp\r\nports: 80\/tcp 443\/tcp\r\n<\/pre>\n<p>Apache\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl start httpd.service\r\n$ sudo systemctl status httpd.service\r\n\u25cf httpd.service - The Apache HTTP Server\r\nLoaded: loaded (\/usr\/lib\/systemd\/system\/httpd.service; enabled; vendor preset: disabled)\r\nActive: active (running) since Thu 2017-11-23 17:36:36 JST; 7s ago\r\n...\r\n<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\nhttp:\/133.130.127.128\/\r\n<\/pre>\n<h2>\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u306e\u53d6\u5f97<\/h2>\n<p>Let' Encrypt\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install --enablerepo=epel certbot certbot-apache\r\n<\/pre>\n<p>Let' Encrypt\u3067\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo certbot certonly --webroot -w \/var\/www\/html\/ -d lab4ict.com\r\n...\r\n- Congratulations! Your certificate and chain have been saved at:\r\n...\r\n<\/pre>\n<p>\u53d6\u5f97\u3057\u305f\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u304c\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002\u8a3c\u660e\u66f8\u306e\u6709\u52b9\u671f\u9650\u306f3\u30f6\u6708\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo ls -l \/etc\/letsencrypt\/live\/lab4ict.com\r\ntotal 4\r\nlrwxrwxrwx. 1 root root 35 Dec 29 19:50 cert.pem -&gt; ..\/..\/archive\/lab4ict.com\/cert1.pem\r\nlrwxrwxrwx. 1 root root 36 Dec 29 19:50 chain.pem -&gt; ..\/..\/archive\/lab4ict.com\/chain1.pem\r\nlrwxrwxrwx. 1 root root 40 Dec 29 19:50 fullchain.pem -&gt; ..\/..\/archive\/lab4ict.com\/fullchain1.pem\r\nlrwxrwxrwx. 1 root root 38 Dec 29 19:50 privkey.pem -&gt; ..\/..\/archive\/lab4ict.com\/privkey1.pem\r\n-rw-r--r--. 1 root root 543 Dec 29 19:50 README\r\n<\/pre>\n<p>\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u306e\u81ea\u52d5\u66f4\u65b0\u306e\u305f\u3081\u3001\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u3092\u81ea\u52d5\u66f4\u65b0\u3059\u308b\u30b3\u30de\u30f3\u30c9\u304c\u6b63\u5e38\u7d42\u4e86\u3059\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo certbot renew --pre-hook &quot;sudo systemctl stop httpd.service&quot; --post-hook &quot;sudo systemctl start httpd.service&quot;\r\n<\/pre>\n<p>\u30b5\u30fc\u30d0\u8a3c\u660e\u66f8\u3092\u81ea\u52d5\u66f4\u65b0\u3059\u308b\u305f\u3081\u3001\u4e0a\u8a18\u3067\u78ba\u8a8d\u3057\u305f\u30b3\u30de\u30f3\u30c9\u3092cron\u306b\u767b\u9332\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u3001\u90311\u56de\u3001\u6708\u66dc\u65e5\u306e\u671d1:00\u306b\u5b9f\u884c\u3059\u308b\u4f8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ su - root\r\n# crontab -e\r\n0 1 * * 1 certbot renew --pre-hook &quot;sudo systemctl stop httpd.service&quot; --post-hook &quot;sudo systemctl start httpd.service&quot;\r\n# crontab -l\r\n<\/pre>\n<h2>Apache\u306eSSL\/TLS\u306e\u8a2d\u5b9a<\/h2>\n<p>SSL\u901a\u4fe1\u7528\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,7,8]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/httpd\/conf.d\/rewrite.conf\r\n&lt;ifModule mod_rewrite.c&gt;\r\nRewriteEngine On\r\nRewriteCond %{HTTPS} off\r\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} &#x5B;R,L]\r\n&lt;\/ifModule&gt;\r\n$ sudo cp -p \/etc\/httpd\/conf.d\/ssl.conf ~\/ssl.conf_org\r\n$ sudo vi \/etc\/httpd\/conf.d\/ssl.conf\r\nSSLCertificateFile \/etc\/letsencrypt\/live\/lab4ict.com\/cert.pem\r\nSSLCertificateKeyFile \/etc\/letsencrypt\/live\/lab4ict.com\/privkey.pem\r\nSSLCertificateChainFile \/etc\/letsencrypt\/live\/lab4ict.com\/chain.pem\r\n<\/pre>\n<p>Apache\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl stop httpd.service\r\n$ sudo systemctl start httpd.service\r\n$ sudo systemctl status httpd.service\r\n\u25cf httpd.service - The Apache HTTP Server\r\nLoaded: loaded (\/usr\/lib\/systemd\/system\/httpd.service; enabled; vendor preset: disabled)\r\nActive: active (running) since Thu 2017-11-23 17:36:36 JST; 7s ago\r\n...\r\n<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001https\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u3066\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\nhttp:\/lab4ict.com\/\r\n<\/pre>\n<h2>PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>Remi's RPM repository\u3088\u308a\u6700\u65b0\u306ePHP 7\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h3>PHP 7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a<\/h3>\n<p>Remi's RPM repository\u3068EPEL\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f7f\u7528\u3057\u3066PHP 7.1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install --enablerepo=remi-safe,remi-php71,epel php php-mbstring php-mcrypt php-mysql php-gd\r\n$ php --version\r\nphp --version\r\nPHP 7.1.12 (cli) (built: Dec 1 2017 13:53:12) ( NTS )\r\nCopyright (c) 1997-2017 The PHP Group\r\nZend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies\r\n<\/pre>\n<p>PHP\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3001PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u51fa\u529b\u3001\u65e5\u672c\u8a9e\u306b\u95a2\u9023\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo cp -p \/etc\/php.ini ~\/php.ini_org\r\n$ sudo vi \/etc\/php.ini\r\nexpose_php = Off\r\ndate.timezone = &quot;Asia\/Tokyo&quot;\r\nmbstring.language = Japanese\r\nmbstring.internal_encoding = UTF-8\r\nmbstring.http_input = pass\r\nmbstring.http_output = pass\r\nmbstring.encoding_translation = Off\r\nmbstring.detect_order = auto\r\nmbstring.substitute_character = none;\r\nmbstring.func_overload = 0\r\nmbstring.strict_detection = Off\r\n<\/pre>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,4,5,6,7]; title: ; notranslate\" title=\"\">\r\n$ cd \/var\/www\/html\r\n$ sudo vi phpcheck.php\r\n&lt;?php phpinfo(); ?&gt;\r\n$ sudo chmod 755 phpcheck.php\r\n$ sudo systemctl stop httpd.service\r\n$ sudo systemctl start httpd.service\r\n$ sudo systemctl status httpd.service\r\n\u25cf httpd.service - The Apache HTTP Server\r\nLoaded: loaded (\/usr\/lib\/systemd\/system\/httpd.service; enabled; vendor preset: disabled)\r\nActive: active (running) since Thu 2017-11-23 17:36:36 JST; 7s ago\r\n...\r\n<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001PHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u60c5\u5831\u306e\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\nhttp:\/\/133.130.127.128\/phpcheck.php\r\n<\/pre>\n<h2>MariaDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>MariaDB\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo yum -y install mariadb mariadb-server\r\n$ mysql --version\r\nmysql Ver 15.1 Distrib 5.5.56-MariaDB, for Linux (x86_64) using readline 5.1\r\n<\/pre>\n<p>MariaDB\u3092\u81ea\u52d5\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl enable mariadb.service\r\n$ sudo systemctl is-enabled mariadb.service\r\nenabled\r\n<\/pre>\n<p>MariaDB\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>$ sudo systemctl start mariadb.service<br \/>\n$ sudo systemctl status mariadb.service<br \/>\n\u25cf mariadb.service - MariaDB database server<br \/>\nLoaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: disabled)<br \/>\nActive: active (running) since Thu 2017-11-23 19:15:41 JST; 6s ago<br \/>\n...<\/p>\n<p>MariaDB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ cd\r\n$ mysql_secure_installation\r\nSet root password? &#x5B;Y\/n] y\r\nNew password:\r\nRe-enter new password:\r\nPassword updated successfully!\r\nReloading privilege tables..\r\n... Success!\r\n\r\nBy default, a MariaDB installation has an anonymous user, allowing anyone\r\nto log into MariaDB without having to have a user account created for\r\nthem. This is intended only for testing, and to make the installation\r\ngo a bit smoother. You should remove them before moving into a\r\nproduction environment.\r\n\r\nRemove anonymous users? &#x5B;Y\/n] y\r\n... Success!\r\n\r\nNormally, root should only be allowed to connect from 'localhost'. This\r\nensures that someone cannot guess at the root password from the network.\r\n\r\nDisallow root login remotely? &#x5B;Y\/n] y\r\n... Success!\r\n\r\nBy default, MariaDB comes with a database named 'test' that anyone can\r\naccess. This is also intended only for testing, and should be removed\r\nbefore moving into a production environment.\r\n\r\nRemove test database and access to it? &#x5B;Y\/n] y\r\n- Dropping test database...\r\n... Success!\r\n- Removing privileges on test database...\r\n... Success!\r\n\r\nReloading the privilege tables will ensure that all changes made so far\r\nwill take effect immediately.\r\n\r\nReload privilege tables now? &#x5B;Y\/n] y\r\n... Success!\r\n\r\nCleaning up...\r\n\r\nAll done! If you've completed all of the above steps, your MariaDB\r\ninstallation should now be secure.\r\n\r\nThanks for using MariaDB!\r\n<\/pre>\n<p>MariaDB\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo cp -p \/etc\/my.cnf.d\/server.cnf ~\/server.cnf_org\r\n$ sudo vi \/etc\/my.cnf.d\/server.cnf\r\n...\r\n&#x5B;mysqld]\r\ncharacter-set-server=utf8\r\n<\/pre>\n<p>MariaDB\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl stop mariadb.service\r\n$ sudo systemctl start mariadb.service\r\n$ sudo systemctl status mariadb.service\r\n\u25cf mariadb.service - MariaDB database server\r\nLoaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: disabled)\r\nActive: active (running) since Thu 2017-11-23 19:15:41 JST; 6s ago\r\n...\r\n<\/pre>\n<p>MariaDB\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3001DB\u306e\u4e00\u89a7\u3068\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u8a2d\u5b9a\u3092\u51fa\u529b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ mysql -u root -p\r\nEnter password:\r\nWelcome to the MariaDB monitor. Commands end with ; or \\g.\r\nYour MariaDB connection id is 10\r\nServer version: 5.5.56-MariaDB MariaDB Server\r\n\r\nCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB &#x5B;(none)]&gt; show databases;\r\n+--------------------+\r\n| Database           |\r\n+--------------------+\r\n| information_schema |\r\n| mysql              |\r\n| performance_schema |\r\n+--------------------+\r\n3 rows in set (0.05 sec)\r\n\r\nMariaDB &#x5B;(none)]&gt; show variables like 'character%';\r\n+--------------------------+----------------------------+\r\n| Variable_name            | Value                      |\r\n+--------------------------+----------------------------+\r\n| character_set_client     | utf8                       |\r\n| character_set_connection | utf8                       |\r\n| character_set_database   | utf8                       |\r\n| character_set_filesystem | binary                     |\r\n| character_set_results    | utf8                       |\r\n| character_set_server     | utf8                       |\r\n| character_set_system     | utf8                       |\r\n| character_sets_dir       | \/usr\/share\/mysql\/charsets\/ |\r\n+--------------------------+----------------------------+\r\n8 rows in set (0.01 sec)\r\n\r\nMariaDB &#x5B;(none)]&gt; exit\r\n\r\nBye\r\n<\/pre>\n<h2>Postfix\u306e\u8a2d\u5b9a<\/h2>\n<p>\u30c9\u30e1\u30a4\u30f3\u540d\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff08admin001@lab4ict.com\u7b49\uff09\u3067\u3001\u30e1\u30fc\u30eb\u306e\u9001\u53d7\u4fe1\u3092\u53ef\u80fd\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002WordPress\u3067\u6307\u5b9a\u3057\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u3082\u53d7\u4fe1\u53ef\u80fd\u306a\u3088\u3046\u306balias\u8a2d\u5b9a\u3082\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u901a\u4fe1\u5236\u5fa1\u306e\u8a2d\u5b9a\u5909\u66f4\u3092\u884c\u3044\u300125\/tcp\u306e\u901a\u4fe1\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ sudo firewall-cmd --add-port=25\/tcp --zone=public --permanent\r\n$ sudo firewall-cmd --reload\r\n$ sudo firewall-cmd --list-all --zone=public | grep tcp\r\nports: 80\/tcp 443\/tcp 25\/tcp\r\n<\/pre>\n<h3>Postfix\u306e\u8a2d\u5b9a<\/h3>\n<p>Gmail\u306b\u30e1\u30fc\u30eb\u9001\u53d7\u4fe1\u3092\u53ef\u80fd\u306b\u3059\u308b\u305f\u3081\u3001Postfix\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<br \/>\n3\u884c\u76ee\uff1a\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u540d<br \/>\n4\u884c\u540d\uff1a\u30c9\u30e1\u30a4\u30f3\u540d<br \/>\n5\u884c\u76ee\uff1a\u30c9\u30e1\u30a4\u30f3\u540d<br \/>\n6\u884c\u76ee\uff1a\u53d7\u4fe1\u3092\u8a31\u53ef\u3059\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9<br \/>\n7\u884c\u76ee\uff1a\u81ea\u30c9\u30e1\u30a4\u30f3\u540d\u306e\u30e1\u30fc\u30eb\u3092\u53d7\u4fe1\u53ef<br \/>\n8\u884c\u76ee\uff1a\u5b58\u5728\u3057\u306a\u3044\u30e6\u30fc\u30b6\u5b9b\u306e\u30e1\u30fc\u30eb\u3092\u53d7\u4fe1\u62d2\u5426<br \/>\n9\u884c\u76ee\uff1a\u30e1\u30fc\u30eb\u306e\u4fdd\u5b58\u5148\u3092Maildir\u306b\u5909\u66f4<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo cp -p \/etc\/postfix\/main.cf ~\/main.cf_org\r\n$ sudo vi \/etc\/postfix\/main.cf\r\nmyhostname = mx.lab4ict.com\r\nmydomain = lab4ict.com\r\nmyorigin = $mydomain\r\ninet_interfaces = all\r\nmydestination = $myhostname, localhost.$mydomain, localhost, $mydomain\r\nlocal_recipient_maps = unix:passwd.byname $alias_maps\r\n<\/pre>\n<p>SASL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo yum install cyrus-sasl-plain cyrus-sasl-md5\r\n<\/pre>\n<p>Postfix\u306bSASL\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/postfix\/main.cf\r\nrelayhost = &#x5B;smtp.gmail.com]:587\r\nsmtp_use_tls = yes\r\nsmtp_tls_CApath = \/etc\/pki\/tls\/certs\/ca-bundle.crt\r\nsmtp_sasl_auth_enable = yes\r\nsmtp_sasl_password_maps = hash:\/etc\/postfix\/sasl_password\r\nsmtp_sasl_tls_security_options = noanonymous\r\nsmtp_sasl_mechanism_filter = plain\r\n<\/pre>\n<p>SMTP\u8a8d\u8a3c\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3,4]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/postfix\/sasl_password\r\n&#x5B;smtp.gmail.com]:587    XXXX@gmail.com:XXXXXXXX\r\n$ sudo chmod 600 \/etc\/postfix\/sasl_password\r\n$ sudo postmap hash:\/etc\/postfix\/sasl_password\r\n<\/pre>\n<p>Posfix\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl stop postfix.service\r\n$ sudo systemctl start postfix.service\r\n$ sudo systemctl status postfix.service\r\n\u25cf postfix.service - Postfix Mail Transport Agent\r\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/postfix.service; enabled; vendor preset: disabled)\r\n   Active: active (running) \r\n...\r\n<\/pre>\n<p>Gmail\u5074\u3067\u300c\u5b89\u5168\u6027\u306e\u4f4e\u3044\u30a2\u30d7\u30ea\u306e\u8a31\u53ef\u300d\u3092\u300c\u6709\u52b9\u300d\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u4ee5\u4e0a\u3067\u3001WordPress\u7528\u30b5\u30fc\u30d0\u306eOS\u3068DB\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u6b21\u306e\u8a18\u4e8b<\/h2>\n<p>\u6b21\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u306b\u304a\u9032\u307f\u304f\u3060\u3055\u3044\u3002<br \/>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/13539\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08CentOS 7\uff09\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/11\/eyecatch_serverapps_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08CentOS 7\uff09<\/div><div class=\"substr\">WordPress\u7528\u306e\u30b5\u30fc\u30d0\u69cb\u7bc9\u306b\u304a\u3044\u3066OS\u3001DB\u7b49\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u8a2d\u5b9a\u7d42\u4e86\u5f8c\u3001WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/13532\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011\u516c\u958b\u7528\u306eWordPress\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\uff01\uff08CentOS 7\uff09\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/11\/eyecatch_serverapps_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011\u516c\u958b\u7528\u306eWordPress\u30b5\u30fc\u30d0\u3092\u69cb\u7bc9\u3059\u308b\uff01\uff08CentOS 7\uff09<\/div><div class=\"substr\">WordPress\u30b5\u30fc\u30d0\u3092\u3001CentOS7\u3067\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u516c\u958b\u7528\u306eWordPress\u30b5\u30fc\u30d0\u3092CentOS 7 + Apache 2.4 + PHP 7.1 + MariaDB 5.5\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u69cb\u7bc9\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d0\u306f\u3001\u8a2d\u5b9a\u3084\u64cd\u4f5c\u306e\u81ea\u7531\u5ea6\u306e\u9ad8\u3044VPS\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002VPS\u306f\u300cConoHa\u300d\u3001DNS\u306f\u300c\u2026<\/p>\n","protected":false},"author":1,"featured_media":14987,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[155],"tags":[544,545,543,52,461,663],"class_list":["post-13535","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-centos","tag-centos-7","tag-wordpress","tag-52","tag-461","tag-663"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=13535"}],"version-history":[{"count":10,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13535\/revisions"}],"predecessor-version":[{"id":15700,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13535\/revisions\/15700"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/14987"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=13535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=13535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=13535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}