Setup WordPress on NAS (and How It Works)

WordPress is the most popular Content Management System on the whole Internet. I got to know it when I was in college, from 2009-2013, when blogging was still popular. Of course, NAS can host a WordPress website too, as Synology provides Web Station to set up a virtual host very conveniently.

When I was setting it up, I followed the Wundertech blog. It was easy to follow, but you can skip Step 2 (setting up DNS record) if you already have a domain name for your NAS. You can create a subdomain for WordPress, and set up CNAME record; or you can register a new top domain name and set up CNAME too.

But when I was following that, I wasn’t really sure what I was doing, or how WordPress works. So I’m going to talk about that mostly here. In that tutorial, Apache, PHP and MariaDB are packages that are needed by WordPress. But why?

How WordPress works with MariaDB, PHP and Apache.

First of all, we need to understand what a web server is and why it is needed. When we visit a website, we (or the browser) send a HTTP request to the web server, and the browser will display and render the HTTP response, including the content of the webpage to us. A web server is essentially the software to answer and process HTTP requests, and send back the HTTP response. Because websites are usually visited by more than one user at the same time, it’s important for it to have the high capacity to handle that.

Apache is a very popular web server. When WordPress is being set up on NAS, we are essentially creating a web server, and that’s why Apache is needed by WordPress.

WordPress is written in a language PHP, which is very popular with dynamic websites, and very functional to interact with MySQL database. To execute PHP, you need PHP interpreter, that’s why you need to install PHP on NAS too. However, different versions of PHP can be very different in terms of security level and performance, the newer the better. WordPress 5.7 needs PHP 7.4 to work.

WordPress stores posts, comments and related data to MySQL database. MariaDB is an open source fork of MySQL. On Synology NAS, MariaDB is in the package center, so it’s easy to install that. WordPress interacts with MariaDB through PHP.

One tool to inspect MySQL database is phpMyAdmin, which is available in Synology package center too.

Now you understand how WordPress works, it’ll be easier to tweak some settings, and also upgrade WordPress on NAS by yourself. As we know, Synology is very slow to update to latest package versions.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

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