'Apache-Installer.sh' updaten

This commit is contained in:
ictmaatwerk
2018-09-12 13:10:55 +00:00
parent 1ad4244133
commit 106b4884ab

View File

@@ -14,7 +14,7 @@
# LAMP #
#-------------------#
apt install apache2 mysql-server-5.7 -y
apt install -y apache2 mysql-server-5.7
mysql_secure_installation
mysql -u root -p"$passwd" -e "SELECT user,authentication_string,plugin,host FROM mysql.user;"
mysql -u root -p"$passwd" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '"$passwd"';"
@@ -55,7 +55,7 @@ systemctl restart apache2
# PHPMYADMIN #
#-------------------#
apt-get install phpmyadmin -y
apt install -y phpmyadmin
ln -s /usr/share/phpmyadmin /var/www/"$domain"/public_html
# Redirect phpmyadmin -> database
mv /var/www/"$domain"/public_html/phpmyadmin /var/www/"$domain"/public_html/database
@@ -66,7 +66,9 @@ systemctl restart apache2
# POSTFIX #
#-------------------#
apt install mailutils -y
debconf-set-selections <<< "postfix postfix/mailname string $domain"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'"
apt install -y mailutils
sed -i 's/#inet_interfaces = all/inet_interfaces = loopback-only/g' /etc/postfix/main.cf
sed -i 's/mydestination/#mydestination/g' /etc/postfix/main.cf
sed -i 's/relayhost =/mydestination = '$domain', localhost.'$domain', '$domain'/g' /etc/postfix/main.cf
@@ -84,7 +86,7 @@ newaliases
if [ $netdata = 1 ]
then
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
apt install -y netdata
ufw allow 19999/tcp
# systemctl stop netdata
# systemctl disable netdata
@@ -97,7 +99,7 @@ fi
if [ $memcached = 1 ]
then
apt-get install memcached -y
apt install -y memcached
systemctl restart memcached
# systemctl stop memcached
# systemctl disable memcached
@@ -110,7 +112,7 @@ fi
if [ $redis = 1 ]
then
apt install redis-server -y
apt install -y redis-server
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/# requirepass foobared/requirepass '$passwd'/g' /etc/redis/redis.conf
@@ -126,8 +128,8 @@ fi
# CERTBOT #
#-------------------#
add-apt-repository ppa:certbot/certbot
apt install python-certbot-apache -y
add-apt-repository -y ppa:certbot/certbot
apt install -y python-certbot-apache
#certbot --apache -d $domain -d www.$domain
#sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/apache2/sites-available/"$domain"
#sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/apache2/sites-available/"$domain"