{"id":13539,"date":"2023-08-05T13:14:52","date_gmt":"2023-08-05T04:14:52","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=13539"},"modified":"2024-01-03T12:23:06","modified_gmt":"2024-01-03T03:23:06","slug":"13539","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/13539","title":{"rendered":"WordPress\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08CentOS 7\uff09"},"content":{"rendered":"<p>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<br \/>\n<!--more--><\/p>\n<h2>WordPress\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>WordPress\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u5c55\u958b\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u3067\u306f\u3001\u5c55\u958b\u3057\u305fwordpress\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u300csystem\u300d\u306b\u30ea\u30cd\u30fc\u30e0\u3057\u3066\u3044\u307e\u3059\u3002\u30b5\u30a4\u30c8\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4,5,6,7]; title: ; notranslate\" title=\"\">\r\n$ cd \/tmp\r\n$ wget http:\/\/wordpress.org\/latest.tar.gz\r\n$ cd \/var\/www\/html\r\n$ sudo tar -xzvf \/tmp\/latest.tar.gz\r\n$ sudo touch \/var\/www\/html\/wordpress\/.htaccess\r\n$ sudo chown -R apache:apache wordpress\r\n$ sudo mv wordpress system\r\n\r\n<\/pre>\n<p>WordPress\u7528\u306eDB\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4,5]; title: ; notranslate\" title=\"\">\r\n$ mysql -u root -p\r\nCREATE DATABASE db01;\r\nGRANT ALL PRIVILEGES ON db01.* TO &quot;db01admin&quot;@&quot;localhost&quot; IDENTIFIED BY &quot;password&quot;;\r\nFLUSH PRIVILEGES;\r\nEXIT\r\n<\/pre>\n<p>URL\u3092\u8abf\u6574\u3059\u308b\u305f\u3081\u306b\u3001\u5fc5\u8981\u306a\u5834\u5408\u3001httpd.conf\u306bAlias\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\nsudo vi \/etc\/httpd\/conf\/httpd.conf\r\n...\r\nAlias \/system \/var\/www\/html\/system\r\n...\r\n<\/pre>\n<p>Apache\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl stop httpd.service\r\n$ sudo systemctl status 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>WordPress\u306e\u8a2d\u5b9a\u3092\u958b\u59cb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\nhttps:\/\/lab4ict.com\/system\/wp-admin\/install.php\r\n<\/pre>\n<p>\u6700\u521d\u306b\u8a00\u8a9e\uff08\u65e5\u672c\u8a9e\uff09\u3092\u9078\u629e\u3057\u3066\u3001\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u958b\u59cb\u3057\u307e\u3059\u3002DB\u63a5\u7d9a\u60c5\u5831\u3068\u3057\u3066\u3001\u4e8b\u524d\u306b\u6c7a\u3081\u3066\u304a\u3044\u305f\u4ee5\u4e0b\u7b49\u306e\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\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<p>\u30b5\u30a4\u30c8\u306e\u60c5\u5831\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\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<p>\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u3067\u3001WordPress\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<p>\".htaccess\"\u306b\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u305f\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo cat \/var\/www\/html\/system\/.htaccess\r\n\r\n# BEGIN WordPress\r\n&lt;IfModule mod_rewrite.c&gt;\r\nRewriteEngine On\r\nRewriteBase \/system\/\r\nRewriteRule ^index\\.php$ - &#x5B;L]\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\nRewriteCond %{REQUEST_FILENAME} !-d\r\nRewriteRule . \/system\/index.php &#x5B;L]\r\n&lt;\/IfModule&gt;\r\n<\/pre>\n<h2>WordPress\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u306e\u4f5c\u696d<\/h2>\n<p>\u305d\u306e\u4ed6\u3001WordPress\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u76f4\u5f8c\u306b\u3001\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u305d\u3046\u306a\u4f5c\u696d\u3092\u8a18\u8f09\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h3>\u4f5c\u696d\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664<\/h3>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u969b\u306b\u4f7f\u7528\u3057\u305f\u4e0d\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ sudo rm -i \/var\/www\/html\/phpcheck.php\r\n$ sudo rm -i \/tmp\/latest.tar.gz\r\n<\/pre>\n<h3>\u30b5\u30a4\u30c8\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3078\u306e\u30a2\u30af\u30bb\u30b9<\/h3>\n<p>\u30b5\u30a4\u30c8\u306e\u30c8\u30c3\u30d7\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5834\u5408\u306b\u8868\u793a\u3059\u308bHTML\u3092\u914d\u7f6e\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001wordpress\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/var\/www\/html\/index.html\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0;URL=\/system\/&quot;&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n$ sudo chown apache:apache \/var\/www\/html\/index.html\r\n$ sudo ls -l \/var\/www\/html\/index.html\r\n&lt;html&gt;\r\n<\/pre>\n<h3>\u30b5\u30a4\u30c8\u306eURL\u306e\u4fee\u6b63<\/h3>\n<p>\u30b5\u30a4\u30c8\u306eURL\u3092\u3044\u308d\u3044\u308d\u5909\u66f4\u3057\u3066WordPress\u304c\u52d5\u4f5c\u3057\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u306f\u3001DB\u306e\u30c7\u30fc\u30bf\u3092\u76f4\u63a5\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,7,20]; title: ; notranslate\" title=\"\">\r\n$ mysql -u root -p\r\nMariaDB &#x5B;(none)]&gt; use wordpress\r\nReading table information for completion of table and column names\r\nYou can turn off this feature to get a quicker startup with -A\r\n\r\nDatabase changed\r\nMariaDB &#x5B;wordpress]&gt; SELECT * FROM wp_options WHERE option_name IN ('home','siteurl');\r\n+-----------+-------------+--------------------------+----------+\r\n| option_id | option_name | option_value             | autoload |\r\n+-----------+-------------+--------------------------+----------+\r\n| 2         | home        | https:\/\/133.130.127.128\/ | yes      |\r\n| 1         | siteurl     | https:\/\/133.130.127.128\/ | yes      |\r\n+-----------+-------------+--------------------------+----------+\r\n2 rows in set (0.00 sec)\r\n\r\nMariaDB &#x5B;wordpress]&gt; UPDATE wp_options SET option_value = 'http:\/\/133.130.127.128\/system\/' where option_name IN ('home','siteurl');\r\nQuery OK, 2 rows affected (0.30 sec)\r\nRows matched: 2 Changed: 2 Warnings: 0\r\n\r\nMariaDB &#x5B;wordpress]&gt; SELECT * FROM wp_options WHERE option_name IN ('home','siteurl');\r\n+-----------+-------------+---------------------------------+----------+\r\n| option_id | option_name | option_value                    | autoload |\r\n+-----------+-------------+---------------------------------+----------+\r\n| 2         | home        | https:\/\/133.130.127.128\/system\/ | yes      |\r\n| 1         | siteurl     | https:\/\/133.130.127.128\/system\/ | yes      |\r\n+-----------+-------------+---------------------------------+----------+\r\n2 rows in set (0.00 sec)\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u4ee5\u4e0a\u3067\u3001WordPress\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\/13544\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"WordPress\u306e\u30b5\u30fc\u30d0\u306e\u7a3c\u50cd\u76e3\u8996\u3092\u884c\u3046\uff01\uff08CentOS 7\uff0flogwatch\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\u306e\u30b5\u30fc\u30d0\u306e\u7a3c\u50cd\u76e3\u8996\u3092\u884c\u3046\uff01\uff08CentOS 7\uff0flogwatch\uff09<\/div><div class=\"substr\">CentOS 7\u3067\u306f\u3001logwatch\u3092\u4f7f\u7528\u3059\u308b\u3068\u7c21\u5358\u306b\u30b5\u30fc\u30d0\u306e\u76e3\u8996\u3092\u59cb\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002WordPress\u306e\u30b5\u30fc\u30d0\u3092CentOS 7\u3067\u69cb\u7bc9\u3057\u305f\u306e\u3067\u3001logwatch\u3067\u76e3\u8996\u3092\u59cb\u3081\u3066\u307f\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>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<\/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],"class_list":["post-13539","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-centos","tag-centos-7","tag-wordpress","tag-52"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13539","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=13539"}],"version-history":[{"count":8,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13539\/revisions"}],"predecessor-version":[{"id":15701,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13539\/revisions\/15701"}],"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=13539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=13539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=13539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}