diff -urN smeserver-wordpress-1.2.old/createlinks smeserver-wordpress-1.2/createlinks --- smeserver-wordpress-1.2.old/createlinks 2021-03-09 10:01:31.136796105 +0000 +++ smeserver-wordpress-1.2/createlinks 2021-03-11 11:57:58.780424420 +0000 @@ -3,7 +3,7 @@ use esmith::Build::CreateLinks qw(:all); # our event specific for updating with yum without reboot -$event = "smeserver-wordpress-update"; #not needed, but here for completion and edification! +$event = "smeserver-wordpress-update"; #add here the path to your templates needed to expand #see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event # Not needed if no task to be started. @@ -26,6 +26,8 @@ #safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); #safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); +safe_symlink("../actions/wordpress-install.sh", "root/etc/e-smith/events/$event/10wordpress-install"); + #################### # links to add diff -urN smeserver-wordpress-1.2.old/root/etc/e-smith/events/actions/wordpress-install.sh smeserver-wordpress-1.2/root/etc/e-smith/events/actions/wordpress-install.sh --- smeserver-wordpress-1.2.old/root/etc/e-smith/events/actions/wordpress-install.sh 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-wordpress-1.2/root/etc/e-smith/events/actions/wordpress-install.sh 2021-03-11 12:13:04.191529389 +0000 @@ -0,0 +1,104 @@ +#!/bin/bash +# Script Name: WordPress Install Shell Script for SME10 https://koozali.com +# Brian Read brianr@bjsystems.co.uk March 2021 + +# Based on: +# Script URI: http://www.redbridgenet.com/wordpress/wordpress-upgrade-shell-script/ +# Description: Upgrades your WordPress installation following more closely the WordPress guidelines. +# Version: 1.0.0 +# Author: Ed Reckers +# Author URI: http://www.redbridgenet.com/ +# License: GPL2 +# +# Usage ./upgrade.wordpress.sh +# +# Linux bin paths +MYSQLDUMP="$(which mysqldump)" +TAR="$(which tar)" +GZIP="$(which gzip)" +WGET="$(which wget)" +UNZIP="$(which unzip)" +CP="$(which cp)" +RM="$(which rm)" +CD="$(which cd)" +MKDIR="$(which mkdir)" +CHOWN="$(which chown)" + +# Set mysql account credentials +MyNAME=$(db configuration getprop wordpress DbName) +MyUSER=$(db configuration getprop wordpress DbUser) +MyPASS=$(db configuration getprop wordpress DbPassword) +MyHOST="localhost" + +#Temp working area +TEMPDIR=$(mktemp -d) + +# Directory containing your wordpress installation +WEBROOT="/usr/share/wordpress/" + +# Get a sortable date like 2011-01-01 for full backups +FULLDATE="$(date +"%Y-%m-%d")" + +# Create progress dots function +show_dots() { + while ps $1 >/dev/null ; do + printf "." + sleep 1 + done + printf "\n" +} + +#Place to find the latest WordPress +LATEST_WP="latest.zip" +URL_FOR_WP_DOWNLOAD="http://wordpress.org/"$LATEST_WP + +# Check if Wordpress already here, if so exit +$MKDIR -p $WEBROOT +$CD $WEBROOT +if [[ -d wp-admin && -d wp-includes && -d wp-content ]]; then + echo "Found WordPress in $WEBROOT - exiting" + exit +fi +$CD $TEMPDIR + +# Get the latest WordPress package +$RM -f $LATEST_WP +echo "get WordPress package..." +$WGET -qq $URL_FOR_WP_DOWNLOAD & +show_dots $! + +#Check download worked +if [ ! -f "$LATEST_WP" ]; then + echo "Unable to download WordPress from $URL_FOR_WP_DOWNLOAD" + exit +fi + +# Unzip the files +echo "unzip WordPress package..." +$UNZIP -q latest.zip; + +# Remove the zip file +echo "remove WordPress package..." +$RM latest.zip; + +# Copy all new files from unziped WordPress package into your installation +echo "copy new WordPress files..." +$CP -r wordpress/* $WEBROOT; +echo "Create link to /etc/wordpress/wp-config.php" +touch /etc/wordpress/wp-config.php +ln -s /etc/wordpress/wp-config.php $WEBROOT/wp-config.php +echo "..and reset ownership" +$CHOWN -R www:root $WEBROOT; + +# Remove the unzipped folder +echo "cleanup unzipped WordPress package..." +$RM -r wordpress/; + +# And remove Temp dir +$RM -R ${TEMPDIR} + +# Output that all steps are complete +echo "Wordpress Successfully Installed"; + +#exit from script execution + diff -urN smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress --- smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress 2021-03-09 10:01:31.136796105 +0000 +++ smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92wordpress 2021-03-12 10:44:50.795719669 +0000 @@ -65,11 +65,10 @@ $OUT .= "\n"; $OUT .= "\n"; -$version = "73"; -$OUT .= "\n"; -$OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n"; -$OUT .= "\n"; - + $version = "73"; + $OUT .= "\n"; + $OUT .= "SetHandler \"proxy:unix:/var/run/php-fpm/php$version.sock|fcgi://localhost\"\n"; + $OUT .= "\n"; $OUT .= " AddType application/x-httpd-php .php\n"; $OUT .= " #php_admin_value open_basedir /usr/share/wordpress:/etc/wordpress:/tmp/:/usr/share/pear:/usr/share/php/\n"; @@ -85,6 +84,7 @@ $OUT .= " #php_value mysql.default_user $wordpress{DbUser}\n"; $OUT .= " #php_value mysql.default_password $wordpress{DbPassword}\n"; $OUT .= " #php_admin_value upload_tmp_dir /tmp\n"; + if ($pass) { $OUT .= " AuthName \"$name\"\n"; diff -urN smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist --- smeserver-wordpress-1.2.old/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist 2015-02-10 08:27:41.000000000 +0000 +++ smeserver-wordpress-1.2/root/etc/e-smith/templates/etc/wordpress/wp-config.php/20inc_dist 2021-03-12 12:00:46.095236092 +0000 @@ -64,14 +64,17 @@ * See http://make.wordpress.org/core/2013/10/25/the-definitive-guide-to-disabling-auto-updates-in-wordpress-3-7 */ -/* Disable all file change, as RPM base installation are read-only */ +/*Allow filees to be modified allowing in place updates */ define('DISALLOW_FILE_MODS', false); -/* Disable automatic updater, in case you want to allow - above FILE_MODS for plugins, themes, ... */ -define('AUTOMATIC_UPDATER_DISABLED', true); +/* Move to install wordpress direct, no rpm, so need to enable in place changes and updates */ +define('AUTOMATIC_UPDATER_DISABLED', false); -/* Core update is always disabled, WP_AUTO_UPDATE_CORE value is ignore */ +/* Need this to avoid the ftp questions on every update */ +define('FS_METHOD','direct'); + +/* Enable all core updates, including minor and major: */ +define( 'WP_AUTO_UPDATE_CORE', true ); /**