A Shack Resource – Dissident Pi project: Configuring a Raspberry Pi as a WordPress Server – by Super_neet

I am going to build have built a internal network resource to help me document my shack’s build, configurations and design.

My design parameters are to be independent both hardware and software from the rest of the shack and home network.

There seems to be two web trends about doing this that are 180 degrees in opposition.

One is to put your sites/projects/data onto hosts or into the cloud, where arguably control is shared. You also need to have external internet access and bluntly avoid getting caught up in any sort of deplatforming campaign. Like where would I be if my underground cable was damaged or if my K9ZW call sign was blacklisted as the net crowd decided “K9” was derogatory to dogs?

The other is to use very inexpensive equipment to roll your own, which the preponderance of control is retained.

Be 100% clear that if you attach things to the world wide web, your control at that point onwards is compromised.

A fellow ham sent me links to an interesting self-hosted WordPress project.

As background WordPress is actually two organizations.

The software itself is open source – its is “WordPress” https://infogalactic.com/info/WordPress WordPress Software’s main site is https://wordpress.org/

When hosted it is another organization – it is “WordPress.com” https://infogalactic.com/info/WordPress.com and is owned by Automattic https://infogalactic.com/info/Automattic Hosted version’s main site is: https://wordpress.com/

With Varying Frequency has been hosted by WordPress.com from the onset, for which I am appreciative.

What my buddy sent on was about another use of an instance of WordPress (software) to act much like a BBS of old. The one he suggested is Raspberry Pi based. https://infogalactic.com/info/Raspberry_Pi

[EDIT 19MAR21 – This GAB based series hasn’t been finished, so new posts in a month.  Seems to have gotten lost over security issues that don’t apply to an in-house project, and now GAB wants you to log in to see some of the stuff.  Credit to them for getting me started, shamefully them haven’t followed though presenting a complete project. As I abandoned following super_neet’s instructions when I realized he didn’t have the whole thing figured out, I cannot recommend them.  I used the RaspberryPi.org instructions with a few teaks (see this post’s comments) which has worked out great. ] Here are the links he suggested:
https://gab.com/super_neet/posts/105726279189483773
https://gab.com/super_neet

[EDIT 19MAR21 – The project is built and running on a different Raspberry Pi 4, the one that was DOA was a Raspberry Pi 400 BTW – had a wireless chip failure and CanaKits replaced it very quickly. ]Disclaimer – A Raspberry Pi to build this project was ordered but is was partially DOA and is being replaced but hasn’t arrived. So I haven’t built the project yet.

Here are some other resources on doing the project I found:

[EDIT 19MAR21 – This was an easy to follow resource and in the end it was the main resource I used – I had a couple addressing issues which my notes resolving the glitches are in the comments section of this post – this is the “good stuff” and well presented to boot.  ] At Raspberry Pi main website – https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress
At MUD – https://www.makeuseof.com/tag/host-wordpress-raspberry-pi/
RaspberryPi Tips offers – https://raspberrytips.com/wordpress-on-raspberry-pi/
RaspberryPi 101 suggests – https://raspberrypi101.com/webserver-tutorials/how-to-install-wordpress-on-a-raspberry-pi-4/

My intended use is as a internal-to-the-shack documentation resource, so honestly the WordPress software may not be the right solution.

I am also playing with Wiki.js https://infogalactic.com/info/Wiki.js on another project, which may either supplement or replace WordPress Software.

Storing screenshots and photo, and maybe product manuals might exceed the Raspberry Pi platform. If so then I will switch to other hardware as I bring all teh information together.

73

Steve
K9ZW

Tagged , ,

10 thoughts on “A Shack Resource – Dissident Pi project: Configuring a Raspberry Pi as a WordPress Server – by Super_neet

  1. k9zw says:

    Built using the Raspberry Pi main website – https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress as the main reference.

    Works great but is slow in editing, though you do have to go edit the wp-config.php file to use the Raspberry Pi WordPress server from elsewhere in your home network. I’ll add some information on this in a later comment or edit.

    Thinking the slowness is two fold, first the general slow i/o from the SD card and second that it isn’t very hard to max out the processor despite it having multiple cores.

    The install is putsy and has lots of wait-time as the Pi does its work. I did a decent portion of a jigsaw puzzle family had started while I “watched paint dry” doing the LAMP on Pi installation. So bring a book or have something else to do while it churns away.

    73

    Steve
    K9ZW

  2. k9zw says:

    Some of the modifications to wp-config.php needed to make the project accessible across the home network:

    https://wordpress.stackexchange.com/questions/186272/how-to-deal-with-wordpress-on-localhost

    You can use wp-config.php to change the site url depending on where the site is accesed from, using $_SERVER[‘REMOTE_ADDR’]. Mine has something like this:

    if ($_SERVER[‘REMOTE_ADDR’] == ‘127.0.0.1’ || $_SERVER[‘REMOTE_ADDR’] == ‘::1’) {
    // accesing site from my local server
    define(‘WP_SITEURL’, ‘http://localhost/mysite/’);
    define(‘WP_HOME’, ‘http://localhost/mysite’);
    } else if (strpos($_SERVER[‘REMOTE_ADDR’],’192.168.0.’) !== false) {
    // accesing site from another machine in my home network,
    // all their (internal) network addresses begin with this number;
    // the next line provides the server’s own internal network address
    define(‘WP_SITEURL’, ‘http://192.168.0.192/mysite/’);
    define(‘WP_HOME’, ‘http://192.168.0.192/mysite’);
    } else { //accesing site from outside home
    define(‘WP_SITEURL’, ‘http://89.*.*.*/mysite/’); //replace by your external home IP
    define(‘WP_HOME’, ‘http://89.*.*.*/mysite’);
    }
    //error_log(“Siteurl is “.WP_SITEURL);
    This technique also helps a lot to simplify uploading the site to a production server or keeping in sync local and production versions of the site. (Though, obviously, the wp-config.php on the production server should not have this code.)

    Note: For some reason, I cannot use my external home IP from other machines in my home network; if that’s not your case, you can remove the else if, leaving only the else part.

    AND

    https://wordpress.stackexchange.com/questions/55239/cant-access-wp-site-over-wifi-network

    may be a conflict between the internal option ‘home’ or ‘siteurl’ and the access per pure IP address. WordPress doesn’t use just any server name, there is some redundancy which may get in your way here.

    You can try to resolve that by two constants defined in your wp-config.php:

    define( ‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’] );
    // or
    // define( ‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/wp’ );

    define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] );
    // or
    // define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/wp’ );
    These constants should outdo the options from the database.

    73

    Steve
    K9ZW

  3. k9zw says:

    Note about using an SSD vs the Raspberry Pi SD card:

    Winston KC9FVR benchmarked the difference between a modest SD card and an old school 2-1/2″ SATA SSD bootable drive, and the difference is HUGE! Orders of Magnitude huge!

    Easily beats an old Thinkpad also retrofitted with an SSD drive that he included in our test population.

    Buying an inexpensive 64GB SSD and the requisite SATA to USB cable has run me about $25.00

    There is no point buying a gee-whiz supper SSD or a fancier faster data buss format, as the limiting factor is the USB ports.

    Best $25.00 spent!

    73

    Steve
    K9ZW

    • dkozinn says:

      Hi Steve,
      Can you share the details on the SSD & the adapter you used? I’ve got a Pi running a few things and this sounds like a great solution for some I/O related issues I’ve had.

      73,
      David, K2DBK

      • k9zw says:

        This is what I bought. Remember the adapter is not Trim enabled.

        SSD SATA 2.5″ 64GB Shark Internal Solid State Drive High Performance Hard Drive for Desktop Laptop SATA III 6Gb/s Includes SSD 60GB 64GB 120GB 128GB 240GB 250GB 480GB 500GB 960GB (64GB, 2.5”-SATA3)
        by Three color dogfish Technology Co., Ltd.

        LINK: https://www.amazon.com/dp/B07JNNDW1Q/

        USB 3.0 to SATA III Adapter Cable with UASP SATA to USB Converter for 2.5″ Hard Drives Disk HDD and Solid State Drives SSD
        by EYOOLD

        LINK: https://www.amazon.com/dp/B073SXTY64/

        73

        Steve
        K9ZW

  4. k9zw says:

    Another much faster storage is an SSD-based USB drive.

    Much of the USB drives we use are pretty slow on I/O and cleanup.

    A handful are actually SSD drives with adapters in a thumb drive physical format.

    Just tested this one, and it is 95% the speed of the larger SSD drive and adapter, while in a pocket sized form factor.

    SanDisk 256GB Extreme PRO USB 3.2 Solid State Flash Drive – SDCZ880-256G-GAM46
    by Amazon.com

    LINK: https://www.amazon.com/dp/B08GY3Z4JR/

    73

    Steve
    K9ZW

    • dkozinn says:

      A bit more expensive but I’d assume that Trim would work since it’s built as a standalone drive.

      73,
      David, K2DBK

      • k9zw says:

        I think the 4x size differential distorts the pricing. If the setup I am using (separate SSD drive and adapter) were scaled up to the same 256GB there wouldn’t be much between the options in cost.

        73

        Steve
        K9ZW

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: