servers:nginx:wordpress
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
servers:nginx:wordpress [2019/06/28 22:48] – Sean Rhone | servers:nginx:wordpress [2019/12/15 10:31] – [PHP-FPM Socket] Sean Rhone | ||
---|---|---|---|
Line 7: | Line 7: | ||
===== Prerequisites ===== | ===== Prerequisites ===== | ||
- | * [[distros:fedora_server|Fedora | + | * [[distros:ubuntu_server|Ubuntu |
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
- | * [[servers: | + | * [[servers: |
===== Notes ===== | ===== Notes ===== | ||
Line 20: | Line 20: | ||
**** | **** | ||
- | sudo git clone --branch ' | + | sudo git clone --branch ' |
- | + | ||
- | ===== SELinux ===== | + | |
- | + | ||
- | sudo semanage fcontext | + | |
- | + | ||
- | sudo semanage fcontext --add --type | + | |
- | + | ||
- | sudo restorecon -R -v '/ | + | |
====== Database ====== | ====== Database ====== | ||
- | mysql --user=' | + | |
CREATE DATABASE wordpress; | CREATE DATABASE wordpress; | ||
Line 39: | Line 31: | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | |||
+ | EXIT | ||
====== nginx + PHP-FPM Configuration ====== | ====== nginx + PHP-FPM Configuration ====== | ||
Line 44: | Line 38: | ||
===== PHP-FPM Socket ===== | ===== PHP-FPM Socket ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
[blog] | [blog] | ||
- | user = nginx | + | user = www-data |
- | group = nginx | + | group = www-data |
- | listen = /run/php-fpm/ | + | listen = / |
- | listen.owner = nginx | + | listen.owner = www-data |
- | listen.group = nginx | + | listen.group = www-data |
listen.allowed_clients = 127.0.0.1 | listen.allowed_clients = 127.0.0.1 | ||
Line 71: | Line 65: | ||
php_value[max_file_uploads] = " | php_value[max_file_uploads] = " | ||
- | php_value[session.save_handler] = files | + | php_value[session.save_handler] = "files" |
- | php_value[session.save_path] = / | + | php_value[session.save_path] = "/ |
- | php_value[soap.wsdl_cache_dir] = / | + | php_value[soap.wsdl_cache_dir] = "/ |
- | php_value[opcache.file_cache] = / | + | php_value[opcache.file_cache] = "/ |
===== FastCGI ===== | ===== FastCGI ===== | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 90: | Line 84: | ||
fastcgi_param SCRIPT_FILENAME | fastcgi_param SCRIPT_FILENAME | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
- | fastcgi_pass unix:/ | + | fastcgi_pass unix:/ |
}</ | }</ | ||
Line 97: | Line 91: | ||
* :!: '' | * :!: '' | ||
- | sudo -e '/ | + | sudo -e '/ |
< | < | ||
Line 106: | Line 100: | ||
index ' | index ' | ||
- | include '/ | + | include '/ |
- | include '/ | + | include '/ |
client_max_body_size ' | client_max_body_size ' | ||
Line 126: | Line 120: | ||
} | } | ||
}</ | }</ | ||
+ | |||
+ | ==== Enable ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo rm -f '/ | ||
====== Initial Setup ====== | ====== Initial Setup ====== | ||
Line 145: | Line 145: | ||
< | < | ||
[Service] | [Service] | ||
- | User=nginx | + | User=www-data |
- | Group=nginx | + | Group=www-data |
Type=oneshot | Type=oneshot | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost=' | + | ExecStartPost='/ |
==== Timer ==== | ==== Timer ==== | ||
Line 178: | Line 178: | ||
< | < | ||
[Service] | [Service] | ||
- | User=nginx | + | User=www-data |
- | Group=nginx | + | Group=www-data |
Type=oneshot | Type=oneshot | ||
ExecStart='/ | ExecStart='/ | ||
ExecStart='/ | ExecStart='/ | ||
- | ExecStartPost=' | + | ExecStartPost='/ |
==== Timer ==== | ==== Timer ==== | ||
Line 216: | Line 216: | ||
Type=oneshot | Type=oneshot | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
- | ExecStart=' | + | ExecStart='/ |
- | ExecStartPost=' | + | ExecStartPost='/ |
=== Timer === | === Timer === | ||
Line 256: | Line 256: | ||
WorkingDirectory=/ | WorkingDirectory=/ | ||
ExecStartPre='/ | ExecStartPre='/ | ||
- | ExecStart=' | + | ExecStart='/ |
- | ExecStart=' | + | ExecStart='/ |
- | ExecStartPost=' | + | ExecStartPost='/ |
=== Timer === | === Timer === | ||
Line 288: | Line 288: | ||
**** | **** | ||
- | sudo systemctl stop nginx php-fpm | + | sudo systemctl stop nginx php7.2-fpm |
==== Backup Folder ==== | ==== Backup Folder ==== | ||
Line 300: | Line 300: | ||
**** | **** | ||
- | sudo -u ' | + | sudo mysqldump --defaults-extra-file='/ |
==== Start Services ==== | ==== Start Services ==== | ||
Line 306: | Line 306: | ||
**** | **** | ||
- | sudo systemctl start nginx php-fpm | + | sudo systemctl start nginx php7.2-fpm |
===== Client ===== | ===== Client ===== | ||
Line 336: | Line 336: | ||
**** | **** | ||
- | rm -f ~/' | + | rm -f ~/' |
===== Server ===== | ===== Server ===== | ||
Line 344: | Line 344: | ||
**** | **** | ||
- | sudo systemctl stop nginx php-fpm | + | sudo systemctl stop nginx php7.2-fpm |
==== Remove Previous Folder ==== | ==== Remove Previous Folder ==== | ||
Line 356: | Line 356: | ||
**** | **** | ||
- | cd '/ | + | cd '/ |
- | + | ||
- | ==== SELinux ==== | + | |
- | + | ||
- | sudo semanage fcontext --deleteall "/ | + | |
- | + | ||
- | sudo semanage fcontext --add --type ' | + | |
- | + | ||
- | sudo restorecon -R -v '/ | + | |
==== Drop Previous Database ==== | ==== Drop Previous Database ==== | ||
- | mysql --user=' | + | |
DROP DATABASE wordpress; | DROP DATABASE wordpress; | ||
FLUSH TABLES; | FLUSH TABLES; | ||
+ | |||
+ | EXIT | ||
==== Re-create Databases ==== | ==== Re-create Databases ==== | ||
- | mysql --user=' | + | |
CREATE DATABASE wordpress; | CREATE DATABASE wordpress; | ||
+ | |||
+ | EXIT | ||
==== Restore Database ==== | ==== Restore Database ==== | ||
Line 384: | Line 380: | ||
**** | **** | ||
- | mysql --user=' | + | |
==== Reapply Permissions ==== | ==== Reapply Permissions ==== | ||
- | mysql --user=' | + | |
GRANT ALL PRIVILEGES ON wordpress.* to ' | GRANT ALL PRIVILEGES ON wordpress.* to ' | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | |||
+ | EXIT | ||
==== Start Services ==== | ==== Start Services ==== | ||
Line 398: | Line 396: | ||
**** | **** | ||
- | sudo systemctl start nginx php-fpm | + | sudo systemctl start nginx php7.2-fpm |
==== Remove Backups ==== | ==== Remove Backups ==== |
/var/www/wiki/data/pages/servers/nginx/wordpress.txt · Last modified: 2024/02/01 10:03 by Sean Rhone