From 227a940563a505a0eaf7acbba59b7b7cfca8dd40 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 26 Sep 2023 10:27:10 -0700 Subject: [PATCH] add new wp-secuirty apache conf --- apache2/conf-available/wp-secuirty.conf | 13 +++++++++++++ install.sh | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 apache2/conf-available/wp-secuirty.conf diff --git a/apache2/conf-available/wp-secuirty.conf b/apache2/conf-available/wp-secuirty.conf new file mode 100644 index 0000000..2325988 --- /dev/null +++ b/apache2/conf-available/wp-secuirty.conf @@ -0,0 +1,13 @@ +# restrict access to wordpress directories + + + order deny,allow + deny from all + + + + + Order Deny,Allow + Deny from All + + diff --git a/install.sh b/install.sh index 339d14e..924c78a 100755 --- a/install.sh +++ b/install.sh @@ -34,6 +34,12 @@ chmod 644 /usr/local/lib/systemd/system/wp-cron.* systemctl enable wp-cron.timer systemctl start wp-cron.timer +# enable wp-security, restricts access to wordpress directories +cp apache2/conf-available/wp-secuirty.conf /etc/apache2/conf-available/wp-secuirty.conf +chmod 644 /etc/apache2/conf-available/wp-secuirty.conf +a2enconf wp-secuirty +systemctl reload apache2 + # fail2ban wordpress configs if [[ -d /etc/fail2ban/ ]]; then chmod 644 fail2ban/filter.d/* @@ -44,3 +50,4 @@ if [[ -d /etc/fail2ban/ ]]; then else echo "Fail2ban not installed, skipping fail2ban wordpress configs." fi +