{"id":4070,"date":"2020-12-20T00:52:20","date_gmt":"2020-12-19T15:52:20","guid":{"rendered":"https:\/\/okamurax.com\/?p=4070"},"modified":"2021-11-02T15:41:52","modified_gmt":"2021-11-02T06:41:52","slug":"centosconoha-%e5%88%9d%e6%9c%9f%e8%a8%ad%e5%ae%9a-2","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=4070","title":{"rendered":"CentOS(ConoHa) \u521d\u671f\u8a2d\u5b9a LAMP"},"content":{"rendered":"<p>\u4e45\u3057\u3076\u308a\u306bConoHa\u306b\u3066CentOS\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3002<\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb<\/h2>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u6642\u3001SSH Key\u3060\u3051\u4f5c\u6210\u3057\u3001\u305d\u306e\u4ed6\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u307e\u307e\u3002<\/p>\n<p>\u5de6\u5074\u30e1\u30cb\u30e5\u30fc\u306e\u30b5\u30fc\u30d0\u30fc\uff1e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30cd\u30fc\u30e0\u30bf\u30b0<br \/>\n\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u8a73\u7d30\u304c\u898b\u308c\u308b\u306e\u3067\u3001IP\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n<p>\u516c\u958b\u9375\u3067\u3001TeraTerm\u3068WinSCP\u3067\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"0kjncT5bgo\"><p><a href=\"https:\/\/appbay.org\/?p=525\">Ubuntu \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u95a2\u9023\u8a2d\u5b9a<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Ubuntu \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u95a2\u9023\u8a2d\u5b9a&#8221; &#8212; \u30c6\u30c3\u30af\u30e1\u30e2\" src=\"https:\/\/appbay.org\/?p=525&#038;embed=true#?secret=F4y7LChHf9#?secret=0kjncT5bgo\" data-secret=\"0kjncT5bgo\" width=\"525\" height=\"296\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h2>Apache<\/h2>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b<br \/>\n<span style=\"color: #0000ff;\">yum list installed | grep httpd<\/span><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n<span style=\"color: #0000ff;\">yum -y install httpd<\/span><\/p>\n<p>\u72b6\u614b<br \/>\n<span style=\"color: #0000ff;\">service httpd status<\/span><\/p>\n<p>\u8d77\u52d5\uff08\u521d\u671f\u8a2d\u5b9a\u3067\u306f\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3057\u306a\u3044\uff09<br \/>\n<span style=\"color: #0000ff;\">service httpd start<br \/>\nOR<br \/>\nsystemctl start httpd<\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span style=\"color: #333333;\">\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u8a2d\u5b9a<\/span><br \/>\n<\/span><span style=\"color: #0000ff;\">systemctl enable httpd<\/span><\/p>\n<p>\u30d1\u30b9<br \/>\n<span style=\"color: #0000ff;\">\/var\/www\/html<\/span><br \/>\n<span style=\"color: #0000ff;\">\/etc\/httpd\/conf\/httpd.conf<\/span><\/p>\n<p>\u30d5\u30a1\u30a4\u30a2\u30fc\u30a6\u30a9\u30fc\u30eb\u8a2d\u5b9a<br \/>\n<span style=\"color: #0000ff;\">firewall-cmd &#8211;add-service=http &#8211;permanent <\/span><br \/>\n<span style=\"color: #0000ff;\">firewall-cmd &#8211;reload<\/span><\/p>\n<h2>PHP<\/h2>\n<p>\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>\u4f55\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u5834\u5408\u3002<br \/>\nyum list installed | grep php<\/p>\n<p>PHP\u95a2\u9023\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u3002<br \/>\nyum remove php-*<\/p>\n<p>\u500b\u5225\u3067\u4f55\u304c\u5165\u308b\u304b\u3002<\/p>\n<p>yum -y install php<br \/>\nphp.x86_64<br \/>\nphp-cli.x86_64<br \/>\nphp-common.x86_64<br \/>\nphp-fpm.x86_64<\/p>\n<p>yum -y install php-devel<br \/>\nphp-devel.x86_64<\/p>\n<p>yum -y install php-pdo<br \/>\nphp-pdo.x86_64<\/p>\n<p>yum -y install php-gd<br \/>\nphp-gd.x86_64<\/p>\n<p>yum -y install php-mbstring<br \/>\nphp-mbstring.x86_64<\/p>\n<p>yum -y install php-mysqlnd<br \/>\nphp-mysqlnd.x86_64<\/p>\n<p>yum install php-json<br \/>\nphp-json.x86_64<\/p>\n<p>\u5b9f\u969b\u306f\u3001<br \/>\nyum -y install php php-devel php-pdo php-gd php-mbstring php-mysqlnd<br \/>\n\u306e\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>\u5fc5\u8981\u306a\u5834\u5408\u4e0b\u8a18\u7b49\u3082\u8ffd\u52a0\u3002<br \/>\nphp-xml.x86_64<br \/>\nphp-xmlrpc.x86_64<br \/>\nphp-pecl-mcrypt.x86_64<br \/>\nphp-pecl-mysql.x86_64<\/p>\n<p>\u30fbApache\u306e\u518d\u8d77\u52d5<\/p>\n<p>systemctl restart httpd<\/p>\n<h2>MySQL<\/h2>\n<p>\u30fbMariaDB\u306e\u524a\u9664<br \/>\n<span style=\"color: #0000ff;\">sudo yum remove mariadb-libs<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo rm -rf \/var\/lib\/mysql<\/span><\/p>\n<p>\u30fb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u8ffd\u52a0<br \/>\n<span style=\"color: #0000ff;\">sudo rpm -ivh http:\/\/dev.mysql.com\/get\/mysql57-community-release-el7-8.noarch.rpm<\/span><\/p>\n<p>\u30fbMySQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n<span style=\"color: #0000ff;\">sudo yum install mysql-community-server<\/span><\/p>\n<p>\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d<br \/>\n<span style=\"color: #0000ff;\">mysqld &#8211;version<\/span><\/p>\n<p>\u30fb\u8d77\u52d5<br \/>\n<span style=\"color: #0000ff;\">sudo systemctl start mysqld.service<\/span><\/p>\n<p>\u30fb\u81ea\u52d5\u8d77\u52d5<br \/>\n<span style=\"color: #0000ff;\">sudo systemctl enable mysqld.service<\/span><\/p>\n<p>\u30fbroot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u8a2d\u5b9a<\/p>\n<p>pass=$(head \/dev\/urandom | tr -dc a-km-np-z2-9 | head -c 13); sudo mysql -u root -e &#8220;alter user root@localhost identified by &#8216;${pass}'&#8221;; echo $pass;<\/p>\n<p>\u30fb\u6587\u5b57\u30b3\u30fc\u30c9\u5909\u66f4<\/p>\n<p><span style=\"color: #0000ff;\">\/etc\/my.cnf<\/span><br \/>\n\u306e\u4e2d\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3002<\/p>\n<p><span style=\"color: #0000ff;\">[mysqld]<\/span><br \/>\n<span style=\"color: #0000ff;\">character-set-server = utf8<\/span><br \/>\n<span style=\"color: #0000ff;\">default_password_lifetime = 0<\/span><\/p>\n<p>\u518d\u8d77\u52d5<br \/>\n<span style=\"color: #0000ff;\">sudo systemctl restart mysqld.service<\/span><\/p>\n<p>\u30fbMySQL Workbench<\/p>\n<p>\u57fa\u672c\u7684\u306b\u64cd\u4f5c\u306fWorkbench\u304b\u3089\u3002<\/p>\n<p>\u4eca\u56de\u306f\u5916\u90e8\u306b\u30dd\u30fc\u30c8\u958b\u3051\u3066\u3044\u306a\u3044\u306e\u3067\u3001SSH\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u63a5\u7d9a\u3002<\/p>\n<p>\u30fbConnection Method\uff1aStandard TCP\/IP over SSH<br \/>\n\u30fbSSH Hostname\uff1a\u30b5\u30fc\u30d0\u30fcIP\u30a2\u30c9\u30ec\u30b9<br \/>\n\u30fbSSH User\uff1aroot<br \/>\n\u30fbSSH Key File\uff1a\u9375\u30d5\u30a1\u30a4\u30eb<br \/>\n\u30fbMySQL Hostname\uff1a127.0.0.1<br \/>\n\u30fbMySQL Server Port\uff1a3306<br \/>\n\u30fbUsername\uff1aroot<br \/>\n\u30fbPassword\uff1aMySQL\u306eroot\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3002<\/p>\n<h2>WordPress<\/h2>\n<p><span style=\"color: #0000ff;\">cd\u00a0\/var\/www\/html<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo curl -LO http:\/\/ja.wordpress.org\/latest-ja.tar.gz<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo tar xzf latest-ja.tar.gz<br \/>\nsudo mv wordpress blog<br \/>\ncd blog<br \/>\nsudo cp wp-config-sample.php wp-config.php<br \/>\nsudo vim wp-config.php<br \/>\n<\/span><\/p>\n<p>\u4ee5\u4e0b\u3092\u8a2d\u5b9a<\/p>\n<p><span style=\"color: #0000ff;\">define(&#8216;DB_NAME&#8217;, &#8216;wpd&#8217;);<\/span><br \/>\n<span style=\"color: #0000ff;\">define(&#8216;DB_USER&#8217;, &#8216;wpd_user&#8217;);<\/span><br \/>\n<span style=\"color: #0000ff;\">define(&#8216;DB_PASSWORD&#8217;, &#8216;+6xya6=)RKn2+6xya6=)RKn2&#8217;);<\/span><\/p>\n<p>apache\u7528<\/p>\n<p><span style=\"color: #0000ff;\">sudo chown -R apache:apache \/var\/www\/html\/blog<\/span><\/p>\n<p>\u6700\u7d42\u51e6\u7406<\/p>\n<p><span style=\"color: #0000ff;\">http:\/\/192.168.102.6\/blog\/wp-admin\/install.php<\/span><br \/>\n\u306b\u30a2\u30af\u30bb\u30b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e45\u3057\u3076\u308a\u306bConoHa\u306b\u3066CentOS\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3002 \u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u6642\u3001SSH Key\u3060\u3051\u4f5c\u6210\u3057\u3001\u305d\u306e\u4ed6\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u307e\u307e\u3002 \u5de6\u5074\u30e1\u30cb\u30e5\u30fc\u306e\u30b5\u30fc\u30d0\u30fc\uff1e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30cd\u30fc\u30e0\u30bf\u30b0 \u30af\u30ea\u30c3\u30af\u3059\u308b\u3068 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=4070\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;CentOS(ConoHa) \u521d\u671f\u8a2d\u5b9a LAMP&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[145],"class_list":["post-4070","post","type-post","status-publish","format-standard","hentry","category-1","tag-linux"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/4070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4070"}],"version-history":[{"count":14,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/4070\/revisions"}],"predecessor-version":[{"id":4601,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/4070\/revisions\/4601"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}