| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:bsd:nginx:dokuwiki [2026/04/21 15:48] – Sean Rhone | servers:bsd:nginx:dokuwiki [2026/08/08 00:05] (current) – [Prerequisites] Sean Rhone |
|---|
| ===== Prerequisites ===== | ===== Prerequisites ===== |
| |
| * [[bsd:server:freebsd_15.0|FreeBSD 15.0]] | * [[bsd:server:vps:freebsd_15.1|FreeBSD 15.1]] |
| * [[servers:bsd:freenginx_php_php-fpm|freenginx + PHP + PHP-FPM]] | * [[servers:bsd:freenginx_php_php-fpm|freenginx + PHP + PHP-FPM]] |
| * [[servers:bsd:nginx:lets_encrypt|Certbot (Let's Encrypt)]] | * [[servers:bsd:nginx:lets_encrypt|Certbot (Let's Encrypt)]] |
| |
| git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/usr/local/www/wiki' && chown -R 'www':'www' '/usr/local/www/wiki' | git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/usr/local/www/wiki' && chown -R 'www':'www' '/usr/local/www/wiki' |
| |
| ===== Edit Fix ===== | |
| |
| * :!: 2026/04/21: [[https://github.com/dokuwiki/dokuwiki/issues/4623|#4623]] | |
| |
| su - | |
| |
| git clone --rev 'f0f42d3b06a07b4a761f473dda3732e27c7c01f5' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/usr/local/www/wiki' && chown -R 'www':'www' '/usr/local/www/wiki' | |
| |
| ====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== |
| |
| ; Logging | ; Logging |
| php_value[log_errors] = "Off" | php_value[log_errors] = "0" |
| php_value[error_reporting] = "~E_ALL" | php_value[error_reporting] = "~E_ALL" |
| php_value[display_errors] = "Off" | php_value[display_errors] = "0" |
| php_value[display_startup_errors] = "Off" | php_value[display_startup_errors] = "0" |
| php_value[html_errors] = "Off" | php_value[html_errors] = "0" |
| |
| ; General | ; General |
| fastcgi_pass '127.0.0.1:9002'; | fastcgi_pass '127.0.0.1:9002'; |
| } | } |
| | |
| | # End</code> |
| | |
| | ===== Deny Directives ===== |
| | |
| | * https://www.dokuwiki.org/security#web_access_security |
| | |
| | su - |
| | |
| | ee '/usr/local/etc/freenginx/default.d/dokuwiki-deny.conf' |
| | |
| | <code> |
| | # Web Access Security |
| | location = '/install.php' { |
| | deny 'all'; |
| | } |
| | |
| | location '~' '/(conf|bin|inc)/' { |
| | deny 'all'; |
| | } |
| | |
| | location '~' '/data/' { |
| | internal; |
| | } |
| |
| # End</code> | # End</code> |
| include '/usr/local/etc/freenginx/default.d/wiki.conf'; | include '/usr/local/etc/freenginx/default.d/wiki.conf'; |
| include '/usr/local/etc/freenginx/default.d/headers.conf'; | include '/usr/local/etc/freenginx/default.d/headers.conf'; |
| | |
| | # include '/usr/local/etc/freenginx/default.d/dokuwiki-deny.conf'; |
| |
| add_header 'Content-Security-Policy' "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" 'always'; | add_header 'Content-Security-Policy' "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" 'always'; |
| # access_log '/var/log/nginx/wiki-access.log'; | # access_log '/var/log/nginx/wiki-access.log'; |
| # error_log '/var/log/nginx/wiki-error.log'; | # error_log '/var/log/nginx/wiki-error.log'; |
| |
| # location = '/install.php' { | |
| # deny 'all'; | |
| # } | |
| |
| # location '~' '/(conf|bin|inc)/' { | |
| # deny 'all'; | |
| # } | |
| |
| # location '~' '/data/' { | |
| # internal; | |
| # } | |
| |
| location '/' { | location '/' { |
| * The width of the full site: ''85%'' | * The width of the full site: ''85%'' |
| |
| ===== nginx Server Block Deny Directives ===== | ===== nginx Deny Directive ===== |
| |
| * Uncomment commented sections (except logs) | * Uncomment ''dokuwiki-deny.conf'' include |
| * Do after initial setup | * Do after initial setup |
| |
| |
| ===== Backup ===== | ===== Backup ===== |
| | |
| | * [[bsd:notes:ufs_format|UFS NAS]] |
| |
| mkdir -p ~/'backups' ~/'.local/scripts/www/wiki' && ee ~/'.local/scripts/www/wiki/backup.sh' && chmod +x ~/'.local/scripts/www/wiki/backup.sh' | mkdir -p ~/'backups' ~/'.local/scripts/www/wiki' && ee ~/'.local/scripts/www/wiki/backup.sh' && chmod +x ~/'.local/scripts/www/wiki/backup.sh' |
| cd '/tmp' | cd '/tmp' |
| |
| '/usr/bin/tar' -czf '/home/espionage724/backups/dokuwiki-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' | '/usr/bin/tar' -czf '/mnt/NAS1/Servers/Scheduled Backups/dokuwiki-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' |
| | |
| | #'/usr/bin/tar' -czf '/home/espionage724/backups/dokuwiki-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf' |
| |
| '/bin/sync' | '/bin/sync' |
| |
| ===== Folder ===== | ===== Folder ===== |
| |
| **** | |
| |
| su 'root' -c "tar -czf '/home/'$USER'/dokuwiki-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf'" | su 'root' -c "tar -czf '/home/'$USER'/dokuwiki-files-manual-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www/wiki' 'data/pages' 'data/meta' 'data/media' 'data/media_meta' 'data/attic' 'data/media_attic' 'conf'" |
| |
| ===== scp ===== | ===== scp ===== |
| |
| **** | |
| |
| scp espionage724@192.168.1.152:~/'dokuwiki-files-'*'.tar.gz' ~/'Downloads' | scp espionage724@192.168.1.152:~/'dokuwiki-files-'*'.tar.gz' ~/'Downloads' |
| |
| ===== scp ===== | ===== scp ===== |
| |
| **** | |
| |
| scp ~/'Downloads/dokuwiki-files-'*'.tar.gz' espionage724@192.168.1.152:~ | scp ~/'Downloads/dokuwiki-files-'*'.tar.gz' espionage724@192.168.1.152:~ |