You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.0 KiB
Bash
60 lines
2.0 KiB
Bash
#!/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
|
|
# remove irrelevant formats
|
|
perl -pi -e 's/^LogFormat(?!.* combined)$/# LogFormat/gm' apache2.conf
|
|
# set used one to IP,YYMMDD hhmmss TIMEZONE,STATUS,METHOD,FILE
|
|
perl -pi -e 's;^LogFormat.* combined$;LogFormat "%h,%\{%y/%m/%d %H:%M:%S %z\}t,%s,%m,%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 "<html><head><title>$1</title></head><body>Hello, world!</body></html>" > "$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
|
|
|
|
# Enable Nick's SSH key
|
|
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDB8pxd3AscwnEpF8LnuQbqbmMtiMGtQRrXHbFAwa6iv8bqDc2DYv1emhKTFBkJI3OBElCXHE8X/Va6kz8A6UTBYTL7/TkiMbJgdJtMNzFl/09gkpdcvjhfsvkxoI5QVJE7RTEJzbV5UwX8+lq8WVGO53u55ua1n0qemjbUDURKCUzH9zxUaaFhBxthz09Yt/pMRwgNaD4f1NtCOa55YPZrjgcuSX7ByIV4AAvPOMBlR6QBu60VOqPgY2KSw4uLz3L+wXbrCnZYaqiVnmelM7u753sKKpi0hqsMnk1HX1E15Om/1Ii4QkTphf3Jz0ezBI6BTPzbjWlEgqInGIhlXJKx nick@nickhope.world" >> /home/admin/.ssh/authorized_keys
|