From 497bbb6324915be6f4b7419d62d721a73c956a26 Mon Sep 17 00:00:00 2001 From: Fabrice Quenneville Date: Mon, 3 Feb 2025 10:16:59 -0500 Subject: [PATCH] Added information on installing and setting up wp-cli. --- setups-drafts/almalinux_setup_wordpress.md | 37 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/setups-drafts/almalinux_setup_wordpress.md b/setups-drafts/almalinux_setup_wordpress.md index 15612f2..b340db7 100644 --- a/setups-drafts/almalinux_setup_wordpress.md +++ b/setups-drafts/almalinux_setup_wordpress.md @@ -257,6 +257,9 @@ ssh-copy-id -i @ dnf install -y httpd mod_ssl php php-cli php-common php-fpm php-gd php-intl php-json php-mbstring php-mysqlnd php-opcache php-pdo php-pecl-imagick php-xml php-zip policycoreutils-python-utils # Other xml php modules dnf install -y php-dom php-simplexml php-xmlreader php-iconv php-posix php-sockets php-tokenizer + + # Necessary for wp-cli + dnf install -y php-cli php-mbstring unzip curl ``` **WordPress Dependencies on AlmaLinux (MariaDB)** @@ -441,7 +444,29 @@ ssh-copy-id -i @ cp -r wordpress/* /var/www/html/ ``` -16. **Modify Permissions** +16. **Download and Install WordPress CLI** + + As root + + ```bash + curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar + php wp-cli.phar --info + chmod +x wp-cli.phar + mv wp-cli.phar /usr/local/bin/wp + wp --info + ``` + + As user **Enable Tab Completion** + + ```bash + su -s /bin/bash -l apache + mkdir -p ~/.wp-cli + wp cli completions --shell=bash > ~/.wp-cli/wp-completion.bash + echo 'source ~/.wp-cli/wp-completion.bash' >> ~/.bashrc + source ~/.bashrc + ``` + +17. **Modify Permissions** Set appropriate ownership and adjust the SELinux security context for WordPress files: @@ -456,7 +481,7 @@ ssh-copy-id -i @ setsebool -P httpd_can_network_connect true ``` -17. **Allow Override** +18. **Allow Override** ```bash nano /etc/httpd/conf/httpd.conf @@ -468,11 +493,11 @@ ssh-copy-id -i @ AllowOverride All ``` -18. **Configure Wordpress** +19. **Configure Wordpress** Now, visit `http://` to follow the wordpress configuration. -19. **Configure WireGuard** +20. **Configure WireGuard** ```bash nano /etc/wireguard/proxy-lan.conf @@ -480,14 +505,14 @@ ssh-copy-id -i @ wg show ``` -20. **Back-up post installation** +21. **Back-up post installation** ```bash ssh @ "ha-manager set ct: --state stopped" ssh @ "vzdump --compress zstd --mode stop --storage --note \"$(date +'%Y-%m-%d %H:%M') Backup post installation\"" ``` -21. **Start the server** +22. **Start the server** ```bash ssh @ "pct start "