Tested on:RPi3; Raspbian Stretch
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)
0

Running a WordPress blog locally on a Raspberry Pi with WP-Duplicator

WordPress can do a lot, but requires attention. For a live blog, it’s best to test larger changes (like a WordPress update) on a local version. That’s quite simple with a Raspberry Pi and the WordPress tool Duplicator, which creates a compressed version of the blog. If the changes were sucessfull locally, they can be applied to the live version. Additionally, browser tests can be applied.
For running the website on a Raspberry Pi, it requires the Apache server, PHP, MySQL, PhpMyAdmin and maybe FTP.

Duplicator installation
Open the browser on the Raspberry Pi, browse to the admin interface of your blog and log in. Go to Plugins and click the Add New button. After entering Duplicator in the search bar, the plugin can be installed for free.

Install Duplicator

Install Duplicator

Create a duplicate
In the WordPress admin menu, choose Duplicator, then Create New. If all Requirements are fulfilled, give the duplicate a name and click Next.

Duplikat erzeugen

create a duplicate

Warnings in regards of database of file sizes can be ignored with caution. Click Build if the scan was successfull. Download the compressed website and the script installer.php onto the Raspberry Pi .

Web directory configuration
Enter in the terminal

with DUPLICATE_PATH as path to the downloaded Duplicator files.

Software installation
Enter in the terminal

Now, browse to localhost/. This should show the Apache default page.
Enter in the terminal

Confirm using apache as server and confirm using dbconfig. Choose testpassword as password.

Activate phpmyadmin
Phpmyadmin must be activated in apache2.conf. Enter in the terminal

and add at the end of the file

Database configuration
The database must be configured in order to be used with Duplicator. Enter in the terminal

Choose Reconfigure Database and unix socket as connection method and root as user name. Again testpassword as password, root as MySQL username and phpmyadmin as MySQL database name. If the ERROR 1045 appears, select ignore.
Enter in the terminal

ein.

Test Phpmyadmin
Browse to

Log in root with password testpassword and ensure that a database named phpmyadmin exists.

RPi with phpmyadmin

RPi with phpmyadmin

Duplicate installation
Browse to localhost/installer.php, accept the terms & notices and click on Next. Here, the database name is phpmyadmin with user root and password testpassword.
Check the connection by hitting Test Database. Click Next if everything was good. The installation takes quite a while!

Duplicator Installer

Duplicator Installer

Acess the blog locally
You can access your blog by entering

in the browser, complete with the admin interface. phpmyadmin for database experimentation is located in

Permalink configuration
To make the blog links work, the permalink settings have to be adjusted. Open in a browser

Choose

Set Permanlinks

Permalinks configuration

Plain as link type and click Save Changes

FTP-server for WordPress updates
For updating WordPress or its plugins locally, its necessary to setup a FTP server. Follow the steps shown in the tutorial FTP Server installation. Then, open wp-config with

and add at the end of the file

Use the server name raspberrypi, user ftpuser and password test as credentials for WordPress updates.

After storing a disk image, you can experiment with your blog without worries.

Links
Duplicator Website: https://snapcreek.com/duplicator
Disk image: http://www.knight-of-pi.org/sdisk-images-for-complex-rapberry-pi-projects/
Tutorial: FTP Server installation: http://www.knight-of-pi.org/ftp-server-proftpd-installation-auf-dem-raspberry-pi/
Selenium browser tests on the Raspberry Pi: http://www.knight-of-pi.org/python3-browser-tests-on-a-raspberry-pi-with-firefox-virtualdisplay-selenium-and-pytest/

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.

Comment

Time limit is exhausted. Please reload CAPTCHA.