User Tools

Site Tools


servers:linux: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:linux:nginx:dokuwiki [2025/07/15 18:36] – [Service] Sean Rhoneservers:linux:nginx:dokuwiki [2025/07/16 14:06] (current) – [Service] Sean Rhone
Line 27: Line 27:
   * https://github.com/dokuwiki/dokuwiki/commits/master/   * https://github.com/dokuwiki/dokuwiki/commits/master/
  
-  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/srv/www/wiki' && sudo chown -R 'wwwrun' '/srv/www/wiki' +  sudo git clone --branch 'master' --depth '1' --recurse-submodules 'https://github.com/splitbrain/dokuwiki.git' '/srv/www/wiki' && sudo chown -R 'wwwrun':'www' '/srv/www/wiki'
- +
-  sudo semanage fcontext --add --type 'httpd_sys_rw_content_t' '/srv/www/wiki(/.*)?' && sudo restorecon -F -I -R '/srv/www/wiki'+
  
 ====== nginx + PHP-FPM Configuration ====== ====== nginx + PHP-FPM Configuration ======
Line 38: Line 36:
  
 <code> <code>
-; php-fpm.d/wiki.conf 
- 
 [wiki] [wiki]
  
Line 66: Line 62:
  
 ===== FastCGI ===== ===== FastCGI =====
 +
 +  * ''wiki.sock''
  
   sudo -e '/etc/nginx/default.d/wiki.conf'   sudo -e '/etc/nginx/default.d/wiki.conf'
  
 <code> <code>
-# PHP-FPM 
- 
 location ~ \.(php|phar)(/.*)?$ { location ~ \.(php|phar)(/.*)?$ {
     fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$;     fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$;
Line 166: Line 162:
   * 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 '/srv/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'nginx':'nginx' '/srv/www/wiki/conf/entities.local.conf'+  echo '--      --' | sudo tee '/srv/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'wwwrun':'www' '/srv/www/wiki/conf/entities.local.conf'
  
 ====== Services ====== ====== Services ======
Line 178: Line 174:
 <code> <code>
 [Service] [Service]
-User=nginx +User=wwwrun 
-Group=nginx+Group=www
 Type=oneshot Type=oneshot
 ExecStart='/usr/bin/git' -C '/srv/www/wiki' pull origin 'master' ExecStart='/usr/bin/git' -C '/srv/www/wiki' pull origin 'master'
Line 219: Line 215:
 [Service] [Service]
 User=wwwrun User=wwwrun
-#Group=www+Group=www
 Type=oneshot Type=oneshot
 WorkingDirectory=/srv/www/wiki WorkingDirectory=/srv/www/wiki
Line 251: Line 247:
 ===== Backup ===== ===== Backup =====
  
-  * This backs up an archive to the local disk and to a NAS+  * This backs up an archive to the local disk
  
 ==== Service ==== ==== Service ====
- 
-  * The extra ''ExecStart''s are additional backup locations that expect [[servers:linux:vsftpd#fstab1|vsftpd]] 
-  * 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'   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 265: Line 258:
 WorkingDirectory=/srv/www/wiki WorkingDirectory=/srv/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 "/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/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' ExecStartPost='/usr/bin/sync'
  
Line 342: Line 333:
 ==== Restore Folders ==== ==== Restore Folders ====
  
-  * TODO: ''tar -C''+  * TODO: ''tar -C or --directory=''
  
-  cd '/srv/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 '/srv/www/wiki' && sudo chown -R 'wwwrun' '/srv/www/wiki' && cd ~ && sync+  cd '/srv/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 'wwwrun' '/srv/www/wiki' && cd ~ && sync
  
 ==== Start nginx ==== ==== Start nginx ====
/srv/www/wiki/data/attic/servers/linux/nginx/dokuwiki.1752618960.txt.gz · Last modified: by Sean Rhone