servers:nginx:dokuwiki
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
servers:nginx:dokuwiki [2020/04/24 10:09] – 20.04 Sean Rhone | servers:nginx:dokuwiki [2024/02/07 16:34] – [Server Block] Sean Rhone | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * [[distros:ubuntu_server|Ubuntu | + | * [[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] = " | + | |
- | + | ||
- | php_value[session.save_handler] = " | + | |
- | php_value[session.save_path] = "/ | + | |
- | php_value[soap.wsdl_cache_dir] = "/ | + | |
- | php_value[opcache.file_cache] = "/ | + | |
===== FastCGI ===== | ===== FastCGI ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 61: | Line 68: | ||
location ~ \.(php|phar)(/ | location ~ \.(php|phar)(/ | ||
fastcgi_split_path_info ^(.+\.(?: | fastcgi_split_path_info ^(.+\.(?: | ||
- | |||
fastcgi_intercept_errors on; | fastcgi_intercept_errors on; | ||
fastcgi_index doku.php; | fastcgi_index doku.php; | ||
include fastcgi_params; | include fastcgi_params; | ||
- | fastcgi_param SCRIPT_FILENAME | + | 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:/ | + | |
+ | | ||
}</ | }</ | ||
===== Server Block ====== | ===== Server Block ====== | ||
- | sudo -e '/ | + | |
+ | |||
+ | | ||
< | < | ||
Line 81: | Line 90: | ||
index ' | index ' | ||
- | include '/ | + | include '/ |
- | include '/ | + | include '/ |
client_max_body_size ' | client_max_body_size ' | ||
- | | + | # |
+ | # add_header Content-Security-Policy " | ||
# access_log | # access_log | ||
Line 113: | Line 123: | ||
}</ | }</ | ||
- | ==== Enable | + | ====== Initial Setup ====== |
- | **** | + | |
- | | + | |
- | ====== | + | ====== |
- | * https:// | + | ===== Plugins ===== |
- | ====== Settings ====== | + | * https:// |
===== Template Style Settings ===== | ===== Template Style Settings ===== | ||
Line 136: | Line 146: | ||
* 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 147: | Line 158: | ||
* 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 159: | Line 170: | ||
< | < | ||
[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 178: | Line 192: | ||
[Timer] | [Timer] | ||
- | OnCalendar=*-*-* | + | OnCalendar=*-*-* 00:30:00 |
Persistent=true | Persistent=true | ||
[Install] | [Install] | ||
- | WantedBy=timers.target</ | + | WantedBy=timers.target |
+ | |||
+ | # End</ | ||
===== Maintenance ===== | ===== Maintenance ===== | ||
Line 196: | Line 212: | ||
< | < | ||
[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='/ | ||
- | ExecStartPost='/ | + | ExecStartPost=' |
+ | |||
+ | # End</ | ||
==== Timer ==== | ==== Timer ==== | ||
- | * '' | + | * '' |
sudo -e '/ | sudo -e '/ | ||
Line 218: | Line 236: | ||
[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 236: | Line 258: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart='/ | + | ExecStart=' |
- | ExecStartPost='/ | + | # |
+ | # | ||
+ | ExecStartPost=' | ||
+ | |||
+ | # End</ | ||
==== Timer ==== | ==== Timer ==== | ||
- | * Every day at '' | + | * Every day at '' |
sudo -e '/ | sudo -e '/ | ||
Line 250: | Line 276: | ||
[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 274: | Line 302: | ||
**** | **** | ||
- | scp espionage724@192.168.1.153: | + | scp espionage724@192.168.1.152: |
====== Restore ====== | ====== Restore ====== | ||
Line 284: | Line 312: | ||
**** | **** | ||
- | scp ~/' | + | scp ~/' |
==== Remove Archive ==== | ==== Remove Archive ==== | ||
Line 310: | Line 338: | ||
**** | **** | ||
- | cd '/ | + | cd '/ |
==== Start nginx ==== | ==== Start nginx ==== | ||
Line 323: | Line 351: | ||
rm -R ~/' | rm -R ~/' | ||
+ |
/var/www/wiki/data/pages/servers/nginx/dokuwiki.txt · Last modified: 2024/02/07 16:37 by Sean Rhone