====== Wiki Installation ====== NEW WIKI See wiki repo on bitbucket. https://bitbucket.org/errigal/wiki/src/master/ Author: Padraig O Neill based on [[https://docs.google.com/document/d/1lw3Rkdxvos6O3JgvvQkFhqPJGy7LcUX-2TMMFa7HjZY/edit#heading=h.rbeemfk5xiqz]] by Andrey) ===== Introduction ===== This page was created to provide document details of the current dokuwiki installation. ---- ===== Location ===== Access Information * IP: 10.91.100.71 (scotty@blade2) * URL: wiki.err * Administrative account: scotty * Administrative account password: o******s Each user requiring an account on the WIKI is responsible for creating such an account using the administrative account provided. ===== Installation Information ===== * Apache HTTP Server web directory: /var/www/html * Watchdog: /home/scotty/watchdog * Hourly GIT push BASH script: /home/scotty/script/hourly_commit.sh ===== Installation Instructions ===== Installation Instruction * Connect to the required server via SSH (e.g. ssh scotty@10.91.100.71) * Install PHP (e.g. sudo yum install php) * Install Apache HTTP Server (e.g. sudo yum install httpd) * Download the latest DokuWiki - http://download.dokuwiki.org (use of the “wget” command is suggested) * Decompress the downloaded archive. * Move the contents of the unpacked “dokuwiki” folder to the Apache’s web directory * Via browser, access the “installer.php” file * If present, fix the accessibility issues by giving the required permissions to the relevant directories (the instructions will be provided by the installation PHP script) * Follow the installation instructions * Set the required permissions on the "data" (chmod -R 777) and "conf" folders (chmod -R 755). * Create the “.htaccess” file in the web directory * Add the “RewriteRule ^(data|conf|bin|inc) - [F,L,NC]” rule to the newly created “.htaccess” file * If any media upload issues persist, check that the chmod permissions allow the modification of the media folder (“data/media”). ===== Upgrade Instructions ===== * Make a backup of the current DokuWiki installation * Download the latest DokuWiki version - http://download.dokuwiki.org (use of the “wget” command is suggested) * Decompress the downloaded archive * Copy the contents of the newly downloaded DokuWiki version into the currently used DokuWiki installation, overwriting the existing files (e.g. cp -a dokuwiki/. html) * Set the required permissions on the "data" (chmod -R 777) and "conf" folders (chmod -R 755). ===== Daily GIT Push Setup Instruction ===== * Create the GIT push BASH script (refer to the “Code - Daily GIT Push BASH Script” section for the code) * Add the new CRON job (sudo crontab -e) (refer to the “Code - CRON Task” section for the code) * Install Watchdog - https://www.evernote.com/shard/s657/sh/f1e5d813-b6b1-415c-ab4f-977edcf80018/c39b17f4195c9515ca6fced8b4b4320b * Configure Watchdog (refer to the “Code - Watchdog” section) ===== Code ===== CRON Task # Backup internal wiki 0 * * * * /home/scotty/script/hourly_commit.sh > /home/scotty/script/hourly_commit.out 2>&1 Daily GIT Push BASH Script #!/bin/bash eval `ssh-agent` ssh-add /home/scotty/.ssh/id_rsa cd /var/www/html /usr/bin/git add -A /usr/bin/git commit -m "Hourly Commit (`/bin/date +'%Y-%m-%d %H:%M:%S'`)" /usr/bin/git push origin master if [ $? = 0 ]; then echo Everything was successful else echo Everything failed fi # echo "command result = $?" ===== Watchdog ===== 'WikiHourlyGITPushCheck' { type = 'LOG' thresholds { a = [name: 'checkLog', type: 'EQUAL', value: ['Everything failed'], lev$ } parameters { logFileLocation = '/home/scotty/script/hourly_commit.out' renameLog = false } } Also, do add "w = 'WikiHourlyGITPushCheck'" to the "resources" list. ===== Troubleshooting ===== If the Backup process is failing confirm the following. * Has the backup script been disabled in crontab * What is the latest date/time of the hourly_commit.out file. * Check SSH connectivity to bitbucket https://confluence.atlassian.com/bitbucket/troubleshoot-ssh-issues-271943403.html * Check connectivity to bitbucket using git ls-remote ===== Dokuwiki JS ===== * The code is included in the "userscript.js" file located in the "conf" folder. * The "userscript.js" file contents are always executed on the page load. * The "Cookie JS" cookies' processing library is included in the "main.php" header ("") (the "main.php" file can be located in the "lib/tpl/dokuwiki" folder) ===== Plugins Installation ===== * In order to install new plugins, access the "lib/plugins" folder and retrieve the plugin ZIP file (use of the “wget” command is suggested). * Then unzip the file. * The new plugin will be ready to use. * Alternatively, one can use the "Extension Manager" which can be accessed from the "Administration" panel. * However, the server has to be configured to allow the DokuWiki installation to contact its plugin repository. ===== CSS Styling ===== * In order to change the CSS styling, one can create a "userstyle.css" file in the "conf" folder. * However, there is a bug which will not activate the CSS changes until the administrator or another user with the appropriate permissions updates the "Template Style Settings". * In order to resolve this bug, make the required CSS changes, access the "Template Style Settings" page, and click the "Save changes" button. ===== DokuWiki User Manual ===== Using Sidebar * In order to show the sidebar, hover your mouse over the left side of the page. The cursor will change to the dropdown list. When the cursor is in such state, click the left mouse button. * The sidebar will appear. * Hiding the sidebar is done in the same manner. Creating Namespaces * Log in. * Type in the name of the namespace into the search box (e.g. “bob:”, where semicolon identifies the namespace). Alternatively, type in the name of the namespace and the page to be created (e.g. “bob:bobby”), and the namespaces will be created automatically with the page. * Click the pencil plus icon (located in the toolbar on the right side of the screen) in order to create the required page. * The namespace will be created automatically. ===== Updating Sidebar Navigation ===== * The required information is available here [https://www.dokuwiki.org/plugin:navi]. * The page containing the sidebar structure is called “navigation” (can be accessed via the search box or here [[http://wiki.err/doku.php?id=navigation]]). ===== Miscellaneous ===== * Bitbucket SSH keys setup - https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html * SSH keys generation guide - https://help.github.com/articles/generating-an-ssh-key/ * CRON jobs tutorial - http://code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs--net-8800 * DokuWiki upgrade guide - https://www.dokuwiki.org/install:upgrade * New logo upload - http://www.inmotionhosting.com/support/edu/dokuwiki/change-dokuwiki-appearance/change-dokuwiki-logo * “Navi” plugin (used for the sidebar implementation) - https://www.dokuwiki.org/plugin:navi * Code highlighter (can be very useful for writing documentation) - http://pygments.org ===== Useful Links ===== * https://www.dokuwiki.org/faq:sidebar * https://www.dokuwiki.org/namespaces * https://www.dokuwiki.org/link * https://www.dokuwiki.org/faq:newlines ===== Changing WIKI Page Width ===== * Login as administrator * Click the "Admin" link (top right corner of the screen) * Select "Template Style Settings" * Change the "The width of the full site (can be any length unit: %, px, em, ...)" value to the required one * Click the "Save Changes" button ===== Table of Contents Configuration ===== In order to set up the required configuration parameters allowing to show the TOC, one should access the configuration file ("dokuwiki.php", located in the "conf" folder) and ensure that the following values are set: * $conf['tocminheads'] = 1; //Minimum amount of headlines that determines if TOC is built * $conf['toptoclevel'] = 1; //Level starting with and below to include in AutoTOC . * $conf['maxtoclevel'] = 5; //Up to which level include into AutoTOC