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 [2019/06/09 04:58] – [Template Style Settings] Sean Rhone | servers:nginx:dokuwiki [2024/02/07 16:37] (current) – [Server Block] Sean Rhone | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * [[distros:ubuntu_server | + | * [[distros:fedora_server|Fedora |
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
+ | |||
+ | ====== Dependencies ====== | ||
+ | |||
+ | * PHP Modules: gd sodium zip zlib xml | ||
+ | |||
+ | sudo dnf install php-gd php-sodium php-pecl-zip php-xml | ||
====== Download Source ====== | ====== Download Source ====== | ||
Line 15: | Line 21: | ||
**** | **** | ||
- | sudo git clone --branch ' | + | sudo git clone --branch ' |
====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== | ||
Line 21: | Line 27: | ||
===== PHP-FPM Socket ===== | ===== PHP-FPM Socket ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
[wiki] | [wiki] | ||
- | user = www-data | ||
- | group = www-data | ||
- | listen = / | + | ; User/ |
- | listen.owner = www-data | + | user = nginx |
- | listen.group = www-data | + | group = nginx |
+ | |||
+ | ; Socket | ||
+ | listen = /run/php-fpm/ | ||
+ | listen.acl_users | ||
listen.allowed_clients = 127.0.0.1 | listen.allowed_clients = 127.0.0.1 | ||
- | pm = dynamic | + | ; Process Management |
- | pm.max_children = 8 | + | pm = ondemand |
- | pm.start_servers | + | pm.max_children = 4 |
- | pm.min_spare_servers = 2 | + | pm.process_idle_timeout |
- | pm.max_spare_servers = 4 | + | |
+ | ; Fedora php.ini Defaults | ||
+ | php_value[session.save_handler] = " | ||
+ | php_value[session.save_path] = "/ | ||
+ | |||
+ | ; General | ||
php_value[date.timezone] = " | php_value[date.timezone] = " | ||
- | php_value[upload_tmp_dir] = "/tmp" | + | ;php_value[max_execution_time] = "200" |
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
- | php_value[max_execution_time] = " | + | ; End</ |
- | php_value[memory_limit] = " | + | |
- | php_value[post_max_size] = " | + | |
- | php_value[upload_max_filesize] = " | + | |
- | php_value[max_file_uploads] = " | + | |
===== FastCGI ===== | ===== FastCGI ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
- | location ~ \.php$ { | + | # PHP-FPM |
- | fastcgi_split_path_info ^(.+\.php)(/ | + | location ~ \.(php|phar)(/ |
- | try_files $fastcgi_script_name =404; | + | fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$; |
- | set $path_info $fastcgi_path_info; | + | |
- | fastcgi_param PATH_INFO $path_info; | + | |
- | fastcgi_index doku.php; | + | |
- | include / | + | |
fastcgi_intercept_errors on; | fastcgi_intercept_errors on; | ||
- | fastcgi_param SCRIPT_FILENAME | + | |
+ | include fastcgi_params; | ||
+ | | ||
+ | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_param HTTPS on; | fastcgi_param HTTPS on; | ||
- | fastcgi_pass unix:/ | + | fastcgi_pass unix:/ |
}</ | }</ | ||
===== Server Block ====== | ===== Server Block ====== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 77: | Line 88: | ||
index ' | index ' | ||
- | include '/ | + | include '/ |
- | include '/ | + | include '/ |
client_max_body_size ' | client_max_body_size ' | ||
Line 84: | Line 95: | ||
add_header Content-Security-Policy " | add_header Content-Security-Policy " | ||
- | # access_log / | + | # access_log |
- | # error_log / | + | # error_log |
# location = / | # location = / | ||
Line 108: | Line 119: | ||
} | } | ||
}</ | }</ | ||
- | |||
- | ==== Enable Server Block ==== | ||
- | |||
- | **** | ||
- | |||
- | sudo rm -f '/ | ||
====== Initial Setup ====== | ====== Initial Setup ====== | ||
+ | |||
+ | * :!: TODO: https:// | ||
* https:// | * https:// | ||
====== Settings ====== | ====== Settings ====== | ||
+ | |||
+ | ===== Plugins ===== | ||
+ | |||
+ | * https:// | ||
===== Template Style Settings ===== | ===== Template Style Settings ===== | ||
Line 132: | Line 143: | ||
* Do after initial setup | * Do after initial setup | ||
- | sudo -e '/ | + | sudo -e '/ |
===== URL Rewrite ===== | ===== URL Rewrite ===== | ||
- | * Admin -> Configuration Settings | + | * Admin -> Configuration Settings |
- | | + | |
+ | .htaccess | ||
===== Double-hyphen Convert Disable ===== | ===== Double-hyphen Convert Disable ===== | ||
Line 143: | Line 155: | ||
* This prevents -- from becoming a – (long hyphen), which breaks some command' | * This prevents -- from becoming a – (long hyphen), which breaks some command' | ||
- | echo ' | + | echo ' |
====== Services ====== | ====== Services ====== | ||
Line 155: | Line 167: | ||
< | < | ||
[Service] | [Service] | ||
- | User=www-data | + | User=nginx |
- | Group=www-data | + | Group=nginx |
Type=oneshot | Type=oneshot | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost='/ | + | ExecStartPost=' |
+ | ExecStartPost='/ | ||
+ | |||
+ | # End</ | ||
==== Timer ==== | ==== Timer ==== | ||
- | * Every day at '' | + | * Every day at '' |
sudo -e '/ | sudo -e '/ | ||
Line 174: | Line 189: | ||
[Timer] | [Timer] | ||
- | OnCalendar=*-*-* | + | OnCalendar=*-*-* 00:30:00 |
Persistent=true | Persistent=true | ||
[Install] | [Install] | ||
- | WantedBy=timers.target</ | + | WantedBy=timers.target |
+ | |||
+ | # End</ | ||
===== Maintenance ===== | ===== Maintenance ===== | ||
Line 185: | Line 202: | ||
==== Service ==== | ==== Service ==== | ||
+ | |||
+ | * :!: The commented '' | ||
sudo -e '/ | sudo -e '/ | ||
Line 190: | Line 209: | ||
< | < | ||
[Service] | [Service] | ||
- | User=www-data | + | User=nginx |
- | Group=www-data | + | Group=nginx |
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
ExecStart='/ | ExecStart='/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStart='/ | + | #ExecStart=' |
- | ExecStart='/ | + | ExecStart=' |
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost='/ | + | ExecStartPost=' |
+ | |||
+ | # End</ | ||
==== Timer ==== | ==== Timer ==== | ||
- | * '' | + | * '' |
sudo -e '/ | sudo -e '/ | ||
Line 212: | Line 233: | ||
[Timer] | [Timer] | ||
- | OnCalendar=*-*-01 01:20:00 | + | OnCalendar=*-*-01 01:00:00 |
Persistent=true | Persistent=true | ||
[Install] | [Install] | ||
- | WantedBy=timers.target</ | + | WantedBy=timers.target |
+ | |||
+ | # End</ | ||
===== Backup ===== | ===== Backup ===== | ||
- | * This backs up an archive to the local disk and [[distros: | + | * This backs up an archive to the local disk and to a NAS |
==== Service ==== | ==== Service ==== | ||
+ | |||
+ | * :!: The extra '' | ||
mkdir -p ~/' | mkdir -p ~/' | ||
Line 230: | Line 255: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart='/ | + | ExecStart=' |
- | ExecStartPost='/ | + | # |
+ | # | ||
+ | ExecStartPost=' | ||
+ | |||
+ | # End</ | ||
==== Timer ==== | ==== Timer ==== | ||
- | * Every day at '' | + | * Every day at '' |
sudo -e '/ | sudo -e '/ | ||
Line 244: | Line 273: | ||
[Timer] | [Timer] | ||
- | OnCalendar=*-*-* 01:50:00 | + | OnCalendar=*-*-* 01:30:00 |
Persistent=true | Persistent=true | ||
[Install] | [Install] | ||
- | WantedBy=timers.target</ | + | WantedBy=timers.target |
+ | |||
+ | # End</ | ||
====== Backup ====== | ====== Backup ====== | ||
Line 268: | Line 299: | ||
**** | **** | ||
- | scp espionage724@192.168.1.153: | + | scp espionage724@192.168.1.152: |
====== Restore ====== | ====== Restore ====== | ||
Line 278: | Line 309: | ||
**** | **** | ||
- | scp ~/' | + | scp ~/' |
==== Remove Archive ==== | ==== Remove Archive ==== | ||
Line 304: | Line 335: | ||
**** | **** | ||
- | cd '/ | + | cd '/ |
==== Start nginx ==== | ==== Start nginx ==== | ||
Line 317: | Line 348: | ||
rm -R ~/' | rm -R ~/' | ||
+ |
/var/www/wiki/data/attic/servers/nginx/dokuwiki.1560070688.txt.gz · Last modified: 2019/06/09 04:58 by Sean Rhone