Update 'Apache-Installer.sh'

This commit is contained in:
tbergervoet
2018-10-05 15:19:01 +02:00
parent f2657753c8
commit 61fb7e26c7

View File

@@ -23,7 +23,6 @@ chmod -R 755 /var/www
apt install -y apache2 mysql-server-5.7 libapache2-mod-proxy-html apt install -y apache2 mysql-server-5.7 libapache2-mod-proxy-html
# mysql_secure_installation automated # mysql_secure_installation automated
mysqladmin -u root password "$password" mysqladmin -u root password "$password"
mysql -u root -p"$password" -e "UPDATE mysql.user SET Password=PASSWORD('$password') WHERE User='root'"
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')"
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User=''" mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User=''"
mysql -u root -p"$password" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'" mysql -u root -p"$password" -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'"
@@ -112,8 +111,7 @@ newaliases
# Netdata # # Netdata #
##-------------## ##-------------##
if [ $netdata = 1 ] if [ $netdata = 1 ]; then
then
apt install -y netdata apt install -y netdata
sed -i 's/SEND_EMAIL="YES"/SEND_EMAIL="NO"/g' /etc/netdata/health_alarm_notify.conf sed -i 's/SEND_EMAIL="YES"/SEND_EMAIL="NO"/g' /etc/netdata/health_alarm_notify.conf
ufw allow 19999/tcp ufw allow 19999/tcp
@@ -126,8 +124,7 @@ fi
# Memcached # # Memcached #
##---------------## ##---------------##
if [ $memcached = 1 ] if [ $memcached = 1 ]; then
then
apt install -y memcached apt install -y memcached
# systemctl stop memcached # systemctl stop memcached
# systemctl disable memcached # systemctl disable memcached
@@ -137,8 +134,7 @@ fi
# Redis # # Redis #
##-----------## ##-----------##
if [ $redis = 1 ] if [ $redis = 1 ]; then
then
apt install -y redis-server apt install -y redis-server
sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf
sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf
@@ -158,8 +154,7 @@ certbot --apache -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect
# Wordpress # # Wordpress #
##---------------## ##---------------##
if [ $wordpress = 1 ] if [ $wordpress = 1 ]; then
then
db_name="wp_1" db_name="wp_1"
db_user="wp_1" db_user="wp_1"
db_pass=$(date +%s|sha256sum|base64|head -c 32) db_pass=$(date +%s|sha256sum|base64|head -c 32)