This is an old revision of the document!
Setting up this Wiki
Intro
I'm self-hosted, and I want to run a wiki (this) behind a proxy. My front-end is NGINX while the page you are reading is Apache.
From 30,000 feet.
- NGINX front-end, but when someone passes “mikelivolsi.com/wiki”, the “/wiki” will pass traffic to the back-end server running the wiki.
- The back-end server is running Apache2
- The document home for the wiki is /var/www/wiki
Prerequisites
- Unix firewall (UFW) - or equivalent - should be running and only allow traffic from the front-end nginx site
- You will need to install the proper php libraries (running php 8.4)
- Don't follow verbatim ChatGPT or Gemini, as they will make you nuts if you listen to them.
Step 1: sudo to root Step 2: cd /var/www and make the directory wiki Step 3: cd wiki Step 4: get the latest copy: curl -o doku.tgz https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz Step 5: Extract the wiki: tar -xzvf doku.tgz Step 6: Rename the resulting directory: mv dokuwiki-2025-05-14b dokuwiki Step 7: change ownership to www-data:www-data for everything under /var/www/wiki Step 8: cd /etc/apache2/sites-available Step 9: Create a file called wiki.conf and make sure it looks similar to the following:
<VirtualHost *:8009>
ServerAdmin webmaster@localhost
ServerName wiki.mikelivolsi.com
DocumentRoot /var/www/wiki/dokuwiki
DirectoryIndex doku.php index.php
<Directory /var/www/wiki/dokuwiki/>
Options Indexes FollowSymLinks MultiViews
Require all granted
AllowOverride All
DirectoryIndex doku.php index.php
</Directory>
<IfModule mod_dav.c>
Dav off
</IfModule>
ScriptAlias /cgi-bin/ /var/www/wiki/cgi-bin/
<Directory “/var/www/wiki/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
AddHandler cgi-script .cgi .pl .py
</Directory>
ErrorLog ${APACHE_LOG_DIR}/wiki_error.log
CustomLog ${APACHE_LOG_DIR}/wiki_access.log combined
</VirtualHost>
