Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
- PHP-FPM 7.2
- Latest Wordpress (updates automatically)
- WP-CLI
- Redis Cache
- and [more](https://docs.hanssonit.se/s/W6fMouPiqQz3_Mog/virtual-machines-vm/d/W7jL1OPiqQz3_MtV/wordpress-vm-machine-configuration).
1 change: 1 addition & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ REDIS_CONF=/etc/redis/redis.conf
REDIS_SOCK=/var/run/redis/redis-server.sock
RSHUF=$(shuf -i 30-35 -n 1)
REDIS_PASS=$(tr -dc "a-zA-Z0-9@#*=" < /dev/urandom | fold -w "$RSHUF" | head -n 1)
REDISPTXT=/tmp/redispasstxt

# Extra security
SPAMHAUS=/etc/spamhaus.wl
Expand Down
4 changes: 2 additions & 2 deletions static/redis-server-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ fi
sed -i "s|# unixsocket .*|unixsocket $REDIS_SOCK|g" $REDIS_CONF
sed -i "s|# unixsocketperm .*|unixsocketperm 777|g" $REDIS_CONF
sed -i "s|^port.*|port 0|" $REDIS_CONF
sed -i "s|# requirepass .*|requirepass $(cat /tmp/redis_pass.txt)|g" $REDIS_CONF
sed -i "s|# requirepass .*|requirepass $(cat $REDISPTXT)|g" $REDIS_CONF
sed -i 's|# rename-command CONFIG ""|rename-command CONFIG ""|' $REDIS_CONF
redis-cli SHUTDOWN
rm -f /tmp/redis_pass.txt
rm -f $REDISPTXT

# Secure Redis
chown redis:root /etc/redis/redis.conf
Expand Down
4 changes: 2 additions & 2 deletions wordpress_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ then
print_text_in_color "$IGreen" "APCu PHP module installation OK!"
fi
{
echo "# APCu settings for Nextcloud"
echo "# APCu settings for Wordpress"
echo "extension=apcu.so"
echo "apc.enabled=1"
echo "apc.shm_segments=1"
Expand Down Expand Up @@ -313,7 +313,7 @@ define( 'WP_MEMORY_LIMIT', '128M' );
PHP

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

# Install Wordpress
check_command wp_cli_cmd core install --url=http://"$ADDRESS"/ --title=Wordpress --admin_user=$WPADMINUSER --admin_password="$WPADMINPASS" --admin_email=no-reply@hanssonit.se --skip-email
Expand Down