Share Your Notes, If You Can

Publish date: 25 Sep, 2019
Tags: story mediawiki docker domain

I used to study Faculty of Informatics of Czech Technical University and a lot of materials I used during studying for exams and tests was placed on web portal called fit-wiki.cz. It is a wiki like website run by students for students. You ask admin to create account for you and through simple verification that you are student you can enter. Then you can leverage years of collected materials, presentations, tasks, links for resources and mainly previous exams. All shared by faculty students. As I moved to Faculty of Science of University of South Bohemia I was looking for similar portal where students share their notes, opinions about subjects and professor. I found none and as I got some materials from my friends who studied here as well I decided to build it myself.

So many wiki softwares

I haven’t realized that wikipedia is run on software that can be run on almost any hosting with PHP and MySQL. I haven’t really looked into it until I browsed fit-wiki and saw link to dokuwiki in the footer. I quickly checked few wiki softwares and was surprised how easy is to setup and manage a custom wiki page. Later on I discovered whole list of wiki software. I started to compare different wikis and thinking which one would suit my needs the best. My requirements were: PHP and MySQL based (because of my web hosting), private mode (only for verified faculty students), syntax highlighting (as code examples can be shared), image and file uploads and of course with active community. I end up with two candidates DokuWiki and MediaWiki both satisfying my requirements. In these situations usually my deciding point is design. So I browsed themes for both wiki softwares and picked one I liked the most. Theme called Medik used on wikiskripta.eu. So MediaWiki it is, let’s get it running!

First I tried the software on local machine. Simple docker-compose with mediawiki and mysql images and we can start discovering the wiki. I set up private wiki, added theme and few extensions and tried to create pages I designed in my head. Everything working as I expected and I can proceed with creating the online wiki. I picked prf-wiki.cz domain name (inspiration from fit-wiki is obvious), bought it and since I wanted to save little bit of money I decided to use my main web hosting for files and set an alias for this domain.

Alias, alias, where are you going to take me?

I naively thought setting up an alias for domain is as simple as adding domain name to desired web hosting. False! I spent whole two days trying and failing. Let me explain. I set up alias. But domain is still empty and browser reporting it can’t find it in through DNS. The alias form on my web hosting administration informs you that actions can take a while but as time passed I figured there is a problem somewhere. I spent few hours trying to set different things in the administration but after my failure I decided to first try one simple html page on the domain. I deleted the alias and upload simple index.html to prf-wiki.cz. Still nothing. Maybe I should start with this simple test because as I’m browsing my domains my eye catches slight anomaly. Why is there prf-jcu.cz listed in my domains? What the sh*t? Oh my god, I bought different domain. “Why does this happen to me? How could I be so stupid?” I’m thinking at the moment. Anyway I can’t return the domain so I bought new one (right name this time) and set up the alias again. And it works right away. So it is as simple as I thought after all.

At the time of waiting for alias to take change (which would never happen) I started installing the wiki itself on my hosting. Set up database, install theme and it works great. I changed layout of theme little bit and I was happy and ready to create the content. Firstly the main page. Simple layout with basic info, rules, subjects and categories. Now is the time to write content to these pages.

Wiki pages creation. What sorcery is this

I took inspiration (a lot of it) from the fit-wiki and I did so also while designing the categories and structure of the wiki. I decided to dedicate namespace to each institute as well as set one for management, help and other categories. I thought that the software is that smart that it identifies namespaces by the pages created. So for example when I create page Help, then Help:Templates and lastly Help:Templates/Article the wiki will know that I meant Help as a namespace and act accordingly. But it doesn’t work like that and you have to specify namespaces in config. Which kind a sucks because you have to edit the code and user can’t do it. Anyway adding namespaces isn’t feature you would use every day. Bigger issue is that once you have created all the pages (as in my example above) and you want to change it to namespace you have to remove the pages (or rename), create the namespace the right way and then restore the content. Uff, that is a little extra work.

Now comes the hard part: fill the wiki with useful content!

Summary

time spent: ~3 days
troubles encountered: 2
things learned: 2