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 [2026/01/01 02:46] – Ubuntu -> oS TW (WIP) Sean Rhoneservers:linux:nginx:dokuwiki [2026/04/19 15:16] (current) – [PHP-FPM Socket] openSUSE TW -> Ubuntu LTS (WIP, last few revs too) Sean Rhone
Line 7: Line 7:
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (Server)]]+  * [[linux:distros:server:ubuntu_server_lts|Ubuntu Server (LTS)]]
   * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]   * [[servers:linux:nginx_php_php-fpm|nginx + PHP + PHP-FPM]]
   * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]]   * [[servers:linux:nginx:lets_encrypt|Certbot (Let's Encrypt)]]
Line 16: Line 16:
   * https://www.dokuwiki.org/install:php   * https://www.dokuwiki.org/install:php
   * https://github.com/dokuwiki/dokuwiki/blob/master/composer.json   * https://github.com/dokuwiki/dokuwiki/blob/master/composer.json
 +
 +  sudo apt install git php-bz2 php-gd php-intl php-mbstring php-xml
  
   sudo zypper install php8-bz2 php8-gd php8-intl php8-mbstring php8-sodium php8-zlib   sudo zypper install php8-bz2 php8-gd php8-intl php8-mbstring php8-sodium php8-zlib
Line 23: Line 25:
   * 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':'www' '/srv/www/wiki' && sudo chmod -R '0755' '/srv/www/wiki'+  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 ======
Line 29: Line 31:
 ===== PHP-FPM Socket ===== ===== PHP-FPM Socket =====
  
-  sudo -e '/etc/php/8.4/fpm/pool.d/wiki.conf' && sudo systemctl restart 'php8.4-fpm'+  sudo -e '/etc/php/8.3/fpm/pool.d/wiki.conf' && sudo systemctl restart 'php8.3-fpm' 
 + 
 +  sudo -e '/etc/php8/fpm/php-fpm.d/wiki.conf' && sudo systemctl restart 'php-fpm'
  
 <code> <code>
Line 39: Line 43:
  
 ; Socket ; Socket
-listen = "/run/php/wiki.sock"+listen = "/run/php-fpm/wiki.sock"
 listen.owner = "wwwrun" listen.owner = "wwwrun"
 listen.group = "www" listen.group = "www"
Line 52: Line 56:
 php_value[log_errors] = "0" php_value[log_errors] = "0"
 php_value[error_reporting] = "~E_ALL" php_value[error_reporting] = "~E_ALL"
 +
 +; openSUSE php.ini Defaults
 +php_value[session.save_path] = "/var/lib/php8/sessions"
  
 ; General ; General
Line 60: Line 67:
 ===== FastCGI ===== ===== FastCGI =====
  
-  sudo -e '/etc/nginx/snippets/wiki.conf'+  sudo -e '/etc/nginx/default.d/wiki.conf'
  
 <code> <code>
Line 73: Line 80:
  fastcgi_param 'HTTPS' 'on';  fastcgi_param 'HTTPS' 'on';
  
- fastcgi_pass 'unix:/run/php/wiki.sock';+ fastcgi_pass 'unix:/run/php-fpm/wiki.sock';
  
 } }
Line 81: Line 88:
 ===== Server Block ====== ===== Server Block ======
  
-  sudo -e '/etc/nginx/sites-available/wiki.conf'+  sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx'
  
 <code> <code>
 server { server {
  
- listen '443' 'ssl'+ listen '443' 'ssl' 'http2';
- http2 'on';+
  server_name 'wiki.realmofespionage.xyz';  server_name 'wiki.realmofespionage.xyz';
  root '/srv/www/wiki';  root '/srv/www/wiki';
  index 'doku.php';  index 'doku.php';
  
- include '/etc/nginx/snippets/wiki.conf'; + include '/etc/nginx/default.d/wiki.conf'; 
- include '/etc/nginx/snippets/headers.conf';+ include '/etc/nginx/default.d/headers.conf';
  
  client_max_body_size '10M';  client_max_body_size '10M';
Line 99: Line 105:
  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 '/srv/log/nginx/wiki-access.log'; +# access_log '/var/log/nginx/wiki-access.log'; 
-# error_log '/srv/log/nginx/wiki-error.log';+# error_log '/var/log/nginx/wiki-error.log';
  
 # location = '/install.php' { # location = '/install.php' {
Line 128: Line 134:
  
 # End</code> # End</code>
- 
-  sudo ln -s -f '/etc/nginx/sites-available/wiki.conf' '/etc/nginx/sites-enabled/wiki.conf' && sudo systemctl reload 'nginx' 
  
 ====== Initial Setup ====== ====== Initial Setup ======
Line 136: Line 140:
  
 ====== Settings ====== ====== Settings ======
- 
-===== Plugins ===== 
- 
-  * https://www.dokuwiki.org/plugin:searchindex 
  
 ===== Template Style Settings ===== ===== Template Style Settings =====
Line 152: Line 152:
   * Do after initial setup   * Do after initial setup
  
-  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'+  sudo -e '/etc/nginx/vhosts.d/wiki.conf' && sudo systemctl reload 'nginx'
  
 ===== URL Rewrite ===== ===== URL Rewrite =====
Line 164: Line 164:
   * 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 -u 'wwwrun' tee '/srv/www/wiki/conf/entities.local.conf' > '/dev/null'+  echo '--      --' | sudo tee '/srv/www/wiki/conf/entities.local.conf' > '/dev/null' && sudo chown 'wwwrun':'www' '/srv/www/wiki/conf/entities.local.conf'
  
 ====== Scripts ====== ====== Scripts ======
Line 198: Line 198:
 # End</code> # End</code>
  
-  sudo -u 'wwwrun' '/etc/nginx/scripts/wiki/git-fix.sh'+==== Execute ==== 
 + 
 +  sudo su 'wwwrun' -s '/bin/bash' 
 + 
 +  '/etc/nginx/scripts/wiki/git-fix.sh' 
 + 
 +  exit
  
 ====== Services ====== ====== Services ======
Line 248: Line 254:
  
 ===== Backup ===== ===== Backup =====
- 
-  * TODO: NAS mount 
  
 ==== Service ==== ==== Service ====
Line 393: Line 397:
  
   git -C '/srv/www/wiki' fsck --full --strict   git -C '/srv/www/wiki' fsck --full --strict
 +
 +  exit
 +
 +===== Indexer =====
 +
 +  sudo su 'wwwrun' -s '/bin/bash'
 +
 +  cd '/srv/www/wiki' && '/usr/bin/php' '/srv/www/wiki/bin/indexer.php' --clear
  
   exit   exit
/var/www/wiki/data/attic/servers/linux/nginx/dokuwiki.1767253603.txt.gz · Last modified: by Sean Rhone

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki