Site icon Coevolving Innovations

A federated wiki site on cPanel

Since my cPanel shared hosting provider supports node.js hosting, installing a federated wiki site beside the usual Softaculous packages is an option. The app requires node.js, and there is a variety of ways to deploy that.

In 2014, I had installed a federated wiki site on Openshift, but then didn’t maintain it as other priorities surfaced.  The site is now available at http://wiki.coevolving.com, and the prior content has been restored.

The installation isn’t a one-button procedure.  However, an administator comfortable with opening an SSH terminal onto your shared hosting account should be able to follow the steps below.  (If you have problems, the federated wiki community hangs out in a room on matrix.org).

A. Creating a Subdomain

(1) Through your browser, from cPanel … Domains … , create a Subdomain.

B. Installing Federated Wiki

(2) From cPanel … Software … Setup Node.js App.


(3) Open a terminal to your account.  Through a browser you could navigate to cPanel … Advanced … Terminal ; the more technically proficient will already know how to log in via SSH.

(4) Download the current version of the federated wiki code, unzip it, and place it into a directory so that it can be installed with npm.

cd wiki.coevolving.com 
curl -L https://github.com/fedwiki/wiki/archive/master.zip -o wiki-master.zip
ls -lh wiki-master.zip 
unzip -uo wiki-master.zip -d .
ls
cp -rfpv wiki-master/* .

(5) If you had previously backed up a federated wiki, the content could now be restored.  Upload the file, and unpack the archive.

tar -xvpf archive_wiki.tar.gz

(6) Personalizing the federated wiki requires (i) specifying where the data will be stored; (ii) setting up security; and (iii) setting up the site owner name.  For a single (or small number) of users, the friends plugin can invoked with the editing of config.json.

mkdir wiki
cp config.json config-old.json
nano config.json
{
"data": "....",
"security_type": "friends",
"cookieSecret": "some long random string (not this!!!!)",
"session_duration": "14"
}
{
"data": "/home/coXXXXXX/wiki.coevolving.com/wiki",
"security_type": "friends",
"cookieSecret": "my_cookieSecret_of_choice",
"session_duration": "14"
}
cp config.json "$(date '+%Y-%m-%d')_config.json"
cp wiki/status/owner.json /wiki/status/owner-old.json
nano wiki/status/owner.json
{
"name": "Koheni",
"friend": {
"secret": "some long string that you use to reclaim write access"
}
}

… and can be modified to become …

{
"name": "daviding",
"friend": {
"secret": "my_write_access_secret"
}
}
cp wiki/status/owner.json "$(date '+%Y-%m-%d')_owner.json"

(7) For the cPanel Web Application, the Application startup file is presumed to be app.js.  The downloaded package from Github assumed index.js, so let’s give the environment the filename it expects.

ls *.js
mv app.js app_old.js
cp index.js app.js

(8) With the federated wiki files now in the right position, the cPanel instruction to “Enter into the virtual environment” can be carried out.

source /home/coXXXXXX/nodevenv/wiki.coevolving.com/10/bin/activate

(9) Returning to cPanel in the browser, reloading the page should now detected the package.json configuration file, and Run NPM Install button should be available.

C. Claiming the Wiki Site

(10) In your browser, navigate to your wiki page (e.g. wiki.coevolving.com).  At the bottom of the page, if you hover over the padlock, you should see a popup to “Reclaim this Wiki”

Welcome back <<yourname>>. Please enter your reclaim code to reconnect with your wiki.

(11) Your federated wiki should now be available for collecting pages across the federation, and co-editing.

D. Maintaining the Wiki Site

(12) Periodically, it might be prudent to prepare an offline archive of your federated wiki site.  On a terminal, pack a directory into a single file (tar with options -c (create); -v (verbose); -p (preserve-permissions); -z (compress to gzip); -f (filename)).

ls wiki
tar -cvpzf "$(date '+%Y-%m-%d'_wiki).tar.gz" wiki

My federated wiki site is at http://wiki.coevolving.com.

Exit mobile version