{"id":1,"date":"2020-04-01T17:24:00","date_gmt":"2020-04-01T16:24:00","guid":{"rendered":"http:\/\/192.168.1.56\/?p=1"},"modified":"2025-10-07T09:11:44","modified_gmt":"2025-10-07T08:11:44","slug":"change-log","status":"publish","type":"post","link":"https:\/\/strover.com\/?p=1","title":{"rendered":"Build Your Own"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">These are the steps to create a WordPress website and webserver on a Raspberry Pi.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Description<\/th><th>Source<\/th><\/tr><\/thead><tbody><tr><td>Format SD card to FAT32<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.sdcard.org\/downloads\/formatter\/\" target=\"_blank\">https:\/\/www.sdcard.org\/downloads\/formatter\/<\/a><\/td><\/tr><tr><td>Install Raspberry Pi Imager for Windows<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.com\/software\/\" data-type=\"URL\" data-id=\"https:\/\/www.raspberrypi.com\/software\/\" target=\"_blank\">https:\/\/www.raspberrypi.com\/software\/<\/a><\/td><\/tr><tr><td>Select OS and SD Card then click \u201cWrite\u201d to copy image to SD card<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.com\/software\/operating-systems\/\" target=\"_blank\">Raspberry Pi installation<\/a><\/td><\/tr><tr><td>Insert the SD card into the Raspberry Pi and power it up; Enter user = \u201cpi\u201d, password (default) = \u201craspberry\u201d<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.com\/documentation\/computers\/using_linux.html\" target=\"_blank\">Raspberry Pi documentation<\/a><\/td><\/tr><tr><td>Change the default password<\/td><td><\/td><\/tr><tr><td>Enable SSH<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Secure_Shell\" target=\"_blank\">https:\/\/en.wikipedia.org\/wiki\/Secure_Shell<\/a><\/td><\/tr><tr><td>Find the IP address on your local network<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.com\/documentation\/computers\/remote-access.html\" data-type=\"URL\" data-id=\"https:\/\/www.raspberrypi.com\/documentation\/computers\/remote-access.html\" target=\"_blank\">Raspberry Pi remote access<\/a><\/td><\/tr><tr><td>Connect to Raspberry Pi from PuTTY<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.putty.org\/\" target=\"_blank\">https:\/\/www.putty.org\/<\/a><\/td><\/tr><tr><td>Create a LAMP server (Linux, Apache, MySQL, PHP\/Perl\/Python)<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/projects.raspberrypi.org\/en\/projects\/lamp-web-server-with-wordpress\/\" target=\"_blank\">LAMP Server<\/a><\/td><\/tr><tr><td>Choose a WordPress theme and create some content<\/td><td><\/td><\/tr><tr><td>Test accessing the website on your local network<\/td><td>http:\/\/192.168.xxx.xxx<\/td><\/tr><tr><td>Set up a fixed IP on your home network; set up port forwarding for Port 80 &amp; 443 on your broadband router.<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/whatismyipaddress.com\/port-forwarding\" target=\"_blank\">Port Forwarding<\/a><\/td><\/tr><tr><td>Set up the DNS entries. This is usually where you purchased your domain name.<\/td><td>Type = A; Name = @; Value = [External IP address]; TTL [Leave blank]<br><br>Type = CNAME; Name = www; Value = strover.com; TTL [Leave blank]<\/td><\/tr><tr><td>Check Port 80 is open; Port 443 cannot be confirmed until SSL is set up later in the process<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/www.yougetsignal.com\/tools\/open-ports\/\" target=\"_blank\">https:\/\/www.yougetsignal.com\/tools\/open-ports\/<\/a><\/td><\/tr><tr><td>[Optional] Request a fixed external IP address from your broadband provider. This avoids having to use a DNS re-direction service. If not, you will need to maintain periodic updates to your external IP address at the domain manager whenever your broadband provider changes your external IP address.<\/td><td><\/td><\/tr><tr><td>Amend Settings\/General in WordPress: WordPress Address (URL) and Site Address (URL) to \u201chttp:\/\/strover.com\u201d<\/td><td>This converts the URL from being identified with 192.168.xxx.xxx to your chosen domain name<\/td><\/tr><tr><td>Use Better Search Replace plugin in WordPress to fix broken links when moving from local IP to strover.com<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\">https:\/\/wordpress.org\/plugins\/better-search-replace\/<\/a><\/td><\/tr><tr><td>Set up SSL Encryption to change the http:\/\/ to https:\/\/<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/pimylifeup.com\/raspberry-pi-ssl-lets-encrypt\/\" target=\"_blank\">https:\/\/pimylifeup.com\/raspberry-pi-ssl-lets-encrypt\/<\/a><\/td><\/tr><tr><td>Amend Settings\/General in WordPress: WordPress Address (URL) and Site Address (URL) to \u201chttps:\/\/strover.com\u201d<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/support\/article\/changing-the-site-url\/\" target=\"_blank\">https:\/\/wordpress.org\/support\/article\/changing-the-site-url\/<\/a><\/td><\/tr><tr><td>Use Better Search Replace plugin in WordPress to fix any broken links<\/td><td><\/td><\/tr><tr><td>Install Akismet Antispam plugin to WordPress<\/td><td><a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/akismet\/\" target=\"_blank\">https:\/\/wordpress.org\/plugins\/akismet\/<\/a><\/td><\/tr><tr><td>Back up the website via SSH connection using PuTTY and create the back up files. <\/td><td>cd \/var\/www<br>sudo tar -cpvzf html-backup-$(date +%F).tar.gz \\<br>&#8211;exclude=&#8217;html\/wp-content\/cache&#8217; \\<br>&#8211;exclude=&#8217;html\/wp-content\/aiowps_backups&#8217; \\<br>&#8211;exclude=&#8217;html\/wp-content\/updraft&#8217; \\<br>html<\/td><\/tr><tr><td>Use FileZilla via SFTP to copy the backup files to your PC. Connect to IP address on port 22; Navigate to \/home\/pi<\/td><td><a href=\"https:\/\/filezilla-project.org\/\">https:\/\/filezilla-project.org\/<\/a><\/td><\/tr><tr><td>Restore the database back up<\/td><td>sudo mysql -u root -p wordpress &lt; wordpress.sql<\/td><\/tr><tr><td>Unzip back up to a new directory<\/td><td>sudo mkdir -p \/var\/www\/html\/restore\/<br>sudo tar -cpvzf html-backup-$(date +%F).tar.gz -C \/var\/www\/html\/restore\/<\/td><\/tr><tr><td>Verify the files in the new directory<\/td><td>ls -l \/var\/www\/html\/restore\/<\/td><\/tr><tr><td>Remove previous files from website back-up process<\/td><td>sudo rm wordpress.sql<br>sudo rm strover.tar.gz<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"useful-linux-commands\">Useful Linux Commands<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Description<\/th><th>Source<\/th><\/tr><\/thead><tbody><tr><td>View file<\/td><td>sudo cat &lt;filename&gt;<\/td><\/tr><tr><td>Edit file (via nano text editor)<\/td><td>sudo apt install nano<br>sudo nano &lt;filename&gt;<\/td><\/tr><tr><td>Update the Raspberry Pi build version<\/td><td>sudo apt-get update<br>sudo apt-get upgrade<br>sudo reboot<\/td><\/tr><tr><td>Always use the halt command before powering down to avoid corrupting the SD card<\/td><td>sudo halt<\/td><\/tr><tr><td>Check and renew the SSL certificate<\/td><td>sudo certbot certificates<br>sudo service apache2 stop<br>sudo certbot renew<br>sudo systemctl reload apache2<br><br>More details:<br><a rel=\"noreferrer noopener\" href=\"https:\/\/upcloud.com\/community\/tutorials\/install-lets-encrypt-apache\/\" target=\"_blank\">https:\/\/upcloud.com\/community\/tutorials\/install-lets-encrypt-apache\/<\/a><\/td><\/tr><tr><td>Confirm php version<\/td><td>php -v<br>sudo update-alternatives &#8211;config php<\/td><\/tr><tr><td>Create info.php for troubleshooting. Remove after using.<\/td><td>&lt;?php phpinfo(); ?&gt;<\/td><\/tr><tr><td>Restart mysql following &#8220;Error establishing a database connection&#8221;<\/td><td>sudo service mysql restart<\/td><\/tr><tr><td>Missing gd library<\/td><td>sudo apt-get install php7.4-gd<\/td><\/tr><tr><td>Inspect directory and sort for largest folders\/subfolders<\/td><td>du -h \/var\/www\/html | sort -hr | head -20<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Software<\/th><th>Linux Command<\/th><th>Version<\/th><\/tr><\/thead><tbody><tr><td>RaspberryPi<\/td><td>cat \/proc\/cpuinfo<\/td><td><a href=\"https:\/\/www.raspberrypi.com\/products\/raspberry-pi-3-model-b\/\">Pi 3 Model B<\/a><\/td><\/tr><tr><td>SD Card<\/td><td>cat \/sys\/block\/mmcblk0\/device\/cid<\/td><td>SanDisk Ultra 32GB microSDXC Class 10, U1, A1<\/td><\/tr><tr><td>Linux<\/td><td>cat \/etc\/os-release<\/td><td>11 (Bullseye)<\/td><\/tr><tr><td>Apache2<\/td><td>apache2 -v<\/td><td>2.4.65 (Raspbian)<\/td><\/tr><tr><td>MariaDB<\/td><td>sudo mariadb &#8211;version<\/td><td>15.1<\/td><\/tr><tr><td>PHP<\/td><td>php &#8211;version<\/td><td>8.4.12<\/td><\/tr><tr><td>WordPress<\/td><td>cd \/var\/www\/html\/<br>grep wp_version wp-includes\/version.php<\/td><td>6.8.3<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Updated Oct 2025<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>These are the steps to create a WordPress website and webserver on a Raspberry Pi. Description Source Format SD card to FAT32 https:\/\/www.sdcard.org\/downloads\/formatter\/ Install Raspberry Pi Imager for Windows https:\/\/www.raspberrypi.com\/software\/ Select OS and SD Card then click \u201cWrite\u201d to copy image to SD card Raspberry Pi installation Insert the SD card into the Raspberry Pi &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/strover.com\/?p=1\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Build Your Own&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[17,16,14,15,13,18,12],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-diywebserver","tag-homewebserver","tag-lampserver","tag-letsencrypt","tag-raspberrypi","tag-raspi","tag-wordpress"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/strover.com\/index.php?rest_route=\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/strover.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/strover.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/strover.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/strover.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":14,"href":"https:\/\/strover.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":938,"href":"https:\/\/strover.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions\/938"}],"wp:attachment":[{"href":"https:\/\/strover.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/strover.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/strover.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}