[Keeper] Building a Private Wiki on a Synology NAS: Publishing MediaWiki at wiki.kaylog.io
How I set up MediaWiki on a Synology NAS as a private wiki: fixing the security warning, solving DB Error 1044, and publishing it on my own domain alongside WordPress.

Contents13 items
Introduction: the “where did I write that command down…” problem#
Have you ever had this happen while doing development or setting up your environment on a PC?
“Wait, I’m sure I solved this error before… where did I put the note?”
Yep, this problem had been bugging me for ages. I’d jot notes in Notion, write them in Apple Notes, toss them into my own Slack channel… I was chronically stuck in a state of “lost track of where I wrote it.” Technical tips in particular, like NAS setup steps or my camera RAW workflow, are things I always come back to, yet they were so scattered I couldn’t find them!
So I thought: “Why not just build my own personal wiki?”
Synology NAS comes with a package for installing “MediaWiki,” and you can absolutely publish it on your own domain while running WordPress alongside it. Plus, since I can reach it from outside at https://wiki.kaylog.io, I can look things up quickly even when I’m out. This is a knowledge base that’s entirely my own.
This time, I’ll walk through everything from installing MediaWiki to dealing with the security warning, fixing a DB error, and publishing it on my own domain, including the spots where I actually got stuck. Bookmark it and keep it handy!
Table of contents#
- Install MediaWiki from DSM
- Fully resolve the security warning (editing .htaccess)
- Fix the DB error “Error 1044”
- Settings for publishing at wiki.kaylog.io
- Know the difference between WikiText and Markdown
- Summary
Step 1: Install MediaWiki from DSM#
Let’s start with the basics. Just open Package Center in DSM, search for “MediaWiki,” and install it.
Once installation finishes, you can find MediaWiki as an alias in Web Station. By default, it’s accessible at a URL like http://[NAS IP]/mediawiki/.
At this stage, all that happens is the setup wizard runs, so take your time and work through it.
Step 2: Fully resolve the security warning (editing .htaccess)#
After installing, when I opened the admin screen, this warning appeared:

Warning: Your default directory for uploads,
/volume1/web_packages/mediawiki/images/, is vulnerable to arbitrary script execution.
“Huh, I literally just installed it and there’s already a vulnerability…?”
Once I calmed down and looked into it, the cause was that the .htaccess file in the images/ directory had outdated settings, and the restrictions on running PHP files weren’t strict enough.
How to fix it#
Log in to the NAS via SSH (or use File Station) and edit the following file:
/volume1/web_packages/mediawiki/images/.htaccessBefore (default):
<IfModule headers_module>
Header set X-Content-Type-Options nosniff
</IfModule>
<IfModule php7_module>
php_flag engine off
</IfModule>
<IfModule php_module>
php_flag engine off
</IfModule>
RemoveHandler .php
<FilesMatch "\.ph(p[3457]?s?|tml)$">
SetHandler None
</FilesMatch>After:
<IfModule headers_module>
Header set X-Content-Type-Options nosniff
</IfModule>
<IfModule php7_module>
php_flag engine off
</IfModule>
<IfModule php_module>
php_flag engine off
</IfModule>
RemoveHandler .php .php3 .php4 .php5 .php7 .phtml .pht .phps
<FilesMatch "\.ph(p[3-8]?s?|tml|t)$">
SetHandler None
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
</FilesMatch>
Options -ExecCGIThere are three main changes: I added more extensions to RemoveHandler, extended the FilesMatch pattern to cover the latest PHP versions, and disabled CGI execution entirely with Require all denied and Options -ExecCGI.
Save it and reload the MediaWiki admin screen and… the warning is gone!! Completely solved.
Step 3: Fix the DB error “Error 1044”#
As I went through the setup wizard, it stopped with this error:
Error 1044: Access denied for user 'Kay'@'localhost' to database 'kaylog'
Query: CREATE DATABASE `kaylog` CHARACTER SET utf8“Ah, it’s the no-permission-to-create-a-database thing…”
The cause was that the MySQL user Kay didn’t have permission to create new databases. Synology’s package management automatically creates a MySQL user during installation, but sometimes its permissions are kept to the bare minimum.
The fix: run SQL in phpMyAdmin#
Open “phpMyAdmin” from Package Center in DSM, and run the following in the SQL tab:
CREATE DATABASE `kaylog` CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON `kaylog`.* TO 'Kay'@'localhost';
FLUSH PRIVILEGES;This manually creates the kaylog database and grants the Kay user the permissions it needs.
Then I went back to the MediaWiki setup wizard and ran it again with “Database name: kaylog” and “User: Kay” → installation complete!!
Step 4: Settings for publishing at wiki.kaylog.io#
This is the highlight of this post. I wanted to publish it on a proper custom domain rather than a QuickConnect URL (quickconnect.to/xxxx).
The starting point#
kaylog.io(ports 80/443): WordPress already running- MediaWiki living alongside it as a Web Station alias
I was worried, “Can it really coexist with WordPress?”, but to cut to the chase, it was no problem at all. Web Station can create separate portals with virtual hosts, so as long as the domains differ, there’s no port conflict.
Steps#
1. Create a new portal in Web Station
In Web Station → Web Portal → Create, add wiki.kaylog.io (HTTP 80 / HTTPS 443). Assign “MediaWiki” as the application.
2. Cloudflare DNS settings
Add an A record for wiki. The important part here is to set it to the grey cloud (DNS only)!!
If you set it to the orange cloud (proxied), Cloudflare’s IP is what’s visible when Let’s Encrypt tries to issue the certificate, so domain validation (DV) doesn’t go through to the NAS’s IP.
3. Get a Let’s Encrypt certificate
In DSM → Control Panel → Security → Certificate → Add, get a Let’s Encrypt certificate for wiki.kaylog.io.
4. Edit LocalSettings.php
This is the key to solving the 404!!
Open the following file over SSH:
/volume1/web_packages/mediawiki/LocalSettings.phpChange these two lines:
$wgServer = "https://wiki.kaylog.io";
$wgScriptPath = ""; // ← Make this an empty string!By default it’s $wgScriptPath = "/mediawiki";, and if you leave it as is, you get redirected to https://wiki.kaylog.io/mediawiki/index.php and hit a 404. If you’re running it at the root of your own domain, always make it an empty string.
“I lost 30 minutes before I figured this out…”
5. Assign the certificate
In DSM → Control Panel → Security → Certificate → Settings, assign the certificate you just got to wiki.kaylog.io:80 and wiki.kaylog.io:443.
Now when I go to https://wiki.kaylog.io… no certificate warning, and it displays perfectly!!
Step 5: Know the difference between WikiText and Markdown#
Once the wiki was up, I thought, “Right, let’s copy and paste the notes I’ve been writing in Notion!” and pasted in my Markdown as is… and it fell apart spectacularly.
MediaWiki doesn’t use Markdown; it uses its own syntax called “WikiText.” Here are the main differences:
| Element | Markdown | WikiText |
|---|---|---|
| Heading (large) | ## Heading | == Heading == |
| Heading (small) | ### Heading | === Heading === |
| Bulleted list | - item | * item |
| Numbered list | 1. item | # item |
| Bold | **bold** | '''bold''' |
| Link | [text](URL) | [URL text] |
| Show a URL as plain text | Sometimes auto-linked | <nowiki>URL</nowiki> |
Summary#
- MediaWiki is easy to install from DSM’s Package Center: But you’re almost certain to run into the security warning and the DB error, so use the steps in this post as a reference.
- It can fully coexist with WordPress on the same NAS: With Web Station’s virtual host feature, there’s no port conflict. Zero impact on the existing
kaylog.iotoo. - The key to publishing on your own domain is
$wgScriptPath = "";: If you don’t empty it, you fall into 404 hell. On Cloudflare, use the grey cloud (DNS only) and get Let’s Encrypt through before configuring the rest.
A closing word#
If you own a Synology NAS, you can completely solve the “scattered knowledge” problem.
From here on, I plan to gather not just NAS setup steps but also my camera setup notes, my Lightroom preset management workflow, my gear list and more, all in one place. The feeling of “the NAS becoming my own personal brain” is the best.
If you’re a Synology user with the same struggle, give it a try!!