no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | appwiki:dokuwiki [2021/06/21 16:11] (current) – [old dokuwiki php 7.4 above error] ying | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | ====== Dokuwiki Startup Guide ====== | ||
+ | |||
+ | ===== install and setup 2021 ===== | ||
+ | |||
+ | - install dokuwiki web app | ||
+ | - initial setup | ||
+ | - disable register: login wiki with your Admin > Configuration Manager: find " | ||
+ | - delete all default page: in sitemap, go each default page and empty the page content to delete | ||
+ | - set wiki site wide permission: admin page > Access Control List Management < | ||
+ | * @ALL Read (change from default upload to Read to prevent spam) | ||
+ | * @user Create (allow other reg user to create page) | ||
+ | * userA Delete (allow some power user to delete page) | ||
+ | categoryNameSpace: | ||
+ | categoryNameSpace: | ||
+ | </ | ||
+ | |||
+ | ===== Customize ===== | ||
+ | ** hide sitemap index from non-login user ** | ||
+ | * check on Configuration Manager > sneaky_index | ||
+ | |||
+ | **start page customize** | ||
+ | |||
+ | * admin panel > Configuration manager: Basic panel, starting point: change from " | ||
+ | * (outdated way) / | ||
+ | $conf[' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ** change wiki page width ** | ||
+ | * method 0 - Toggle Page Width with Javascript, CSS and Side Tool customize on "/ | ||
+ | - step 1: edit main.php head part to add css and javascript function (jquery no need) <code html> | ||
+ | < | ||
+ | .fullpageOn{ | ||
+ | max-width: 100% !important; | ||
+ | } | ||
+ | </ | ||
+ | < | ||
+ | // standard javascript here | ||
+ | function toggleFullPage() { | ||
+ | var myPageClasses = document.getElementById(" | ||
+ | if (myPageClasses.contains(" | ||
+ | myPageClasses.remove(" | ||
+ | } else { | ||
+ | myPageClasses.add(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | - step 2: edit main.php page action part <code html> | ||
+ | <!-- under PAGE ACTIONS --> | ||
+ | <!-- just above the last </ul> tag --> | ||
+ | < | ||
+ | </ | ||
+ | * method 1 with css: <code css> | ||
+ | /* find css file in default template folder with class dokuwiki__site | ||
+ | # | ||
+ | max-width: 100% !important; | ||
+ | } | ||
+ | </ | ||
+ | * method 2 with style.ini in default template folder ([[https:// | ||
+ | __site_width__ | ||
+ | #defaut | ||
+ | __site_width__ | ||
+ | </ | ||
+ | |||
+ | **change " | ||
+ | - (updated 2021) | ||
+ | - copy the file " | ||
+ | - edit wiki/ | ||
+ | - create wiki/ | ||
+ | if(!defined(' | ||
+ | - for link in some page that still link to doku.php, you may need to edit that page and update the page cache | ||
+ | |||
+ | **change wiki URL format** | ||
+ | * edit wiki/ | ||
+ | * 0 : dokuwiki/ | ||
+ | * 1 : dokuwiki/ | ||
+ | * 2 : http:// | ||
+ | |||
+ | **change 2013 or later DokuWiki homepage logo (further if you want to change the favicon)** | ||
+ | * method 1: use media manager, under wiki namespace, upload new logo to replace old one (: | ||
+ | * method 2: go dokuwiki\lib\tpl\dokuwiki\images, | ||
+ | * apple-touch-icon.png | ||
+ | * favicon.ico | ||
+ | * logo.png | ||
+ | |||
+ | **DokuWiki Favicon** | ||
+ | * generate favicon from logo: http:// | ||
+ | * loading priority sequence | ||
+ | - $DokuWiki/ | ||
+ | - $DokuWiki/ | ||
+ | - $DokuWiki root/ | ||
+ | - web root/ | ||
+ | |||
+ | **change 2013 or later DokuWiki theme, top "Media Manager" | ||
+ | * need to edit lib/ | ||
+ | * then in the display "Media Manager" | ||
+ | tpl_action(' | ||
+ | if(!empty($INFO[' | ||
+ | tpl_action(' | ||
+ | tpl_action(' | ||
+ | } | ||
+ | // note: $INFO[' | ||
+ | // ref: $INFO variable in dokuwiki: https:// | ||
+ | </ | ||
+ | * for new wiki check this< | ||
+ | # change | ||
+ | tpl_toolsevent(' | ||
+ | tpl_action(' | ||
+ | tpl_action(' | ||
+ | tpl_action(' | ||
+ | )); | ||
+ | # into | ||
+ | if(!empty($INFO[' | ||
+ | tpl_toolsevent(' | ||
+ | tpl_action(' | ||
+ | tpl_action(' | ||
+ | tpl_action(' | ||
+ | )); | ||
+ | } | ||
+ | else{ | ||
+ | tpl_toolsevent(' | ||
+ | | ||
+ | )); | ||
+ | } | ||
+ | </ | ||
+ | * ref: http:// | ||
+ | ===== DokuWiki plugins ===== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * other option: [[https:// | ||
+ | * [[https:// | ||
+ | * menubar: http:// | ||
+ | * video: | ||
+ | * [[https:// | ||
+ | * addition config | ||
+ | * [[https:// | ||
+ | * good for file type support config, and user css config | ||
+ | * ref: | ||
+ | |||
+ | ===== DokuWiki Templates Install ===== | ||
+ | |||
+ | - go Admin > Extension Manager: Search and Install tab, search the theme you want to install. | ||
+ | - then, go to admin > Configuration Manager, Basic: Template to choose the installed template | ||
+ | ====== Dokuwiki operation life-cycle maintain guide ====== | ||
+ | |||
+ | ===== compare to other wiki ===== | ||
+ | |||
+ | * ref: http:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== install and setup ===== | ||
+ | |||
+ | - download dokuwiki at: http:// | ||
+ | - extract the file structure to your Website Wiki folder | ||
+ | - start your web server, and browser to the " | ||
+ | - Then, create users, | ||
+ | - login wiki with your Admin account, click " | ||
+ | - then, click "User Manager", | ||
+ | - Then, authorize user rights | ||
+ | - click " | ||
+ | - click " | ||
+ | - Create page | ||
+ | - create page by a internal link: %%[[techwiki: | ||
+ | - create page by entering a new URL: %%http:// | ||
+ | - delete page | ||
+ | - delete page by empty the content of that page | ||
+ | - insert media like image and video | ||
+ | - use the toolbar in page editing panel | ||
+ | |||
+ | |||
+ | ===== maintain ===== | ||
+ | |||
+ | * clean up trash in dokuwiki <code bash cleanup.sh> | ||
+ | #!/bin/bash | ||
+ | |||
+ | cleanup() { | ||
+ | |||
+ | # $1 ... full path to data directory of wiki | ||
+ | # $2 ... number of days after which old files are to be removed | ||
+ | |||
+ | # purge files older than $2 days from the attic (old revisions) | ||
+ | find " | ||
+ | |||
+ | # remove stale lock files (files which are 1-2 days old) | ||
+ | find " | ||
+ | |||
+ | # remove empty directories | ||
+ | find " | ||
+ | -mindepth 1 -type d -empty -print0 | xargs -0r rmdir | ||
+ | |||
+ | # remove files older than $2 days from the cache | ||
+ | find " | ||
+ | } | ||
+ | </ | ||
+ | # some examples: | ||
+ | |||
+ | cleanup / | ||
+ | cleanup / | ||
+ | cleanup / | ||
+ | </ | ||
+ | |||
+ | ===== backup ===== | ||
+ | |||
+ | * **for normal personal or author-free article type wiki, then you just need to backup these 2 folder** | ||
+ | - / | ||
+ | - / | ||
+ | * **for large user base free type wiki, then you may like to backup** | ||
+ | - / | ||
+ | - / | ||
+ | - / | ||
+ | * (wiki can re-generate new version tracks if you don't want to keep old ones) | ||
+ | - / | ||
+ | * (suggest to delete it, or don't backup it if you never undo old changes) | ||
+ | * **for community based tracking type wiki** | ||
+ | * in addition, backup the users and group configuration file and rights configuration | ||
+ | - /wiki/conf - wiki configuration and user database | ||
+ | * **not sure what to do** | ||
+ | - /wiki - backup whole wiki to a zip file | ||
+ | - best to tar the wiki folder with permission info as well< | ||
+ | # back inside wiki folder | ||
+ | cd / | ||
+ | tar cvpzf put_your_name_here.tar.gz . | ||
+ | # restore inside wiki folder | ||
+ | cd / | ||
+ | tar xpvzf put_your_name_here.tar.gz | ||
+ | </ | ||
+ | ===== move to new server ===== | ||
+ | |||
+ | * zip the wiki, download, update to new server, extract | ||
+ | * for server with strict ModSecurity, | ||
+ | * run fix date php script to fix external edit and date issue (ref: https:// | ||
+ | * Run it from within DokuWiki installation directory. <code php> | ||
+ | <? | ||
+ | /** | ||
+ | * Fix modification times based on timestamps. Run from within DokuWiki installation directory. | ||
+ | * @Author: dreamlusion < | ||
+ | * last modified: 2008-09-05 4:15:00 | ||
+ | */ | ||
+ | function WalkDirectory($parentDirectory) { | ||
+ | global $_weeds; | ||
+ | |||
+ | foreach(array_diff(scandir($parentDirectory), | ||
+ | { | ||
+ | $path = $parentDirectory . '/' | ||
+ | |||
+ | if(is_dir($path)) | ||
+ | { | ||
+ | WalkDirectory($path); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | // Calculate changes file path. | ||
+ | $path_parts = pathinfo($path); | ||
+ | |||
+ | // Remove pages path. | ||
+ | global $_pagesPath; | ||
+ | $relativePath = substr($path_parts[' | ||
+ | |||
+ | // Add < | ||
+ | $filename = $path_parts[' | ||
+ | $relativePath .= '/' | ||
+ | |||
+ | global $_metaPath; | ||
+ | $changelog = $_metaPath . '/' | ||
+ | |||
+ | if (is_file($changelog)) | ||
+ | { | ||
+ | $handle = @fopen($changelog, | ||
+ | if ($handle) { | ||
+ | while (!feof($handle)) { | ||
+ | $buffer = fgets($handle); | ||
+ | preg_match('/ | ||
+ | |||
+ | if ($matches[' | ||
+ | $timestamp = $matches[' | ||
+ | |||
+ | } | ||
+ | fclose($handle); | ||
+ | } | ||
+ | |||
+ | // At this point we have our timestamp. | ||
+ | echo ' | ||
+ | echo '& | ||
+ | echo '& | ||
+ | if (touch($path, | ||
+ | { | ||
+ | // In my host, although the timestamp had changed successfully (checked manually), running filemtime($path) at this point | ||
+ | // did not return the correct timestamp, so use I use $timestamp instead of filemtime($path) to avoid confusing the user. | ||
+ | echo '& | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | echo '& | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | echo ' | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $_weeds = array(' | ||
+ | $_pagesPath = getcwd() . '/ | ||
+ | $_metaPath = getcwd() . '/ | ||
+ | |||
+ | WalkDirectory($_pagesPath); | ||
+ | |||
+ | ?> | ||
+ | </ | ||
+ | ===== Update and Install Plugin ===== | ||
+ | |||
+ | * the easiest way to update DokuWiki to latest version is to use " | ||
+ | - go to Admin page > plugin manager | ||
+ | - check the " | ||
+ | - paste the url on plugin manager' | ||
+ | - once finished, in Admin page, there will be a upgrade plugin link, and click it to go through the auto-download-dokuwiki-upgrade system | ||
+ | |||
+ | * these 2 image shows how to install plugin using plugin manager in admin panel | ||
+ | * {{: | ||
+ | * {{: | ||
+ | |||
+ | ===== Google Analytics Plugin ===== | ||
+ | |||
+ | Google Side | ||
+ | - go: analytics.google.com | ||
+ | - login google | ||
+ | - create track account | ||
+ | * choose info sharing or not | ||
+ | * choose web to monitor | ||
+ | * enter site name and info | ||
+ | * get the tracking id | ||
+ | |||
+ | dokuwiki side: | ||
+ | - dokuwiki admin page > extension: install https:// | ||
+ | - dokuwiki admin page: google analytics plugin link | ||
+ | * add its referred code into head section of: wiki/ | ||
+ | * note: some of template already have google analytics feature built-in, you may like to check config page to see | ||
+ | * then, back to dokuwiki admin config page: plugin: google analytics, put tracking id there | ||
+ | |||
+ | ====== Problem and Solution ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Dokuwiki Upload Image Failed ===== | ||
+ | |||
+ | * **Problem description**: | ||
+ | * when I use XAMPP to setup my local server, and put the dokuwiki in the htdocs folder, I can write wiki page, but upload image just saying " | ||
+ | * **Problem analysis**: | ||
+ | * It can be caused by several things, maybe your folder permission is set wrong, but most likely a fresh copy of dokuwiki folder should have everything set default correctly; | ||
+ | * It can be caused by your server upload setting, like allow upload in PHP setting, but default XAMPP should have everything setup correctly already | ||
+ | * **Solution**: | ||
+ | - for my case, I just grab a fresh latest copy of XAMPP from https:// | ||
+ | - then I run the setup_xampp.bat from the XAMPP folder to tell it where the location it sits | ||
+ | - then I just run xampp_control.exe with admin to start the server and mysql properly | ||
+ | - put fresh latest copy of dokuwiki in the XAMPP htdocs folder, and browser it from browser, like your machine name and /, following the dokuwiki folder name. | ||
+ | - it should all be all right, test by upload a image using dokuwiki image icon | ||
+ | |||
+ | ===== Wiki Folder Permission and Security ===== | ||
+ | |||
+ | |||
+ | * **Problem description** | ||
+ | * when move to new server, it sometimes can have file and folder permission lost problem, cause whole wiki has security issues | ||
+ | * ref doc: | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * **Solution** | ||
+ | * when migrating, make sure wiki compressed with file permission info < | ||
+ | tar cvpzf put_your_name_here.tar.gz . | ||
+ | |||
+ | cd / | ||
+ | tar xpvzf put_your_name_here.tar.gz | ||
+ | </ | ||
+ | * after migration, check and fix permission | ||
+ | * if visit page error, then fix with chmod: fix file permission with chmod < | ||
+ | # check existing htdoc file the_same_user: | ||
+ | ls -l | ||
+ | # then for wiki folder, fix own and permission | ||
+ | # ref: https:// | ||
+ | cd wiki/ | ||
+ | chmod -R 775 data/ | ||
+ | sudo chown -R the_same_user: | ||
+ | cd data/ | ||
+ | chmod 2775 {attic, | ||
+ | chown the_same_user: | ||
+ | </ | ||
+ | * if inside Admin page, the Extension Manager says " | ||
+ | // if you just need to change and match the group name, then this way | ||
+ | // cd to the plugins' | ||
+ | sudo chown -R : | ||
+ | // if you need user name change as well | ||
+ | sudo chown -R the_user_name_that_works: | ||
+ | // and check now permission with | ||
+ | ls -l | ||
+ | // you can check all user name by | ||
+ | cat /etc/passwd | ||
+ | </ | ||
+ | * check wiki security by visit a page txt file like , < | ||
+ | * if accessible, then fix with apache htaccess in httpd.conf (its location vary based on what linux creator you use): | ||
+ | * put data, conf, bin, inc folder in deny mode, example as for data < | ||
+ | order allow,deny | ||
+ | deny from allow | ||
+ | satisfy all | ||
+ | </ | ||
+ | </ | ||
+ | * also prevent file access < | ||
+ | Require all denied | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== dokuwiki config can't be saved problem ===== | ||
+ | |||
+ | * it is under wiki/ | ||
+ | * change local.php file permisison,< | ||
+ | chmod 775 local.php | ||
+ | chmod 775 local.php.bak | ||
+ | </ | ||
+ | * ref article: | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * ref: https:// | ||
+ | |||
+ | ===== old dokuwiki php 7.4 above error ===== | ||
+ | |||
+ | * Problem: .\inc\init.php line 564 array error: | ||
+ | * solution: " | ||
+ | * since new array will use [] instead {} | ||
+ | * Problem: other plugin error like "A PCRE internal error occured. This might be caused by a faulty plugin." | ||
+ | * solution: backup page and media folder under data, and move to new fresh copy of dokuwiki. (like in backup guide) | ||
+ | |||
+ | |||
+ | |||
+ | ====== Basic Syntax ====== | ||
+ | |||
+ | more syntax at http:// | ||
+ | edit bar at http:// | ||
+ | page creation at http:// | ||
+ | comparison of wiki http:// | ||
+ | |||
+ | ===== Text Format and Color ===== | ||
+ | |||
+ | no way but plugin | ||
+ | |||
+ | ===== Photo and Image ===== | ||
+ | name then size | ||
+ | < | ||
+ | {{wiki: | ||
+ | </ | ||
+ | ===== Links ===== | ||
+ | |||
+ | * Use %%[[dir_name_space: | ||
+ | * Just type link as http:// | ||
+ | * Use %%[[http:// | ||
+ | * Use %%[[this> | ||
+ | |||
+ | |||
+ | |||
+ | ===== List ===== | ||
+ | %%"2 spaces followed by * or -"%% at line start will create unordered or ordered list; \\ | ||
+ | "2 extra spaces" | ||
+ | |||
+ | ===== New Line & Escape container ===== | ||
+ | |||
+ | There are 4 ways to create a line break, or a blank line. | ||
+ | * type "2 Enter key" to create 1 blank line | ||
+ | * type " | ||
+ | * type < | ||
+ | * type %%"< | ||
+ | |||
+ | ===== Separator Line ===== | ||
+ | |||
+ | * four " | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Code Format ===== | ||
+ | type %%"< | ||
+ | < | ||
+ | \\ | ||
+ | type %%"< | ||
+ | <file - fileName.txt> | ||
+ | |||
+ | Supported: \\ | ||
+ | 4cs, abap, actionscript-french, | ||
+ | |||
+ | ===== special page ===== | ||
+ | |||
+ | * :sidebar for sidebar content | ||
+ | |||
+ | ====== Dokuwiki user group setup and security control ====== | ||
+ | |||
+ | Method: | ||
+ | - use dokuwiki admin page control | ||
+ | - use text config of dokuwiki: [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | ====== DokuWiki Theme and Customize ====== | ||
+ | |||
+ | * cool theme: | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | ===== Bootstrap3 template for Dokuwiki ===== | ||
+ | |||
+ | * author page guide page: | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * config: http:// | ||
+ | |||
+ | * step for setup | ||
+ | - install bootstrap3 template: https:// | ||
+ | - ref: https:// | ||
+ | - install related plugin: | ||
+ | - Bootstrap Wrapper Plugin: https:// | ||
+ | - icons plugin: https:// | ||
+ | |||
+ | * custom Bootstrap3 | ||
+ | - admin > Configuration Setting, go bottom bootstrap3 part | ||
+ | - bootstrap them, choose Bootswatch.com theme | ||
+ | - select a theme : superhero | ||
+ | - check show theme switcher (next, check hide them in switch list, recommend hide all except lumen, | ||
+ | - Navbar part: | ||
+ | - display tools in navbar: when logged in | ||
+ | - enable disable indivdual menu in navbar: check user | ||
+ | - Layout part: | ||
+ | - uncheck full width | ||
+ | - table style: check all except condensed | ||
+ | - uncheck display doku link on footer | ||
+ | - TOC part | ||
+ | - uncheck collapse for 2 option | ||
+ | - Page part: | ||
+ | - check AnchorJs | ||
+ | - and uncheck collapse 2nd section level on mobile | ||
+ | |||
+ | * navbar page for navbar: | ||
+ | * https:// | ||
+ | * code < | ||
+ | * [[: | ||
+ | * DokuWiki | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | ~~NOCACHE~~ | ||
+ | </ | ||