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 revisionBoth sides next revision
servers:nginx:dokuwiki [2020/04/24 10:09] – 20.04 Sean Rhoneservers:nginx:dokuwiki [2020/12/19 03:05] – openSUSE TW Sean Rhone
Line 7: Line 7:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[distros:ubuntu_server|Ubuntu Server]] ((Last tested on 20.04))+  * [[distros:opensuse_tumbleweed_server|openSUSE Tumbleweed]]
   * [[servers:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]   * [[servers:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]
   * [[servers:nginx:lets_encrypt|Let's Encrypt]]   * [[servers:nginx:lets_encrypt|Let's Encrypt]]
Line 15: Line 15:
 **** ****
  
-  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' && sync+  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' && sync
  
 ====== nginx + PHP-FPM Configuration ====== ====== nginx + PHP-FPM Configuration ======
Line 21: Line 21:
 ===== PHP-FPM Socket ===== ===== PHP-FPM Socket =====
  
-  sudo -e '/etc/php/7.4/fpm/pool.d/wiki.conf' && sudo systemctl restart 'php7.4-fpm'+  sudo -e '/etc/php7/fpm/php-fpm.d/wiki.conf' && sudo systemctl restart 'php-fpm'
  
 <code> <code>
 [wiki] [wiki]
-user = www-data +user = wwwrun 
-group = www-data+group = www
  
-listen = /run/php/wiki.sock +listen = 127.0.0.1:9001 
-listen.owner = www-data +listen.owner = wwwrun 
-listen.group = www-data+listen.group = www
 listen.allowed_clients = 127.0.0.1 listen.allowed_clients = 127.0.0.1
  
-pm = dynamic +pm = ondemand 
-pm.max_children = 8 +pm.max_children = 4 
-pm.start_servers +pm.process_idle_timeout 30
-pm.min_spare_servers = 2 +
-pm.max_spare_servers = 4+
  
-php_value[date.timezone] = "America/New_York+php_value[date.timezone] = "America/New_York"</code>
-php_value[upload_tmp_dir] = "/tmp" +
- +
-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" +
- +
-php_value[session.save_handler] = "files" +
-php_value[session.save_path] = "/var/lib/php/sessions" +
-php_value[soap.wsdl_cache_dir] = "/var/lib/php/wsdlcache" +
-php_value[opcache.file_cache] = "/var/lib/php/opcache"</code>+
  
 ===== FastCGI ===== ===== FastCGI =====
  
-  sudo -e '/etc/nginx/snippets/wiki.conf'+  sudo -e '/etc/nginx/snippets.d/wiki.conf'
  
 <code> <code>
Line 67: Line 53:
     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_pass unix:/run/php/wiki.sock;+    fastcgi_pass 127.0.0.1:9001;
 }</code> }</code>
  
 ===== Server Block ====== ===== Server Block ======
  
-  sudo -e '/etc/nginx/sites-available/wiki.conf'+  sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx' && sync
  
 <code> <code>
Line 78: Line 64:
     listen '443' 'ssl' 'http2';     listen '443' 'ssl' 'http2';
     server_name 'wiki.realmofespionage.xyz';     server_name 'wiki.realmofespionage.xyz';
-    root '/var/www/wiki';+    root '/srv/www/wiki';
     index 'doku.php';     index 'doku.php';
  
-    include '/etc/nginx/snippets/wiki.conf'; +    include 'snippets.d/wiki.conf'; 
-    include '/etc/nginx/snippets/headers.conf';+    include 'snippets.d/headers.conf';
  
     client_max_body_size '10M';     client_max_body_size '10M';
Line 112: Line 98:
     }     }
 }</code> }</code>
- 
-==== Enable ===== 
- 
-**** 
- 
-  sudo rm -f '/etc/nginx/sites-enabled/wiki.conf' && sudo ln -s '/etc/nginx/sites-available/wiki.conf' '/etc/nginx/sites-enabled/wiki.conf' && sudo systemctl reload 'nginx' && sync 
  
 ====== Initial Setup ====== ====== Initial Setup ======
Line 136: Line 116:
   * Do after initial setup   * Do after initial setup
  
-  sudo -e '/etc/nginx/sites-available/wiki.conf' && sudo systemctl reload 'nginx'+  sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx'
  
 ===== URL Rewrite ===== ===== URL Rewrite =====
Line 147: Line 127:
   * 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 'www-data':'www-data' '/var/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 159: Line 139:
 <code> <code>
 [Service] [Service]
-User=www-data +User=wwwrun 
-Group=www-data+Group=www
 Type=oneshot Type=oneshot
-ExecStart='/usr/bin/git' -C '/var/www/wiki' pull origin 'master' +ExecStart='/usr/bin/git' -C '/srv/www/wiki' pull origin 'master' 
-ExecStartPost='/bin/sync'</code>+ExecStartPost='/usr/bin/sync'</code>
  
 ==== Timer ==== ==== Timer ====
Line 196: Line 176:
 <code> <code>
 [Service] [Service]
-User=www-data +User=wwwrun 
-Group=www-data+Group=www
 Type=oneshot Type=oneshot
-WorkingDirectory=/var/www/wiki +WorkingDirectory=/srv/www/wiki 
-ExecStart='/usr/bin/git' -C '/var/www/wiki' gc --aggressive --prune='all' +ExecStart='/usr/bin/git' -C '/srv/www/wiki' gc --aggressive --prune='all' 
-ExecStart='/usr/bin/git' -C '/var/www/wiki' fsck --full --strict +ExecStart='/usr/bin/git' -C '/srv/www/wiki' fsck --full --strict 
-#ExecStart='/bin/bash' -c "find '/var/www/wiki/data'/{attic,cache,locks,media_attic}/ -type 'f' -mtime +'90' -delete" +#ExecStart='/usr/bin/bash' -c "find '/srv/www/wiki/data'/{attic,cache,locks,media_attic}/ -type 'f' -mtime +'90' -delete" 
-ExecStart='/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 '/srv/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' '/srv/www/wiki/bin/indexer.php' --clear 
-ExecStartPost='/bin/sync'</code>+ExecStartPost='/usr/bin/sync'</code>
  
 ==== Timer ==== ==== Timer ====
/var/www/wiki/data/pages/servers/nginx/dokuwiki.txt · Last modified: 2024/02/07 16:37 by Sean Rhone