{"id":1610,"date":"2022-06-25T19:06:27","date_gmt":"2022-06-25T10:06:27","guid":{"rendered":"https:\/\/jcl.kr:6443\/?p=1610"},"modified":"2022-06-26T11:40:32","modified_gmt":"2022-06-26T02:40:32","slug":"how-to-install-wordpress-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/jcl.kr\/?p=1610","title":{"rendered":"How to install WordPress on Raspberry Pi"},"content":{"rendered":"\n<p>To install WordPress on Raspberry Pi, you need a web server, PHP, and DB.<\/p>\n\n\n\n<p>The web server mainly uses nginx or apache, and I will explain here based on apache.<\/p>\n\n\n\n<p>In the case of DB, mysql or mariadb is usually used, and I will explain it based on mariadb.<\/p>\n\n\n\n<p>Just execute the commands in the order below, and when asked if you want to install in the middle, just type &#8220;y&#8221; and move on.<\/p>\n\n\n\n<p>The apt command below is based on Raspberry Pi or Debbian OS, and if it is not Raspberry Pi, you can use it by changing it to the appropriate yum, rpm, etc. depending on the applicable Linux type.<\/p>\n\n\n\n<p>apache installation$ sudo apt install apache2<\/p>\n\n\n\n<p>install php<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo apt install php7.4<\/p><\/blockquote>\n\n\n\n<p>install mariadb<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo apt install mariadb-server-10.5<\/p><\/blockquote>\n\n\n\n<p>Install a module that makes php use mariadb<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo apt install php-mysql<\/p><\/blockquote>\n\n\n\n<p>latest update<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo apt update<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo apt upgrade<\/p><\/blockquote>\n\n\n\n<p>restart apache<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ sudo service apache2 restart<\/p><\/blockquote>\n\n\n\n<p>Maria DB connection<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ mysql -uroot -p<\/p><\/blockquote>\n\n\n\n<p>then enter the password<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"293\" data-src=\"https:\/\/jcl.kr:6443\/wp-content\/uploads\/2022\/06\/mariadb-1024x293.png\" alt=\"\" class=\"wp-image-1611 lazyload\" data-srcset=\"https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/mariadb-1024x293.png 1024w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/mariadb-300x86.png 300w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/mariadb-768x220.png 768w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/mariadb-600x172.png 600w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/06\/mariadb.png 1126w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/293;\" \/><\/figure>\n\n\n\n<p>Create WordPress DB by running the following command while connected to MariaDB<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>create database wordpress;<\/p><\/blockquote>\n\n\n\n<p>then quit; Enter to exit<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>quit;<\/p><\/blockquote>\n\n\n\n<p>This completes the preliminary preparation for WordPress installation.<\/p>\n\n\n\n<p>After that, you can access WordPress by downloading it.<\/p>\n\n\n\n<p>To download WordPress, move it to the default directory of the web service.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>$ cd \/var\/www\/html\/<\/p><\/blockquote>\n\n\n\n<p>Then, you download the wordpress file, and you download it using a file on the web called wget.<\/p>\n\n\n\n<p>It is installed by default on Raspberry Pi, and if you do not have it, you can download it by running $sudo apt install wget.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/var\/www\/html $ sudo wget http:\/\/wordpress.org\/latest.tar.gz<\/p><\/blockquote>\n\n\n\n<p>If you run it like this, the installation file is first downloaded in a compressed form.<\/p>\n\n\n\n<p>Then unzip it.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/var\/www\/html $ sudo tar xzf latest.tar.gz<\/p><\/blockquote>\n\n\n\n<p>This completes the installation.<\/p>\n\n\n\n<p>However, if you install it like this, the default path becomes \/var\/www\/html\/wordpress.<\/p>\n\n\n\n<p>Then, if you want to access it with a browser, you need to connect with domain address\/wordpress or ip address\/wordpress.<\/p>\n\n\n\n<p>You can use it as is, or if you want to remove wordpress from the address, you can move all files under wordpress under the html directory, which is the upper directory.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/var\/www\/html $ sudo mv wordpress\/* .<\/p><\/blockquote>\n\n\n\n<p>After that, delete the original wordpress directory and compressed files.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/var\/www\/html $ sudo rmdir wordpress<\/p><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/var\/www\/html $ sudo rm latest.tar.gz<\/p><\/blockquote>\n\n\n\n<p>And finally, you can edit the permissions.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\/var\/www\/html $ sudo chown -R www.data: .<\/p><\/blockquote>\n\n\n\n<p>All installations are now complete.<\/p>\n\n\n\n<p>If you access the domain or address in the browser, you can see that the initial WordPress setting screen appears normally.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"674\" data-src=\"https:\/\/jcl.kr:6443\/wp-content\/uploads\/2022\/05\/\uc2a4\ud06c\ub9b0\uc0f7-2022-05-22-\uc624\ud6c4-12.35.55-1024x674.jpg\" alt=\"\" class=\"wp-image-1022 lazyload\" data-srcset=\"https:\/\/jcl.kr\/wp-content\/uploads\/2022\/05\/\uc2a4\ud06c\ub9b0\uc0f7-2022-05-22-\uc624\ud6c4-12.35.55-1024x674.jpg 1024w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/05\/\uc2a4\ud06c\ub9b0\uc0f7-2022-05-22-\uc624\ud6c4-12.35.55-300x197.jpg 300w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/05\/\uc2a4\ud06c\ub9b0\uc0f7-2022-05-22-\uc624\ud6c4-12.35.55-768x505.jpg 768w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/05\/\uc2a4\ud06c\ub9b0\uc0f7-2022-05-22-\uc624\ud6c4-12.35.55-1536x1010.jpg 1536w, https:\/\/jcl.kr\/wp-content\/uploads\/2022\/05\/\uc2a4\ud06c\ub9b0\uc0f7-2022-05-22-\uc624\ud6c4-12.35.55.jpg 1600w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/674;\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>To install WordPress on Raspberry Pi, you need a web server, PHP, and DB. The web server mainly uses nginx or apache, and I will explain here based on apache&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":1022,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[111,112,49,48,113],"class_list":["post-1610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","tag-install","tag-install-wordpress","tag-raspberrypi","tag-wordpress","tag-wordpress-on-raspberrypi"],"_links":{"self":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts\/1610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1610"}],"version-history":[{"count":3,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions"}],"predecessor-version":[{"id":1631,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions\/1631"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=\/wp\/v2\/media\/1022"}],"wp:attachment":[{"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jcl.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}