~

SITE TECHNICAL DETAILS
This page describes the full technical details for building and maintaining this site
site, CSS, PHP, web, design, meta
2025-03-18 - in progress
 

HOSTING


Koenrane.xyz is served by Digital Ocean through a Droplet VM, which is a Linux-based virtual machine. Previously, the site was self-hosted on a local Synology NAS and used Netlify to deploy the website. But, this project was shut down some years ago and sat in Limbo for longer than I anticipated. After much research looking for the cheapest lightweight option, running a droplet VM was suggested to me. Especially for a PmWiki site, the architecture and storage seemed to fit the needs appropriately. I chose a basic droplet vm, with 1 GB of memory, 1vCPU, 1,000 GB transfer speed, and 25 GB SSD which costs $0.00893/hr or about $6.00 per month. I compared the cost to other cloud services for a similar setup: GCP--$6.88, Azure--$7.58, and AWS--$8.47. It would have been just as easy to pick the others, but I went with the lowest cost option, then if needed, I could scale up as the site expands. A feature that sold me early on was the ability to vertically scale Disk, CPU, and RAM. So, I felt ok about starting small. Each droplet gets an outbound data transfer starting at 500GB/month. I chose to run a Ubuntu distribution (24.10 x64) that runs nginx 1.26.0 to serve the site. PmWiki is a PHP-based site, so it seemed like an easy implementation and I also wanted something a bit lighter than Apache.

 

PMWIKI SETUP


PmWiki was relatively easy to set up on the droplet. Their installation resource was clear and detailed, especially for someone brand new to this wiki platform. After a recommendation to use this type of site, I was further drawn in by the ability of the platform to allow admins to quickly change the appearance and functions of the site. Initially, I didn't want to suffer from technocrastination, I wanted to get something that helped me focus on the writing. From my experience with Wikipedia, I was concerned with outside users editing my pages, but there is an access control feature in PmWiki to password-protect the entire site, which is completely self-contained. Additionally, after some research before installation, I found that this wiki platform offered a great amount of plugins and community-built recipes to add new features to your site.

After the droplet was initialized, I created SSH keys in the server management GUI so that I could remote into the server from my local bash shell. Next I created a server block for port 80 and enabled the site in nginx.

 
ssh root@your_droplet_ip

Then, updated system packages

 
sudo apt update && sudo apt upgrade -y

Next, I installed the nginx web server and PHP plus its extensions

 
sudo apt install nginx -y
sudo systemctl enable nginx

Then, I had to configure nginx by creating a server block and add the file to the directory

 
sudo nano /etc/nginx/sites-available/pmwiki

server {
	listen 80;
	koenrane koenrane.xyz;
	root /var/www/pmwiki;
	index index.php;

	location / {
		try_files $uri $uri/ /index.php?$args;
	}

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
	}
}

Time to enable the site:

 
sudo ln -s /etc/nginx/sites-available/pmwiki /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

The following steps involved installing PmWiki. After installation, I created the web directory, downloaded and extracted the .zip file, then set permissions:

Create the web directory

 
sudo mkdir -p /var/www/pmwiki
cd /var/www/pmwiki

Download and extract PmWiki

 
sudo wget https://www.pmwiki.org/pub/pmwiki/pmwiki-latest.zip
sudo unzip pmwiki-latest.zip
sudo rm pmwiki-latest.zip

Set permissions

 
sudo chown -R www-data:www-data /var/www/pmwiki
sudo chmod -R 755 /var/www/pmwiki

Now that Pmwiki is installed, I need to create a symbolic link to the site-enabled directory:

 
ln -s /etc/nginx/sites-available/pmwiki80.conf /etc/nginx/sites-enabled/

Pmwiki needs write access into the wiki.d directory:

 
cd /var/www/html/pmwiki
mkdir wiki.d
chown www-data:www-data wiki.d

Since there was no index.php file by default, it had to be created

 
echo "<?php include_once('pmwiki.php');" > /var/www/html/pmwiki/index.php

After verifying installation, I checked to site by navigating to the http url, which showed the Pmwiki home page. Then, I copied the sample config.php file from /var/www/html/pmwiki, and added the following:

 
$WikiTitle = 'Pmwiki'; to $WikiTitle = 'KoenRane';
$ScriptUrl = 'http://koenrane.xyz/pmwiki/pmwiki.php';
$PubDirUrl = 'http://koenrane.xyz/pmwiki/pub';
$PageLogoUrl = "$PubDirUrl/skins/pmwiki/pmwiki-32.gif";
$DefaultPasswords['admin'] = pmcrypt('XXXXX'); to $DefaultPasswords['admin'] = pmcrypt('XXXXXX');
$EnableIMSCaching = 1;.

Next, I had to create a new config file for HTTPS in nginx:

 
server {
	listen 443;
	listen [::]:443;
	server_name 192.168.2.28;
	root /var/www/html/pmwiki;
	index index.php;

	location ~ \.php$ {
		fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_param SCRIPT_NAME $fastcgi_script_name;

	}

	ssl on;
	ssl_certificate /path/to/your/cert.pem;
	ssl_certificate_key /path/to/your/key.pem;
}

Then I enabled it and reloaded the ngninx service to apply the changes

 
ln -s /etc/nginx/sites-available/pmwiki443.conf /etc/nginx/sites-enabled/
systemctl reload nginx.service

Last, I needed to make sure to check and change URL schemas from HTTP to HTTPS values in config.php. The site was enabled and everything seemed to be working properly. The default pmwiki-responsive skin loaded as well and looked to be functioning normally.

...

 

CODE


koenrane.xyz - GitHub

 
𖤓