servers:nginx:dokuwiki
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
servers:nginx:dokuwiki [2024/02/07 14:51] โ Sean Rhone | servers:nginx:dokuwiki [2024/08/13 22:15] (current) โ removed Sean Rhone | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Information ====== | ||
- | |||
- | * DokuWiki ((https:// | ||
- | * [[Information: | ||
- | * https:// | ||
- | |||
- | ===== Prerequisites ===== | ||
- | |||
- | * [[distros: | ||
- | * [[servers: | ||
- | * [[servers: | ||
- | |||
- | ====== Dependencies ====== | ||
- | |||
- | * https:// | ||
- | * PHP Modules: gd sodium zip xml mbstring intl bz2 | ||
- | |||
- | sudo apt install php8.2-gd php8.2-zip php8.2-xml php8.2-mbstring php8.2-intl php8.2-bz2 | ||
- | |||
- | ====== Download Source ====== | ||
- | |||
- | **** | ||
- | |||
- | sudo git clone --branch ' | ||
- | |||
- | ====== nginx + PHP-FPM Configuration ====== | ||
- | |||
- | ===== PHP-FPM Socket ===== | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [wiki] | ||
- | |||
- | ; User/Group | ||
- | user = nginx | ||
- | group = nginx | ||
- | |||
- | ; Socket | ||
- | listen = / | ||
- | listen.acl_users = nginx | ||
- | listen.allowed_clients = 127.0.0.1 | ||
- | |||
- | ; Process Management | ||
- | pm = ondemand | ||
- | pm.max_children = 4 | ||
- | pm.process_idle_timeout = 30 | ||
- | |||
- | ; Fedora php.ini Defaults | ||
- | php_value[session.save_handler] = " | ||
- | php_value[session.save_path] = "/ | ||
- | |||
- | ; General | ||
- | php_value[date.timezone] = " | ||
- | ; | ||
- | ; | ||
- | ; | ||
- | ; | ||
- | ; | ||
- | |||
- | ; End</ | ||
- | |||
- | ===== FastCGI ===== | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | # PHP-FPM | ||
- | location ~ \.(php|phar)(/ | ||
- | fastcgi_split_path_info ^(.+\.(?: | ||
- | fastcgi_intercept_errors on; | ||
- | fastcgi_index doku.php; | ||
- | include fastcgi_params; | ||
- | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
- | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
- | fastcgi_param HTTPS on; | ||
- | fastcgi_pass unix:/ | ||
- | }</ | ||
- | |||
- | ===== Server Block ====== | ||
- | |||
- | * 2023/09/12: CSPs disabled; TODO: Re-figure out CSPs | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | server { | ||
- | listen ' | ||
- | server_name ' | ||
- | root '/ | ||
- | index ' | ||
- | |||
- | include '/ | ||
- | include '/ | ||
- | |||
- | client_max_body_size ' | ||
- | |||
- | # add_header Content-Security-Policy " | ||
- | |||
- | # access_log | ||
- | # error_log | ||
- | |||
- | # location = / | ||
- | # deny all; | ||
- | # } | ||
- | |||
- | # location ~ / | ||
- | # deny all; | ||
- | # } | ||
- | |||
- | # location ~ /data/ { | ||
- | # internal; | ||
- | # } | ||
- | |||
- | location / { try_files $uri $uri/ @dokuwiki; } | ||
- | |||
- | location @dokuwiki { | ||
- | rewrite ^/ | ||
- | rewrite ^/ | ||
- | rewrite ^/ | ||
- | rewrite ^/(.*) / | ||
- | } | ||
- | }</ | ||
- | |||
- | ====== Initial Setup ====== | ||
- | |||
- | * :!: TODO: https:// | ||
- | |||
- | * https:// | ||
- | |||
- | ====== Settings ====== | ||
- | |||
- | ===== Plugins ===== | ||
- | |||
- | * https:// | ||
- | |||
- | ===== Template Style Settings ===== | ||
- | |||
- | * Alternative background color: ''# | ||
- | * The general link color: ''# | ||
- | * :!: The width of the full site: '' | ||
- | |||
- | ===== nginx Server Block Deny Directives ===== | ||
- | |||
- | * Uncomment commented sections (except logs) | ||
- | * Do after initial setup | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | ===== URL Rewrite ===== | ||
- | |||
- | * Admin -> Configuration Settings -> DokuWiki -> Advanced -> userewrite | ||
- | |||
- | .htaccess | ||
- | |||
- | ===== Double-hyphen Convert Disable ===== | ||
- | |||
- | * This prevents -- from becoming a โ (long hyphen), which breaks some command' | ||
- | |||
- | echo ' | ||
- | |||
- | ====== Services ====== | ||
- | |||
- | ===== Updater ===== | ||
- | |||
- | ==== Service ==== | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [Service] | ||
- | User=nginx | ||
- | Group=nginx | ||
- | Type=oneshot | ||
- | ExecStart='/ | ||
- | ExecStartPost='/ | ||
- | ExecStartPost='/ | ||
- | |||
- | # End</ | ||
- | |||
- | ==== Timer ==== | ||
- | |||
- | * Every day at '' | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [Unit] | ||
- | Description=DokuWiki Git Updater | ||
- | After=network-online.target | ||
- | Wants=network-online.target | ||
- | |||
- | [Timer] | ||
- | OnCalendar=*-*-* 00:30:00 | ||
- | Persistent=true | ||
- | |||
- | [Install] | ||
- | WantedBy=timers.target | ||
- | |||
- | # End</ | ||
- | |||
- | ===== Maintenance ===== | ||
- | |||
- | * https:// | ||
- | |||
- | ==== Service ==== | ||
- | |||
- | * :!: The commented '' | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [Service] | ||
- | User=nginx | ||
- | Group=nginx | ||
- | Type=oneshot | ||
- | WorkingDirectory=/ | ||
- | ExecStart='/ | ||
- | ExecStart='/ | ||
- | # | ||
- | ExecStart='/ | ||
- | ExecStart='/ | ||
- | ExecStartPost='/ | ||
- | |||
- | # End</ | ||
- | |||
- | ==== Timer ==== | ||
- | |||
- | * '' | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [Unit] | ||
- | Description=DokuWiki Maintenance | ||
- | |||
- | [Timer] | ||
- | OnCalendar=*-*-01 01:00:00 | ||
- | Persistent=true | ||
- | |||
- | [Install] | ||
- | WantedBy=timers.target | ||
- | |||
- | # End</ | ||
- | |||
- | ===== Backup ===== | ||
- | |||
- | * This backs up an archive to the local disk and to a NAS | ||
- | |||
- | ==== Service ==== | ||
- | |||
- | * :!: The extra '' | ||
- | |||
- | mkdir -p ~/' | ||
- | |||
- | < | ||
- | [Service] | ||
- | Type=oneshot | ||
- | WorkingDirectory=/ | ||
- | ExecStart='/ | ||
- | # | ||
- | # | ||
- | ExecStartPost='/ | ||
- | |||
- | # End</ | ||
- | |||
- | ==== Timer ==== | ||
- | |||
- | * Every day at '' | ||
- | |||
- | sudo -e '/ | ||
- | |||
- | < | ||
- | [Unit] | ||
- | Description=DokuWiki Files Backup | ||
- | |||
- | [Timer] | ||
- | OnCalendar=*-*-* 01:30:00 | ||
- | Persistent=true | ||
- | |||
- | [Install] | ||
- | WantedBy=timers.target | ||
- | |||
- | # End</ | ||
- | |||
- | ====== Backup ====== | ||
- | |||
- | * Create backup archive on server and transfer to client computer | ||
- | |||
- | ===== Server ===== | ||
- | |||
- | ==== Archive Folders ==== | ||
- | |||
- | **** | ||
- | |||
- | cd '/ | ||
- | |||
- | ===== Client ===== | ||
- | |||
- | ==== Transfer Archive to Client ==== | ||
- | |||
- | **** | ||
- | |||
- | scp espionage724@192.168.1.152: | ||
- | |||
- | ====== Restore ====== | ||
- | |||
- | ===== Client ===== | ||
- | |||
- | ==== Transfer Archive to Server ==== | ||
- | |||
- | **** | ||
- | |||
- | scp ~/' | ||
- | |||
- | ==== Remove Archive ==== | ||
- | |||
- | **** | ||
- | |||
- | rm ~/' | ||
- | |||
- | ===== Server ===== | ||
- | |||
- | ==== Stop nginx ==== | ||
- | |||
- | **** | ||
- | |||
- | sudo systemctl stop ' | ||
- | |||
- | ==== Remove Previous Folders ==== | ||
- | |||
- | **** | ||
- | |||
- | ls ~/' | ||
- | |||
- | ==== Restore Folders ==== | ||
- | |||
- | **** | ||
- | |||
- | cd '/ | ||
- | |||
- | ==== Start nginx ==== | ||
- | |||
- | **** | ||
- | |||
- | sudo systemctl start ' | ||
- | |||
- | ==== Remove Archive ==== | ||
- | |||
- | * Verify that DokuWiki works before running | ||
- | |||
- | rm -R ~/' | ||
/srv/www/wiki/data/attic/servers/nginx/dokuwiki.1707335517.txt.gz ยท Last modified: (external edit)