| Next revision | Previous revision |
| servers:linux:nginx:dokuwiki [2024/08/13 22:15] – created Sean Rhone | servers:linux:nginx:dokuwiki [2025/12/22 03:00] (current) – [Git Fix] Sean Rhone |
|---|
| ====== Information ====== | ====== Information ====== |
| |
| * DokuWiki ((https://www.dokuwiki.org)) ((https://github.com/splitbrain/dokuwiki)) | * DokuWiki |
| * [[Information:Realm of Espionage]] | * [[information:realm_of_espionage|Realm of Espionage]] |
| * https://wiki.realmofespionage.xyz ((you are here :p)) | * https://wiki.realmofespionage.xyz ((you are here :p)) |
| |
| ===== Prerequisites ===== | ===== Prerequisites ===== |
| |
| * [[distros:fedora_server|Fedora Server]] | * [[linux:distros:server:ubuntu_server|Ubuntu Server]] |
| * [[servers:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] | * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]] |
| * [[servers:nginx:lets_encrypt|Let's Encrypt]] | * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]] |
| | |
| ====== TODO ====== | |
| | |
| * https://www.dokuwiki.org/cli?s%5B%5D=wantedpages.php | |
| |
| ====== Dependencies ====== | ====== Dependencies ====== |
| |
| * PHP Modules: gd sodium zip zlib xml | * https://www.dokuwiki.org/requirements |
| | * https://www.dokuwiki.org/install:php |
| | * https://github.com/dokuwiki/dokuwiki/blob/master/composer.json |
| |
| sudo dnf install php-gd php-sodium php-pecl-zip php-xml | sudo apt install git php-bz2 php-gd php-intl php-mbstring php-xml |
| |
| ====== Download Source ====== | ====== Download Source ====== |
| |
| **** | * https://github.com/dokuwiki/dokuwiki/commits/master/ |
| |
| sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/var/www/wiki' && sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' '/var/www/wiki(/.*)?' && sudo restorecon -F -I -R '/var/www/wiki' && sudo chown -R 'nginx':'nginx' '/var/www/wiki' && sync | sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/var/www/wiki' && sudo chown -R 'www-data':'www-data' '/var/www/wiki' && sudo chmod -R '0755' '/var/www/wiki' |
| |
| ====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== |
| ===== PHP-FPM Socket ===== | ===== PHP-FPM Socket ===== |
| |
| sudo -e '/etc/php-fpm.d/wiki.conf' && sudo systemctl restart 'php-fpm' | sudo -e '/etc/php/8.4/fpm/pool.d/wiki.conf' && sudo systemctl restart 'php8.4-fpm' |
| |
| <code> | <code> |
| |
| ; User/Group | ; User/Group |
| user = nginx | user = "www-data" |
| group = nginx | group = "www-data" |
| |
| ; Socket | ; Socket |
| listen = /run/php-fpm/wiki.sock | listen = "/run/php/wiki.sock" |
| listen.acl_users = nginx | listen.owner = "www-data" |
| listen.allowed_clients = 127.0.0.1 | listen.group = "www-data" |
| | listen.mode = "0662" |
| |
| ; Process Management | ; Process Management |
| pm = ondemand | pm = "ondemand" |
| pm.max_children = 4 | pm.max_children = "4" |
| pm.process_idle_timeout = 30 | pm.process_idle_timeout = "30" |
| |
| ; Fedora php.ini Defaults | ; Logging |
| php_value[session.save_handler] = "files" | php_value[log_errors] = "0" |
| php_value[session.save_path] = "/var/lib/php/session" | php_value[error_reporting] = "~E_ALL" |
| |
| ; General | ; General |
| php_value[date.timezone] = "America/New_York" | php_value[date.timezone] = "America/New_York" |
| ;php_value[max_execution_time] = "200" | |
| ;php_value[memory_limit] = "512M" | |
| ;php_value[post_max_size] = "10M" | |
| ;php_value[upload_max_filesize] = "10M" | |
| ;php_value[max_file_uploads] = "100" | |
| |
| ; End</code> | ; End</code> |
| ===== FastCGI ===== | ===== FastCGI ===== |
| |
| sudo -e '/etc/nginx/default.d/wiki.conf' | sudo -e '/etc/nginx/snippets/wiki.conf' |
| |
| <code> | <code> |
| # PHP-FPM | location '~' '\.(php|phar)(/.*)?$' { |
| location ~ \.(php|phar)(/.*)?$ { | |
| fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; | fastcgi_split_path_info '^(.+\.(?:php|phar))(/.*)$'; |
| fastcgi_intercept_errors on; | fastcgi_intercept_errors 'on'; |
| fastcgi_index doku.php; | fastcgi_index 'doku.php'; |
| include fastcgi_params; | include 'fastcgi_params'; |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | fastcgi_param 'SCRIPT_FILENAME' '$document_root$fastcgi_script_name'; |
| fastcgi_param PATH_INFO $fastcgi_path_info; | fastcgi_param 'PATH_INFO' '$fastcgi_path_info'; |
| fastcgi_param HTTPS on; | fastcgi_param 'HTTPS' 'on'; |
| fastcgi_pass unix:/run/php-fpm/wiki.sock; | |
| }</code> | fastcgi_pass 'unix:/run/php/wiki.sock'; |
| | |
| | } |
| | |
| | # End</code> |
| |
| ===== Server Block ====== | ===== Server Block ====== |
| |
| sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx' && sync | sudo -e '/etc/nginx/sites-available/wiki.conf' |
| |
| <code> | <code> |
| server { | server { |
| listen '443' 'ssl'; | |
| http2 'on'; | |
| server_name 'wiki.realmofespionage.xyz'; | |
| root '/var/www/wiki'; | |
| index 'doku.php'; | |
| |
| include '/etc/nginx/default.d/wiki.conf'; | listen '443' 'ssl'; |
| include '/etc/nginx/default.d/headers.conf'; | http2 'on'; |
| | server_name 'wiki.realmofespionage.xyz'; |
| | root '/var/www/wiki'; |
| | index 'doku.php'; |
| |
| client_max_body_size '10M'; | include '/etc/nginx/snippets/wiki.conf'; |
| | include '/etc/nginx/snippets/headers.conf'; |
| |
| add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" always; | client_max_body_size '10M'; |
| |
| # access_log /var/log/nginx/wiki-access.log; | add_header 'Content-Security-Policy' "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" 'always'; |
| # error_log /var/log/nginx/wiki-error.log; | |
| |
| # location = /install.php { | # access_log '/var/log/nginx/wiki-access.log'; |
| # deny all; | # error_log '/var/log/nginx/wiki-error.log'; |
| # } | |
| |
| # location ~ /(conf|bin|inc)/ { | # location = '/install.php' { |
| # deny all; | # deny 'all'; |
| # } | # } |
| |
| # location ~ /data/ { | # location '~' '/(conf|bin|inc)/' { |
| # internal; | # deny 'all'; |
| # } | # } |
| |
| location / { try_files $uri $uri/ @dokuwiki; } | # location '~' '/data/' { |
| | # internal; |
| | # } |
| |
| location @dokuwiki { | location '/' { |
| rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; | try_files '$uri' '$uri/' '@dokuwiki'; |
| rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; | } |
| rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; | |
| rewrite ^/(.*) /doku.php?id=$1&$args last; | |
| } | |
| }</code> | |
| |
| ====== Initial Setup ====== | location '@dokuwiki' { |
| | rewrite '^/_media/(.*)' '/lib/exe/fetch.php?media=$1' 'last'; |
| | rewrite '^/_detail/(.*)' '/lib/exe/detail.php?media=$1' 'last'; |
| | rewrite '^/_export/([^/]+)/(.*)' '/doku.php?do=export_$1&id=$2' 'last'; |
| | rewrite '^/(.*)' '/doku.php?id=$1&$args' 'last'; |
| | } |
| |
| * :!: TODO: https://www.dokuwiki.org/rewrite | } |
| | |
| | # End</code> |
| | |
| | sudo ln -s -f '/etc/nginx/sites-available/wiki.conf' '/etc/nginx/sites-enabled/wiki.conf' && sudo systemctl reload 'nginx' |
| | |
| | ====== Initial Setup ====== |
| |
| * https://wiki.realmofespionage.xyz/install.php | * https://wiki.realmofespionage.xyz/install.php |
| ===== Template Style Settings ===== | ===== Template Style Settings ===== |
| |
| * Alternative background color: ''#484848'' | * Alternative background color: ''#484848'' (gray) |
| * The general link color: ''#3d8bff'' | * The general link color: ''#3d8bff'' (blue) |
| * :!: The width of the full site: ''100em'' ((this caused some kind of scrollbar I believe on a 1280x800 laptop)) | * The width of the full site: ''85%'' |
| |
| ===== nginx Server Block Deny Directives ===== | ===== nginx Server Block Deny Directives ===== |
| * Do after initial setup | * Do after initial setup |
| |
| sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx' | sudo -e '/etc/nginx/sites-available/wiki.conf' && sudo ln -s -f '/etc/nginx/sites-available/wiki.conf' '/etc/nginx/sites-enabled/wiki.conf' && sudo systemctl reload 'nginx' |
| |
| ===== URL Rewrite ===== | ===== URL Rewrite ===== |
| * This prevents -- from becoming a – (long hyphen), which breaks some command's syntax | * This prevents -- from becoming a – (long hyphen), which breaks some command's syntax |
| |
| echo '-- --' | sudo tee '/var/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'nginx':'nginx' '/var/www/wiki/conf/entities.local.conf' && sync | echo '-- --' | sudo -u 'www-data' tee '/var/www/wiki/conf/entities.local.conf' > '/dev/null' |
| | |
| | ====== Scripts ====== |
| | |
| | ===== Git Fix ===== |
| | |
| | * :!: Set email for ''user.email'' |
| | |
| | sudo mkdir -p '/etc/nginx/scripts/wiki' && sudo -e '/etc/nginx/scripts/wiki/git-fix.sh' && sudo chmod '0500' '/etc/nginx/scripts/wiki/git-fix.sh' && sudo chown 'www-data':'www-data' '/etc/nginx/scripts/wiki/git-fix.sh' |
| | |
| | <code> |
| | #!/bin/bash |
| | |
| | cd '/tmp' |
| | |
| | '/usr/bin/rm' -Rf '/var/www/wiki/.git' |
| | '/usr/bin/git' -C '/var/www/wiki' init --initial-branch='master' |
| | '/usr/bin/git' -C '/var/www/wiki' add '.' |
| | |
| | ######################################## |
| | '/usr/bin/git' -C '/var/www/wiki' config 'user.email' 'espionage724@x' |
| | ######################################## |
| | |
| | '/usr/bin/git' -C '/var/www/wiki' commit --message='x' |
| | |
| | '/usr/bin/git' -C '/var/www/wiki' remote add 'origin' 'https://github.com/dokuwiki/dokuwiki.git' |
| | '/usr/bin/git' -C '/var/www/wiki' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase |
| | |
| | '/usr/bin/git' -C '/var/www/wiki' reset --hard 'origin/master' |
| | '/usr/bin/git' -C '/var/www/wiki' gc --aggressive --prune='all' |
| | '/usr/bin/git' -C '/var/www/wiki' fsck --full --strict |
| | |
| | # End</code> |
| | |
| | sudo -u 'www-data' '/etc/nginx/scripts/wiki/git-fix.sh' |
| |
| ====== Services ====== | ====== Services ====== |
| <code> | <code> |
| [Service] | [Service] |
| User=nginx | User=www-data |
| Group=nginx | Group=www-data |
| Type=oneshot | Type=oneshot |
| ExecStart='/usr/bin/git' -C '/var/www/wiki' pull origin 'master' | |
| ExecStartPost='/usr/bin/touch' '/var/www/wiki/conf/local.php' | WorkingDirectory=/var/www/wiki |
| | |
| | ExecStart='/usr/bin/git' -C '/var/www/wiki' reset --hard 'origin/master' |
| | ExecStart='/usr/bin/git' -C '/var/www/wiki' pull origin 'master' --rebase |
| | |
| | ExecStart='/usr/bin/php' '/var/www/wiki/bin/indexer.php' --clear |
| | ExecStart='/usr/bin/touch' '/var/www/wiki/conf/local.php' |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| |
| ==== Timer ==== | ==== Timer ==== |
| |
| * Every day at ''00:30:00'' | * Daily ''12:00:00 AM'' |
| |
| sudo -e '/etc/systemd/system/wiki-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-up.timer' --now && sudo systemctl start 'wiki-up' && sudo systemctl status 'wiki-up' -l | sudo -e '/etc/systemd/system/wiki-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-up.timer' --now && sudo systemctl start 'wiki-up' && sudo systemctl status 'wiki-up' -l |
| |
| [Timer] | [Timer] |
| OnCalendar=*-*-* 00:30:00 | OnCalendar=*-*-* 00:00:00 |
| Persistent=true | Persistent=true |
| |
| # End</code> | # End</code> |
| |
| ===== Maintenance ===== | ===== Backup ===== |
| |
| * https://www.dokuwiki.org/tips:maintenance | * TODO: NAS mount |
| |
| ==== Service ==== | ==== Service ==== |
| |
| * :!: The commented ''ExecStart'' would remove page edits older than 90 days | mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service' |
| | |
| sudo -e '/etc/systemd/system/wiki-m.service' | |
| |
| <code> | <code> |
| [Service] | [Service] |
| User=nginx | |
| Group=nginx | |
| Type=oneshot | Type=oneshot |
| | |
| WorkingDirectory=/var/www/wiki | WorkingDirectory=/var/www/wiki |
| ExecStart='/usr/bin/git' -C '/var/www/wiki' gc --aggressive --prune='all' | |
| ExecStart='/usr/bin/git' -C '/var/www/wiki' fsck --full --strict | ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" -C "/var/www/wiki" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' |
| #ExecStart='/usr/bin/bash' -c "find '/var/www/wiki/data'/{attic,cache,locks,media_attic}/ -type 'f' -mtime +'90' -delete" | |
| ExecStart='/usr/bin/bash' -c "find '/var/www/wiki/data'/{attic,cache,index,locks,media,media_attic,media_meta,meta,pages,tmp}/ -mindepth '1' -type 'd' -empty -delete" | |
| ExecStart='/usr/bin/php' '/var/www/wiki/bin/indexer.php' --clear | |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| |
| ==== Timer ==== | ==== Timer ==== |
| |
| * ''01'' day of every month at ''01:00:00'' | * Weekly (Monday) ''12:15:00 AM'' |
| |
| sudo -e '/etc/systemd/system/wiki-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-m.timer' --now | sudo -e '/etc/systemd/system/wiki-fb.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-fb.timer' --now && sudo systemctl start 'wiki-fb' && sudo systemctl status 'wiki-fb' -l |
| |
| <code> | <code> |
| [Unit] | [Unit] |
| Description=DokuWiki Maintenance | Description=DokuWiki Files Backup |
| |
| [Timer] | [Timer] |
| OnCalendar=*-*-01 01:00:00 | OnCalendar=Mon *-*-* 00:15:00 |
| Persistent=true | Persistent=true |
| |
| # End</code> | # End</code> |
| |
| ===== Backup ===== | ===== Maintenance ===== |
| | |
| * This backs up an archive to the local disk and to a NAS | |
| |
| ==== Service ==== | ==== Service ==== |
| |
| * The extra ''ExecStart''s are additional backup locations that expect [[servers:vsftpd|vsftpd]] | sudo -e '/etc/systemd/system/wiki-m.service' |
| * TODO: Remove additional backup locations and put it on a system-wide script direct from the ''~/backups'' folder | |
| | |
| mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service' | |
| |
| <code> | <code> |
| [Service] | [Service] |
| | User=www-data |
| | Group=www-data |
| Type=oneshot | Type=oneshot |
| | |
| WorkingDirectory=/var/www/wiki | WorkingDirectory=/var/www/wiki |
| ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/home/CHANGEME/backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' | |
| #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/var/ftp/nas1/Servers/Scheduled Backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' | ExecStart='/usr/bin/git' -C '/var/www/wiki' gc --aggressive --prune='all' |
| #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/srv/ftp/nas2/Servers/Scheduled Backups/dokuwiki-files-auto-"$$(date +%%Y-%%m-%%d)".tar.gz" "data/pages" "data/meta" "data/media" "data/media_meta" "data/attic" "data/media_attic" "conf"' | ExecStart='/usr/bin/git' -C '/var/www/wiki' fsck --full --strict |
| ExecStartPost='/usr/bin/sync' | ExecStartPost='/usr/bin/sync' |
| |
| ==== Timer ==== | ==== Timer ==== |
| |
| * Every day at ''01:30:00'' | * Monthly (1st) ''12:30:00 AM'' |
| |
| sudo -e '/etc/systemd/system/wiki-fb.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-fb.timer' --now && sudo systemctl start 'wiki-fb' && sudo systemctl status 'wiki-fb' -l | sudo -e '/etc/systemd/system/wiki-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-m.timer' --now |
| |
| <code> | <code> |
| [Unit] | [Unit] |
| Description=DokuWiki Files Backup | Description=DokuWiki Maintenance |
| |
| [Timer] | [Timer] |
| OnCalendar=*-*-* 01:30:00 | OnCalendar=*-*-01 00:30:00 |
| Persistent=true | Persistent=true |
| |
| |
| # End</code> | # End</code> |
| | |
| | sudo systemctl start 'wiki-m' && sudo systemctl status 'wiki-m' -l |
| |
| ====== Backup ====== | ====== Backup ====== |
| |
| * Create backup archive on server and transfer to client computer | ===== Files ===== |
| |
| ===== Server ===== | **** |
| | |
| | sudo tar -czf ~/'dokuwiki-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/var/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' |
| |
| ==== Archive Folders ==== | ===== scp ===== |
| |
| **** | **** |
| |
| cd '/var/www/wiki' && sudo tar -cvzf ~/'dokuwiki-files-manual-'$(date +%Y-%m-%d)'.tar.gz' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' && cd ~ && sync | scp espionage724@192.168.1.152:~/'dokuwiki-files-'*'.tar.gz' ~/'Downloads' |
| |
| ===== Client ===== | ====== Restore ====== |
| |
| ==== Transfer Archive to Client ==== | ===== scp ===== |
| |
| **** | **** |
| |
| scp espionage724@192.168.1.152:~/'dokuwiki-files-'*'.tar.gz' ~/'Downloads' && sync | scp ~/'Downloads/dokuwiki-files-'*'.tar.gz' espionage724@192.168.1.152:~ |
| |
| ====== Restore ====== | ===== Stop nginx ===== |
| |
| ===== Client ===== | **** |
| | |
| | sudo systemctl stop 'nginx' |
| |
| ==== Transfer Archive to Server ==== | ===== Remove Existing Files ===== |
| |
| **** | **** |
| |
| scp ~/'Downloads/dokuwiki-files-'*'.tar.gz' espionage724@192.168.1.152:~ | ls ~/'dokuwiki-files-'*'.tar.gz' && sudo rm -Rf '/var/www/wiki/data/pages' '/var/www/wiki/data/meta' '/var/www/wiki/data/media' '/var/www/wiki/data/media_meta' '/var/www/wiki/data/attic' '/var/www/wiki/data/media_attic' '/var/www/wiki/conf' |
| |
| ==== Remove Archive ==== | ===== Restore Files ===== |
| |
| **** | **** |
| |
| rm ~/'Downloads/dokuwiki-files-'*'.tar.gz' && sync | sudo tar -xzf ~/'dokuwiki-files-'*'.tar.gz' -C '/var/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' && sudo chown -R 'www-data':'www-data' '/var/www/wiki' && sudo chmod -R '0755' '/var/www/wiki' |
| |
| ===== Server ===== | ===== Git Fix ===== |
| |
| ==== Stop nginx ==== | * :!: Set email for ''user.email'' |
| |
| **** | sudo su 'www-data' -s '/bin/bash' |
| |
| sudo systemctl stop 'nginx' | rm -Rf '/var/www/wiki/.git' |
| |
| ==== Remove Previous Folders ==== | git -C '/var/www/wiki' init --initial-branch='master' |
| |
| **** | git -C '/var/www/wiki' add '.' |
| |
| ls ~/'dokuwiki-files-'*'.tar.gz' && sudo rm -Rf '/var/www/wiki/data/pages' '/var/www/wiki/data/meta' '/var/www/wiki/data/media' '/var/www/wiki/data/media_meta' '/var/www/wiki/data/attic' '/var/www/wiki/data/media_attic' '/var/www/wiki/conf' | git -C '/var/www/wiki' config 'user.email' 'espionage724@x' |
| |
| ==== Restore Folders ==== | git -C '/var/www/wiki' commit --message='x' |
| |
| **** | git -C '/var/www/wiki' remote add 'origin' 'https://github.com/dokuwiki/dokuwiki.git' |
| |
| cd '/var/www/wiki' && sudo tar -xvzf ~/'dokuwiki-files-'*'.tar.gz' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' && sudo restorecon -F -I -R '/var/www/wiki' && sudo chown -R 'nginx':'nginx' '/var/www/wiki' && cd ~ && sync | git -C '/var/www/wiki' pull --depth '1' --recurse-submodules 'origin' 'master' --rebase |
| |
| ==== Start nginx ==== | git -C '/var/www/wiki' reset --hard 'origin/master' |
| | |
| | git -C '/var/www/wiki' gc --aggressive --prune='all' |
| | |
| | git -C '/var/www/wiki' fsck --full --strict |
| | |
| | exit |
| | |
| | ===== Start nginx ===== |
| |
| **** | **** |
| sudo systemctl start 'nginx' | sudo systemctl start 'nginx' |
| |
| ==== Remove Archive ==== | ===== Clean-up ===== |
| |
| * Verify that DokuWiki works before running | **** |
| |
| rm -R ~/'dokuwiki-files-'*'.tar.gz' && sync | rm -fv ~/'dokuwiki-files-'*'.tar.gz' |
| | |
| | ====== TODOs ====== |
| | |
| | * https://www.dokuwiki.org/cli?s%5B%5D=wantedpages.php |
| | * https://www.dokuwiki.org/rewrite |
| |