mywiki:experience:dokuwiki
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mywiki:experience:dokuwiki [2020/08/16 10:16] – [Backup Dokuwiki] super | mywiki:experience:dokuwiki [2025/07/22 20:48] (current) – [Secure dokuwiki in conf/local.php] gshao | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | **DokuWIKI Experience and skill** | ||
| + | Reference: [[https:// | ||
| + | |||
| + | ======= WIKI Directory Layout ======= | ||
| + | Main Directory layout as below. For details, refer to https:// | ||
| + | * **conf** – Configuration data is stored here | ||
| + | * **data** – All data that is written by DokuWiki is stored here (see savedir) | ||
| + | * **attic** – old page revisions are stored here, it contains namespaces directories | ||
| + | * cache – DokuWiki creates cachefiles to speed things up | ||
| + | * index – Stores lookup tables for the fulltext search index -- No need to save, use plugin to re-generate | ||
| + | * **media** – Here are all image files stored, it contains namespaces directories | ||
| + | * **media_attic**– old revisions of media files | ||
| + | * **media_meta** – meta data for media files | ||
| + | * **meta** – Stores meta data for pages, it contains namespaces directories, | ||
| + | * **pages** – Here are the raw pages stored, it contains namespaces directories | ||
| + | * auth – Authentication backends (removed since 2013-05-10 Weatherwax) | ||
| + | Note: If the content stored in a wiki page is data, things like the time of last update, who updated it, the filesize etc. could all be regarded as metadata for the wiki page. This page describes where and how such additional data is stored in DokuWiki. The detail meta information refer to https:// | ||
| + | |||
| + | |||
| + | ====== Backup Dokuwiki ====== | ||
| + | Official proposal to backup dokuwiki: Only below two folder is a must | ||
| + | * **data/ | ||
| + | * **data/ | ||
| + | |||
| + | If need to save version history, below 4 folders are needed | ||
| + | * data/ | ||
| + | * data/ | ||
| + | * data/ | ||
| + | * data/ | ||
| + | |||
| + | Options since seldom change configuration | ||
| + | * conf\acl.auth.php | ||
| + | * conf\local.php | ||
| + | * conf\plugins.local.php | ||
| + | * conf\users.auth.php | ||
| + | | ||
| + | Take note: no need to backup below folders | ||
| + | * < | ||
| + | * < | ||
| + | * < | ||
| + | * < | ||
| + | |||
| + | <code batch Windows_backup_script.bat> | ||
| + | @echo off | ||
| + | rem place this script in the parent directory of dokuBackup folder. | ||
| + | IF EXIST dokuBackup ( | ||
| + | echo dokuBackup already exist | ||
| + | echo renaming ... | ||
| + | IF EXIST dokuBackup_old ( | ||
| + | echo are you confused? dokuBackup_old already exist! | ||
| + | exit /B 1 | ||
| + | ) ELSE ( | ||
| + | move /Y dokuBackup dokuBackup_old | ||
| + | ) | ||
| + | ) ELSE ( | ||
| + | mkdir dokuBackup | ||
| + | ) | ||
| + | |||
| + | ncftpget -R -u yourUsername -p yourPassword yourWebspaceFTPurl " | ||
| + | ncftpget -R -u yourUsername -p yourPassword yourWebspaceFTPurl " | ||
| + | </ | ||
| + | |||
| + | <code bash bash_script.sh> | ||
| + | #!/bin/sh -e | ||
| + | # backup data from wiki (FTP) | ||
| + | unset | ||
| + | url=" | ||
| + | backup="/ | ||
| + | wget -q --no-cache -nH -c -t0 --mirror -P$backup -i- <<EOF | ||
| + | $url/ | ||
| + | $url/ | ||
| + | |||
| + | EOF | ||
| + | </ | ||
| + | |||
| + | ====== Upgrade Dokuwiki to Web Hosting Site ====== | ||
| + | **Firstly Fully delete original folders and files under dokuwiki in order to avoid old plugin mismatch and clean some old files:** | ||
| + | * bin | ||
| + | * conf: all files except **acl.auth.php, | ||
| + | * inc | ||
| + | * lib | ||
| + | * vendor | ||
| + | * data folder: | ||
| + | * data\media\wiki | ||
| + | * data\pages\wiki | ||
| + | * data\pages\playground | ||
| + | * data\attic | ||
| + | * data\cache | ||
| + | * data\index | ||
| + | * data\locks | ||
| + | * data\media_attic | ||
| + | * data\media_meta | ||
| + | * data\meta | ||
| + | * all files directly under dokuwiki, like .htaccess.dist, | ||
| + | |||
| + | **Secondly upload new dokuwiki unzip files/ | ||
| + | |||
| + | **Lastly reconfigure dokuwiki: dokuwiki/ | ||
| + | | ||
| + | ====== Skill ====== | ||
| + | |||
| + | ^Function ^ syntax ^ Example ^ | ||
| + | | Escape pipe(%%|%%) | < | ||
| + | | simple escape way to no format for single line with **nowiki** | < | ||
| + | | simple escape way to no format for a block with **file** | < | ||
| + | | simple escape way to no format for a block with **file** | < | ||
| + | | simple escape way to no format for a block with **code** | < | ||
| + | b </ | ||
| + | | Delete words with **del**| < | ||
| + | | Create Paragraphs or forced line with **\\** | ||
| + | | iframe plugin test | [[dokuwiki_iframe|iframe example]] | [[dokuwiki_html example ]] | | ||
| + | |||
| + | |||
| + | ====== Admin ====== | ||
| + | ===== Secure dokuwiki in conf/ | ||
| + | |||
| + | | Goal | Setting | | ||
| + | | Disable public reset | $conf[' | ||
| + | | Disable register & reset | $conf[' | ||
| + | | Secure email reset (if enabled) | Configure SMTP settings properly in conf/ | ||
| + | |||
| + | ===== Dokuwiki Gmail SMTP configuration ===== | ||
| + | |||
| + | * Step 1: Enable 2FA & Create an App Password: Go to https:// | ||
| + | * Enable 2-Step Verification (if not already). | ||
| + | * Go to Security → App Passwords: https:// | ||
| + | * Create an app password: | ||
| + | * App: Mail | ||
| + | * Device: Other → Enter " | ||
| + | * Click Generate | ||
| + | * Copy the 16-character app password. | ||
| + | |||
| + | Add or update the following lines: | ||
| + | < | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | $conf[' | ||
| + | |||
| + | </ | ||
| + | Replace youraddress@gmail.com and your_app_password_here with your Gmail and the app password from step 1. | ||
| + | |||
