User Tools

Site Tools


servers:nginx:dokuwiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
servers:nginx:dokuwiki [2023/08/02 13:13] – [Service] Sean Rhoneservers:nginx:dokuwiki [2024/02/07 16:37] (current) – [Server Block] Sean Rhone
Line 13: Line 13:
 ====== Dependencies ====== ====== Dependencies ======
  
-****+  PHP Modules: gd sodium zip zlib xml
  
-  sudo dnf install php-xml php-gd php-sodium+  sudo dnf install php-gd php-sodium php-pecl-zip php-xml
  
 ====== Download Source ====== ====== Download Source ======
Line 21: Line 21:
 **** ****
  
-  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/var/www/wiki' && sudo chown -R 'nginx':'nginx' '/var/www/wiki' && sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' '/var/www/wiki(/.*)?' && sudo restorecon -F -I -R '/var/www/wiki' && sync+  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
  
 ====== nginx + PHP-FPM Configuration ====== ====== nginx + PHP-FPM Configuration ======
  
 ===== PHP-FPM Socket ===== ===== PHP-FPM Socket =====
- 
-  * :!: [[https://github.com/splitbrain/dokuwiki/issues/3506|This report]] links to other reports of broken pages, and has a few different solutions. Disabling Pcre JIT fixes the rendering issue in this instance's case as of 2021/07/02, but doesn't seem to be necessary as of 2022/07/15 
  
   sudo -e '/etc/php-fpm.d/wiki.conf' && sudo systemctl restart 'php-fpm'   sudo -e '/etc/php-fpm.d/wiki.conf' && sudo systemctl restart 'php-fpm'
Line 59: Line 57:
 ;php_value[upload_max_filesize] = "10M" ;php_value[upload_max_filesize] = "10M"
 ;php_value[max_file_uploads] = "100" ;php_value[max_file_uploads] = "100"
- 
-; DokuWiki 
-;php_value[pcre.jit] = "0" 
  
 ; End</code> ; End</code>
Line 73: Line 68:
 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;
Line 133: Line 127:
  
 ====== Settings ====== ====== Settings ======
 +
 +===== Plugins =====
 +
 +  * https://www.dokuwiki.org/plugin:searchindex
  
 ===== Template Style Settings ===== ===== Template Style Settings =====
Line 157: Line 155:
   * 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' && sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' '/var/www/wiki/conf/entities.local.conf' && sudo restorecon -F -I -R '/var/www/wiki/conf/entities.local.conf' && sync +  echo '--      --' | sudo tee '/var/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'nginx':'nginx' '/var/www/wiki/conf/entities.local.conf' && sync
- +
-====== Logs ====== +
- +
-===== Enable ===== +
- +
-  * Uncomment ''access_log'' and ''error_log'' +
- +
-  sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx' && sync +
- +
-===== Logs ===== +
- +
-  sudo -e '/var/log/nginx/wiki-access.log' +
- +
-  sudo -e '/var/log/nginx/wiki-error.log' +
- +
-===== Disable ===== +
- +
-  * Comment ''access_log'' and ''error_log'' +
- +
-  sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx' && sudo rm '/var/log/nginx/wiki-access.log' '/var/log/nginx/wiki-error.log' && sync+
  
 ====== Services ====== ====== Services ======
Line 194: Line 172:
 ExecStart='/usr/bin/git' -C '/var/www/wiki' pull origin 'master' ExecStart='/usr/bin/git' -C '/var/www/wiki' pull origin 'master'
 ExecStartPost='/usr/bin/touch' '/var/www/wiki/conf/local.php' ExecStartPost='/usr/bin/touch' '/var/www/wiki/conf/local.php'
-ExecStartPost='/usr/bin/sync'</code>+ExecStartPost='/usr/bin/sync' 
 + 
 +# End</code>
  
 ==== Timer ==== ==== Timer ====
  
-  * Every day at ''01:00:00''+  * Every day at ''00:30:00''
  
   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
Line 209: Line 189:
  
 [Timer] [Timer]
-OnCalendar=*-*-* 01:00:00+OnCalendar=*-*-* 00:30:00
 Persistent=true Persistent=true
  
 [Install] [Install]
-WantedBy=timers.target</code>+WantedBy=timers.target 
 + 
 +# End</code>
  
 ===== Maintenance ===== ===== Maintenance =====
Line 236: Line 218:
 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/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 ExecStart='/usr/bin/php' '/var/www/wiki/bin/indexer.php' --clear
-ExecStartPost='/usr/bin/sync'</code>+ExecStartPost='/usr/bin/sync' 
 + 
 +# End</code>
  
 ==== Timer ==== ==== Timer ====
  
-  * ''01'' day of every month at ''01:20:00''+  * ''01'' day of every month at ''01:00:00''
  
   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-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-m.timer' --now
Line 249: Line 233:
  
 [Timer] [Timer]
-OnCalendar=*-*-01 01:20:00+OnCalendar=*-*-01 01:00:00
 Persistent=true Persistent=true
  
 [Install] [Install]
-WantedBy=timers.target</code>+WantedBy=timers.target 
 + 
 +# End</code>
  
 ===== Backup ===== ===== Backup =====
Line 262: Line 248:
  
   * :!: The extra ''ExecStart''s are additional backup locations that expect [[servers:vsftpd|vsftpd]]   * :!: The extra ''ExecStart''s are additional backup locations that expect [[servers:vsftpd|vsftpd]]
-  * TODO: Figure out Keybase and set a path here 
  
   mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service'   mkdir -p ~/'backups' && sudo -e '/etc/systemd/system/wiki-fb.service' && sudo sed -i 's/CHANGEME/'$USER'/g' '/etc/systemd/system/wiki-fb.service'
Line 273: Line 258:
 #ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/srv/ftp/nas1/espionage724/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/bash' -c '"/usr/bin/tar" -czf "/srv/ftp/nas1/espionage724/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/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/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"'
-ExecStartPost='/usr/bin/sync'</code>+ExecStartPost='/usr/bin/sync'
  
-=== Keybase === +End</code>
- +
-  * https://book.keybase.io/docs/files/details#mountpoints +
-  * :!: TODO: This doesn't work; can't immediately copy root:root file to that KBFS folder so it needs to be owned by that user, but the entire script is ran as-root. Create entirely different script just to copy the file from ''~/backups''? +
- +
-<code> +
-#ExecStart='/usr/bin/bash' -c '"/usr/bin/tar" -czf "/run/user/1000/keybase/kbfs/private/espionage724/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"'</code>+
  
 ==== Timer ==== ==== Timer ====
  
-  * Every day at ''01:50:00''+  * Every day at ''01:30:00''
  
   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-fb.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'wiki-fb.timer' --now && sudo systemctl start 'wiki-fb' && sudo systemctl status 'wiki-fb' -l
Line 294: Line 273:
  
 [Timer] [Timer]
-OnCalendar=*-*-* 01:50:00+OnCalendar=*-*-* 01:30:00
 Persistent=true Persistent=true
  
 [Install] [Install]
-WantedBy=timers.target</code>+WantedBy=timers.target 
 + 
 +# End</code>
  
 ====== Backup ====== ====== Backup ======
Line 354: Line 335:
 **** ****
  
-  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 chown -R 'nginx':'nginx' '/var/www/wiki' && sudo restorecon -F -I -R '/var/www/wiki' && cd ~ && sync +  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
- +
-=== SELinux Context === +
- +
-**** +
- +
-  sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' '/var/www/wiki(/.*)?' +
  
 ==== Start nginx ==== ==== Start nginx ====
/var/www/wiki/data/attic/servers/nginx/dokuwiki.1690996430.txt.gz · Last modified: 2023/08/02 13:13 by Sean Rhone