servers:nginx:wordpress
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:wordpress [2019/06/28 22:48] – Sean Rhone | servers:nginx:wordpress [2023/09/13 03:35] – [Timer] Sean Rhone | ||
---|---|---|---|
Line 8: | Line 8: | ||
* [[distros: | * [[distros: | ||
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
===== Notes ===== | ===== Notes ===== | ||
- | * :!: Do not initiate any updates from the Admin/ | + | * :!: Do not initiate any updates from the Admin/ |
- | ====== | + | ====== |
- | **** | + | |
+ | | ||
- | sudo git clone --branch ' | + | sudo dnf install php-mysqlnd php-xml php-pecl-igbinary php-imagick php-intl php-mbstring php-pecl-zip php-sodium php-bcmath php-gd php-process |
- | ===== SELinux | + | ====== Download Source ====== |
- | sudo semanage fcontext --deleteall "/ | + | **** |
- | + | ||
- | sudo semanage fcontext --add --type ' | + | |
- | sudo restorecon -R -v '/ | + | |
====== Database ====== | ====== Database ====== | ||
- | | + | |
CREATE DATABASE wordpress; | CREATE DATABASE wordpress; | ||
Line 39: | Line 38: | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | |||
+ | EXIT | ||
====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== | ||
Line 48: | Line 49: | ||
< | < | ||
[blog] | [blog] | ||
+ | |||
+ | ; User/Group | ||
user = nginx | user = nginx | ||
group = nginx | group = nginx | ||
+ | ; Socket | ||
listen = / | listen = / | ||
- | listen.owner = nginx | + | listen.acl_users |
- | listen.group | + | |
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 | + | |
- | php_value[date.timezone] = "America/ | + | ; Fedora php.ini Defaults |
- | php_value[upload_tmp_dir] = "/tmp" | + | php_value[session.save_handler] = "files" |
+ | php_value[session.save_path] = "/var/ | ||
+ | ; General | ||
+ | php_value[date.timezone] = " | ||
php_value[max_execution_time] = " | php_value[max_execution_time] = " | ||
php_value[memory_limit] = " | php_value[memory_limit] = " | ||
Line 71: | Line 76: | ||
php_value[max_file_uploads] = " | php_value[max_file_uploads] = " | ||
- | php_value[session.save_handler] = files | + | ; End</code> |
- | php_value[session.save_path] = /var/ | + | |
- | php_value[soap.wsdl_cache_dir] = / | + | < |
- | php_value[opcache.file_cache] = /var/ | + | php_value[upload_tmp_dir] = "/tmp"</ |
===== FastCGI ===== | ===== FastCGI ===== | ||
Line 84: | Line 89: | ||
location ~ \.(php|phar)(/ | location ~ \.(php|phar)(/ | ||
fastcgi_split_path_info ^(.+\.(?: | fastcgi_split_path_info ^(.+\.(?: | ||
- | |||
fastcgi_intercept_errors on; | fastcgi_intercept_errors on; | ||
fastcgi_index index.php; | fastcgi_index index.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:/ | fastcgi_pass unix:/ | ||
Line 95: | Line 99: | ||
===== Server Block ===== | ===== Server Block ===== | ||
- | * :!: '' | + | * 2023/09/12: CSPs disabled; TODO: Re-figure out CSPs |
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 111: | Line 115: | ||
client_max_body_size ' | client_max_body_size ' | ||
- | | + | # |
- | # access_log | + | # access_log |
- | # error_log | + | # error_log |
location / { | location / { | ||
Line 187: | Line 191: | ||
==== Timer ==== | ==== Timer ==== | ||
- | * '' | + | * '' |
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 216: | Line 220: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart='/ | + | ExecStart='/ |
ExecStartPost='/ | ExecStartPost='/ | ||
Line 240: | Line 244: | ||
=== Database Auth === | === Database Auth === | ||
- | sudo -u ' | + | sudo mkdir -p '/var/lib/mysql/auth' |
< | < | ||
- | [mysqldump] | + | [mariadb-dump] |
user=wordpress | user=wordpress | ||
password=x</ | password=x</ | ||
Line 249: | Line 253: | ||
=== Service === | === Service === | ||
- | mkdir -p ~/' | + | mkdir -p ~/' |
< | < | ||
Line 255: | Line 259: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStartPre='/ | + | ExecStartPre='/ |
ExecStart='/ | ExecStart='/ | ||
ExecStart='/ | ExecStart='/ | ||
Line 300: | Line 304: | ||
**** | **** | ||
- | sudo -u ' | + | sudo mariadb-dump --defaults-extra-file='/ |
==== Start Services ==== | ==== Start Services ==== | ||
Line 314: | Line 318: | ||
**** | **** | ||
- | scp espionage724@192.168.1.153: | + | scp espionage724@192.168.1.152: |
====== Restore ====== | ====== Restore ====== | ||
Line 330: | Line 334: | ||
**** | **** | ||
- | scp ~/' | + | scp ~/' |
==== Remove Files ==== | ==== Remove Files ==== | ||
Line 336: | Line 340: | ||
**** | **** | ||
- | rm -f ~/' | + | rm -f ~/' |
===== Server ===== | ===== Server ===== | ||
Line 356: | Line 360: | ||
**** | **** | ||
- | cd '/ | + | cd '/ |
- | + | ||
- | ==== SELinux ==== | + | |
- | + | ||
- | sudo semanage fcontext --deleteall "/ | + | |
- | + | ||
- | | + | |
- | + | ||
- | | + | |
==== Drop Previous Database ==== | ==== Drop Previous Database ==== | ||
- | | + | |
DROP DATABASE wordpress; | DROP DATABASE wordpress; | ||
FLUSH TABLES; | FLUSH TABLES; | ||
+ | |||
+ | EXIT | ||
==== Re-create Databases ==== | ==== Re-create Databases ==== | ||
- | | + | |
CREATE DATABASE wordpress; | CREATE DATABASE wordpress; | ||
+ | |||
+ | EXIT | ||
==== Restore Database ==== | ==== Restore Database ==== | ||
Line 384: | Line 384: | ||
**** | **** | ||
- | | + | |
==== Reapply Permissions ==== | ==== Reapply Permissions ==== | ||
- | | + | |
GRANT ALL PRIVILEGES ON wordpress.* to ' | GRANT ALL PRIVILEGES ON wordpress.* to ' | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | |||
+ | EXIT | ||
==== Start Services ==== | ==== Start Services ==== | ||
Line 405: | Line 407: | ||
rm ~/' | rm ~/' | ||
+ |
/var/www/wiki/data/pages/servers/nginx/wordpress.txt · Last modified: 2024/02/01 10:03 by Sean Rhone