Skip to content

Commit fffcafb

Browse files
authored
minor fixes (#54)
* minor fixes * Update redis-server-ubuntu.sh * Update wordpress_install.sh * Update lib.sh * Update lib.sh * Update README.md
1 parent ad032ad commit fffcafb

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
- PHP-FPM 7.2
1111
- Latest Wordpress (updates automatically)
1212
- WP-CLI
13+
- Redis Cache
1314
- and [more](https://docs.hanssonit.se/s/W6fMouPiqQz3_Mog/virtual-machines-vm/d/W7jL1OPiqQz3_MtV/wordpress-vm-machine-configuration).

lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ REDIS_CONF=/etc/redis/redis.conf
8181
REDIS_SOCK=/var/run/redis/redis-server.sock
8282
RSHUF=$(shuf -i 30-35 -n 1)
8383
REDIS_PASS=$(tr -dc "a-zA-Z0-9@#*=" < /dev/urandom | fold -w "$RSHUF" | head -n 1)
84+
REDISPTXT=/tmp/redispasstxt
8485

8586
# Extra security
8687
SPAMHAUS=/etc/spamhaus.wl

static/redis-server-ubuntu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ fi
8181
sed -i "s|# unixsocket .*|unixsocket $REDIS_SOCK|g" $REDIS_CONF
8282
sed -i "s|# unixsocketperm .*|unixsocketperm 777|g" $REDIS_CONF
8383
sed -i "s|^port.*|port 0|" $REDIS_CONF
84-
sed -i "s|# requirepass .*|requirepass $(cat /tmp/redis_pass.txt)|g" $REDIS_CONF
84+
sed -i "s|# requirepass .*|requirepass $(cat $REDISPTXT)|g" $REDIS_CONF
8585
sed -i 's|# rename-command CONFIG ""|rename-command CONFIG ""|' $REDIS_CONF
8686
redis-cli SHUTDOWN
87-
rm -f /tmp/redis_pass.txt
87+
rm -f $REDISPTXT
8888

8989
# Secure Redis
9090
chown redis:root /etc/redis/redis.conf

wordpress_install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ then
229229
print_text_in_color "$IGreen" "APCu PHP module installation OK!"
230230
fi
231231
{
232-
echo "# APCu settings for Nextcloud"
232+
echo "# APCu settings for Wordpress"
233233
echo "extension=apcu.so"
234234
echo "apc.enabled=1"
235235
echo "apc.shm_segments=1"
@@ -313,7 +313,7 @@ define( 'WP_MEMORY_LIMIT', '128M' );
313313
PHP
314314

315315
# Make sure the passwords are the same, this file will be deleted when Redis is run.
316-
echo "$REDIS_PASS" > /tmp/redis_pass.txt
316+
check_command echo "$REDIS_PASS" > $REDISPTXT
317317

318318
# Install Wordpress
319319
check_command wp_cli_cmd core install --url=http://"$ADDRESS"/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password="$WPADMINPASS" [email protected] --skip-email

0 commit comments

Comments
 (0)