#!/bin/bash # o'course we need apache2 apt-get -y update apt-get -y install apache2 LOGLOC='/var/log/apache2' CONFLOC='/etc/apache2' FILELOC='/var/www/html' # set log format cd $CONFLOC perl -pi -e 's/^LogFormat(?!.* combined)$/# LogFormat/gm' apache2.conf perl -pi -e 's/^LogFormat.* combined$/LogFormat "%h,%t,%s,%H,%f" combined/gm' apache2.conf function createfile { # usage: createfile FILENAME # creates a file with the title of the name and the body "Hello, world!" mkdir -p "$(dirname "$1")" echo "$1Hello, world!" > "$1" } cd $FILELOC for filename in \ wp-login.php \ .env \ plugins/system/debug/debug.xml \ administrator/language/en-GB/en-GB.xml \ administrator/help/en-GB/toc.json \ .git/config \ vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php \ xmlrpc.php \ wp1/wp-includes/wlwmanifest.xml \ wp/wp-includes/wlwmanifest.xml \ wordpress/wp-includes/wlwmanifest.xml \ web/wp-includes/wlwmanifest.xml \ test/wp-includes/wlwmanifest.xml \ site/wp-includes/wlwmanifest.xml \ shop/wp-includes/wlwmanifest.xml \ cms/wp-includes/wlwmanifest.xml \ blog/wp-includes/wlwmanifest.xml \ 2019/wp-includes/wlwmanifest.xml \ wp-load.php \ public/_ignition/health-check \ _ignition/health-check \ admin/.env \ protected/.env \ wp-includes/wp-class.php \ wp-commentin.php \ wp-signin.php; do createfile "$filename" done systemctl restart apache2