WordPress, Nginx, Php, MySQL on a Pi

This site has been running on a Raspberry Pi 1 since 2016. It functioned and did what it was setup up to do, however it was also slow, unresponsive and I wasn’t happy using a dyndns.

This weekend I looked to change all that. The site now runs on a Raspberry Pi 3 instead of the original Pi 1, it uses a Nginx instead of an Apache server and the site now has it’s own domain:

agadez.net

My ageing original Pi has been my workhorse for over 6 years and it has done a great job overall. But my site was always sluggish and seeing the performance difference on the 3rd generation Pi, I knew I would eventually upgrade. Luckily I had a Pi 3 sitting around as I was using it for a previous project running RetroPie.

My old Raspberry Pi 1

Raspberry Pi 1

On the server side of things, my Pi 1 used an Apache server to host the WordPress content I had on the site. Overall it worked, but only just. Trying to change content on the site was near impossible, due to long loading times. Also I had allot of database errors including “Cannot Establish a Connection to the Database” because the site was getting overloaded with traffic (probably like 2 or 3 max people).

Then I discovered Nginx, which came about 10 years after the implementation of Apache which the majority of websites around the world still use today. Apache is lightweight, easy to install and reliable, but I wanted something that was more robust, faster and benefited from load balancing (something that I hope will increase the potential traffic I could take on my server). So this time round I used it and to my delight, the site does seem speedy compared to it on the Pi 1, however it is hard to determine which part of that comes from the Pi 3 rather than purely the Nginx server.

I also decided on a domain to make life easier in the future. In order to get it to work using a dynamic IP address, I installed ddclient which automatically changes the domain IP address to match my external IP address of my home network. This allows for me not to have to buy a static IP address which would be very expensive. By doing it this way, I can do everything I need without hindrance.