Coevolving Innovations

… in Business Organizations and Information Technologies

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.

  • As an example, I can create a Subdomain wiki in the Domain coevolving.com, that will actually be stored in my Home (Document Root) as a wiki.coevolving.com directory.

Subdomain_CreateASubdomain

B. Installing Federated Wiki

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

  • In the Web Applications list, Create Application.  As an example, set:
      • Node.js version: 10.11.0
      • Application mode: Production
      • Application root: wiki.coevolving.com
      • Application URL: wiki.coevolving.com
      • Application startup: app.js
  • (If you leave the Application startup field blank, app.js automatically fills in as the default)

NodeJs_CreateApplication

  • At this point, the node.js environment is not yet activated, as the package.json has not yet been downloaded, and the Run NPM Install button is greyed out.

WebApplications_EnterToTheVirtualEnvironment
(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.

cPanel_Advanced_Terminal

(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.

  • Change into the directory.  Transfer the current version of the fedwiki repository from the Github site to your host (curl option-L will redo the request if the location has changed; -o specifies the output file name).
cd wiki.coevolving.com 
curl -L https://github.com/fedwiki/wiki/archive/master.zip -o wiki-master.zip
  • List the file to ensure it’s downloaded (ls -lh gives a long, human-readable list).  Unzip it into a directory (unzip options -uo extracts newer versions of files already in the current directory and creates any files not already there; -d . specifies the target directory as the current directory) .
ls -lh wiki-master.zip 
unzip -uo wiki-master.zip -d .
  • List the directory to ensure that the wiki-master directory was created properly (and the package.json is in place).  Copy the contents from that now-unpacked directory up one level into the current direction (cp  -r recurses directories, -f forces overwrites; -p preserves datestamps; -v gives verbose information;).
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
  • … with  tar options -x (extract); -v (verbose); -p, (preserve-permissions) ; -f  (file-archive).

(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.

  • If a directory where the content will be stored hasn’t already been defined, create one, e.g. wiki.
mkdir wiki
  • Configure to use friends security, by editing a sample config.json …
cp config.json config-old.json
nano config.json
  • … with an initial config.json template that looks like …
{
"data": "....",
"security_type": "friends",
"cookieSecret": "some long random string (not this!!!!)",
"session_duration": "14"
}
  • … and can be modified to become …
{
"data": "/home/coXXXXXX/wiki.coevolving.com/wiki",
"security_type": "friends",
"cookieSecret": "my_cookieSecret_of_choice",
"session_duration": "14"
}
  • As a precaution, make a backup the new config.json:
cp config.json "$(date '+%Y-%m-%d')_config.json"
  • Configure the site with your own user name, by editing a sample owner.json
cp wiki/status/owner.json /wiki/status/owner-old.json
nano wiki/status/owner.json
  • … with an initial owner.json template that looks like …
{
"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"
}
}
  • As another precaution, backup the new owner.json
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
  • The source command is added to the command specified on the cPanel page, otherwise you’ll get the message “‘activate’ script should be sourced, not run directly”.

(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.

Run NPM Install button is available

  • Select the Run NPM Install button.  (Running npm install from the terminal doesn’t seem to give the same results, as loading the Welcome Visitors page in a browser will not be properly formatted).

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”

Reclaim this Wiki

  • Selecting the padlock should surface a panel, saying:

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

  • With the “secret” you had entered in owner.json, the padlock icon should show as open.

(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
  • Download a copy of that tar.gz file to your computer for safekeeping.  That backed up wiki directory will include the owner.json.
  • Download a copy of config.json.

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

4 Comments

  • Interesting! Coincidentally, I’m currently setting up a personal wiki on my server that also is taking quite a bit of configuration to setup. Obviously the intent is very different since it’s completely private, but I’ll probably write a post about that soon.

  • Most of the directions for installing the software are applicable to updating to newer releases. To generalize the commands, I’ve changed …

    mv -v wiki-master/* .

    … to …

    cp -rfpv wiki-master/* .

    … so that some directories over properly overwritten.

  • Hi David!
    Thanks for the write up learned a lot even though I am not using CPanel.


Leave a Reply

Your email address will not be published. Required fields are marked *

  • RSS qoto.org/@daviding (Mastodon)

    • daviding: Very long article, o September 4, 2020
      Very long article, oriented towards policy change. Issues should be familiar to everyone on this platform (and appreciation of that is probably why you are here). #CoryDoctorow on Surveillance Capitalism https://onezero.medium.com/how-to-destroy-surveillance-capitalism-8135e6744d59
    • daviding: A small wording shif July 27, 2020
      A small wording shift, yet I really like the idea on belonging rather than just including. https://www.theglobeandmail.com/business/commentary/article-want-a-more-diverse-work-force-move-beyond-inclusion-to-belonging/
    • daviding: On the post-pandemic July 18, 2020
      On the post-pandemic world, #MargaretAtwood says: > "this is like being in 1952, except with birth control and the internet".https://www.thestar.com/entertainment/books/opinion/2020/07/17/margaret-atwood-on-post-covid-hopes-plus-baking.html
    • daviding: Instead of using a t July 4, 2020
      Instead of using a text editor or Notepad on my computer for everyday work, I now use #Zettlr as a persistent scratchpad, a new page each day. The feature of creating #Markdown often helps in copy-and-paste to other applications. I haven&apos;t exercised #Zotero citations, yet, but probably will, shortly. > Roam let’s you manage knowledge, […]
    • daviding: The #GlobeAndMail ed June 29, 2020
      The #GlobeAndMail editorial declares that the brain drain of 15,000 Canadians to the United States between years 2000-2010 could be reversed, with corporations near-shoring northwards. > Canada already exerts a powerful pull on people from the rest of the world. A global Gallup survey, conducted from 2015 through 2017, shows Canada is one of the most […]
  • RSS on IngBrief

    • 1969, 1981 Emery, System Thinking: Selected Readings
      Social Systems Science graduate students in 1970s-1980s with #RussellAckoff, #EricTrist + #HasanOzbehkhan at U. Pennsylvania Wharton School were assigned the Penguin paperback #SystemsThinking reader edited by #FredEEmery, with updated editions evolving contents.
    • 1968 Buckley, “Modern Systems Research for the Behavioral Scientist: A Sourcebook”
      Resurfacing 1968 Buckley, “Modern Systems Research for the Behavioral Scientist: A Sourcebook” for interests in #SystemsThinking #SocioCybernetics #GeneralSystemsTheory #OrganizationScience . Republication in 2017 hardcopy may be more complete.
    • Wholism, reductionism (Francois, 2004)
      Proponents of #SystemsThinking often espouse holism to counter over-emphasis on reductionism. Reading some definitions from an encyclopedia positions one in the context of the other (François 2004).
    • It matters (word use)
      Saying “it doesn’t matter” or “it matters” is a common expression in everyday English. For scholarly work, I want to “keep using that word“, while ensuring it means what I want it to mean. The Oxford English Dictionary (third edition, March 2001) has three entries for “matter”. The first two entries for a noun. The […]
    • Systemic Change, Systematic Change, Systems Change (Reynolds, 2011)
      It's been challenging to find sources that specifically define two-word phrases -- i.e. "systemic change", "systematic change", "systems change" -- as opposed to loosely inferring reductively from one-word definitions in recombination. MartinReynolds @OpenUniversity clarifies uses of the phrases, with a critical eye into motives for choosing a specific label, as well as associated risks and […]
    • Environmental c.f. ecological (Francois, 2004; Allen, Giampietro Little 2003)
      The term "environmental" can be mixed up with "ecological", when the meanings are different. We can look at the encyclopedia definitions (François 2004), and then compare the two in terms of applied science (i.e. engineering with (#TimothyFHAllen @MarioGiampietro and #AmandaMLittle, 2003).
  • Recent Posts

  • Archives

  • RSS on daviding.com

    • 2020/08 August 2020
      Moderate summer temperatures in a city normally overheated with activity, residents gradually emerging as public venues opened cautiously.
    • 2020/07 Moments July 2020
      Daytimes full of new work assignment and training, evenings and weekends bicycling around downtown Toronto as it slowly reopens from pandemic.
    • 2020/06 Moments June 2020
      Most of month in Covid-19 shutdown Phase 1, so every photograph is an exterior shot. Bicycling around downtown Toronto, often exercising after sunset.
    • 2020/05 Moments May 2020
      Life at home is much the same with the pandemic sheltering-in-place directives, touring city streets on bicycle, avoiding the parks on weekends.
    • 2020/04 Moments April 2020
      Living in social isolation in our house with 5 family members, finishing off teaching courses and taking courses.
    • 2020/03 Moments March 2020
      The month started with a hectic coincidence of events as both a teacher and student at two universities, abruptly shifting to low gear with government directives for social distancing.
  • RSS on Media Queue

  • Meta

  • Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
    Theme modified from DevDmBootstrap4 by Danny Machal